Fix camellia_keysize() to not change the keysize if it is correct.

It was rounding 32 down to 24, 24 down to 16, and claiming 16 was invalid.
This commit is contained in:
Patrick Pelletier 2011-10-05 01:34:41 -07:00 committed by Steffen Jaeckel
parent e3acd4cabe
commit 65254f65bf

View File

@ -711,9 +711,9 @@ void camellia_done(symmetric_key *skey) {}
int camellia_keysize(int *keysize)
{
if (*keysize > 32) { *keysize = 32; }
else if (*keysize > 24) { *keysize = 24; }
else if (*keysize > 16) { *keysize = 16; }
if (*keysize >= 32) { *keysize = 32; }
else if (*keysize >= 24) { *keysize = 24; }
else if (*keysize >= 16) { *keysize = 16; }
else return CRYPT_INVALID_KEYSIZE;
return CRYPT_OK;
}