Skip to content

Commit 0b035e3

Browse files
committed
fixed a wrong size passed to aes_decrypt
1 parent e440685 commit 0b035e3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

client/auth_utils.cc

+2-2
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ int decrypt_login_cnf_file(istream &fin, ostream &sout)
8585
int len;
8686
char len_buf[MAX_CIPHER_STORE_LEN];
8787
char cipher[MAX_CIPHER_LEN];
88-
fin.read(len_buf, 4);
88+
fin.read(len_buf, MAX_CIPHER_STORE_LEN);
8989
len= sint4korr(len_buf);
9090
if (len == 0 || fin.eof())
9191
break;
@@ -97,7 +97,7 @@ int decrypt_login_cnf_file(istream &fin, ostream &sout)
9797
aes_length= my_aes_decrypt((const unsigned char *) cipher, len,
9898
(unsigned char *) plain,
9999
(const unsigned char *) rkey,
100-
MAX_CIPHER_LEN, my_aes_128_ecb, NULL);
100+
LOGIN_KEY_LEN, my_aes_128_ecb, NULL);
101101
if (aes_length > MAX_CIPHER_LEN)
102102
return ERR_ENCRYPTION;
103103
plain[aes_length]= 0;

0 commit comments

Comments
 (0)