summaryrefslogtreecommitdiff
path: root/sql/password.c
diff options
context:
space:
mode:
authorSergei Golubchik <sergii@pisem.net>2010-03-29 17:13:53 +0200
committerSergei Golubchik <sergii@pisem.net>2010-03-29 17:13:53 +0200
commit291fd9698340f3d83ff096542720f7335cb078d2 (patch)
tree1e727dd05959dfa20ecc93fc8a4f8050ead61689 /sql/password.c
parent3e13f97bd4aaba25af5558512f933036c952494c (diff)
downloadmariadb-git-291fd9698340f3d83ff096542720f7335cb078d2.tar.gz
pluggable auth with plugin examples
Makefile.am: add new API files to the check_abi rule, remove duplicates client/CMakeLists.txt: now a client can use dlopen too client/Makefile.am: be csh-friendly include/my_global.h: add dummy plugs for dlopen and co. for the code that needs them to work in static builds mysys/Makefile.am: be csh-friendly plugin/auth/dialog.c: typo fixed
Diffstat (limited to 'sql/password.c')
-rw-r--r--sql/password.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/sql/password.c b/sql/password.c
index 3c662e0c8f3..0cfa15b15d6 100644
--- a/sql/password.c
+++ b/sql/password.c
@@ -193,13 +193,13 @@ 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 my_rnd_struct rand_st;
ulong hash_message[2];
- char buff[16],*to,extra; /* Big enough for check */
- const char *pos;
+ uchar buff[16],*to,extra; /* Big enough for check */
+ const uchar *pos;
hash_password(hash_message, message, SCRAMBLE_LENGTH_323);
my_rnd_init(&rand_st,hash_pass[0] ^ hash_message[0],
@@ -214,7 +214,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;
@@ -481,7 +481,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;
@@ -494,7 +494,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);