1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-07 00:04:31 +03:00

check_scramble_323 shuold ensure that the scramble has the correct length

This commit is contained in:
serg@serg.mylan
2004-06-01 23:58:33 +02:00
parent 53d05f4adb
commit 6341c93d77
2 changed files with 4 additions and 2 deletions

View File

@@ -218,6 +218,8 @@ check_scramble_323(const char *scrambled, const char *message,
to=buff;
for (pos=scrambled ; *pos ; pos++)
*to++=(char) (floor(my_rnd(&rand_st)*31)+64);
if (pos-scrambled != SCRAMBLE_LENGTH_323)
return 1;
extra=(char) (floor(my_rnd(&rand_st)*31));
to=buff;
while (*scrambled)

View File

@@ -629,8 +629,8 @@ int acl_getroot(THD *thd, USER_RESOURCES *mqh,
if (passwd_len == acl_user_tmp->salt_len)
{
if (acl_user_tmp->salt_len == 0 ||
acl_user_tmp->salt_len == SCRAMBLE_LENGTH &&
check_scramble(passwd, thd->scramble, acl_user_tmp->salt) == 0 ||
(acl_user_tmp->salt_len == SCRAMBLE_LENGTH &&
check_scramble(passwd, thd->scramble, acl_user_tmp->salt) == 0) ||
check_scramble_323(passwd, thd->scramble,
(ulong *) acl_user_tmp->salt) == 0)
{