diff options
Diffstat (limited to 'sql/password.c')
-rw-r--r-- | sql/password.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/sql/password.c b/sql/password.c index 29a501986f4..236e7bde0d5 100644 --- a/sql/password.c +++ b/sql/password.c @@ -58,6 +58,7 @@ *****************************************************************************/ +#include <password.h> #include <my_global.h> #include <my_sys.h> #include <m_string.h> @@ -217,15 +218,15 @@ void scramble_323(char *to, const char *message, const char *password) */ my_bool -check_scramble_323(const char *scrambled, const char *message, +check_scramble_323(const unsigned char *scrambled, const char *message, ulong *hash_pass) { struct rand_struct rand_st; ulong hash_message[2]; /* Big enough for checks. */ - char buff[16], scrambled_buff[SCRAMBLE_LENGTH_323 + 1]; - char *to, extra; - const char *pos; + uchar buff[16], scrambled_buff[SCRAMBLE_LENGTH_323 + 1]; + uchar *to, extra; + const uchar *pos; /* Ensure that the scrambled message is null-terminated. */ memcpy(scrambled_buff, scrambled, SCRAMBLE_LENGTH_323); @@ -245,7 +246,7 @@ check_scramble_323(const char *scrambled, const char *message, to=buff; while (*scrambled) { - if (*scrambled++ != (char) (*to++ ^ extra)) + if (*scrambled++ != (uchar) (*to++ ^ extra)) return 1; /* Wrong password */ } return 0; @@ -511,7 +512,7 @@ scramble(char *to, const char *message, const char *password) */ my_bool -check_scramble(const char *scramble_arg, const char *message, +check_scramble(const uchar *scramble_arg, const char *message, const uint8 *hash_stage2) { SHA1_CONTEXT sha1_context; @@ -524,7 +525,7 @@ check_scramble(const char *scramble_arg, const char *message, mysql_sha1_input(&sha1_context, hash_stage2, SHA1_HASH_SIZE); mysql_sha1_result(&sha1_context, buf); /* encrypt scramble */ - my_crypt((char *) buf, buf, (const uchar *) scramble_arg, SCRAMBLE_LENGTH); + my_crypt((char *) buf, buf, scramble_arg, SCRAMBLE_LENGTH); /* now buf supposedly contains hash_stage1: so we can get hash_stage2 */ mysql_sha1_reset(&sha1_context); mysql_sha1_input(&sha1_context, buf, SHA1_HASH_SIZE); |