Merge pull request #493 from jbech-linaro/rijndael_range

check range in _rijndael_ecb_ functions
This commit is contained in:
Steffen Jaeckel 2019-09-04 13:44:47 +02:00 committed by GitHub
commit a1f6312416
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -295,6 +295,10 @@ int ECB_ENC(const unsigned char *pt, unsigned char *ct, const symmetric_key *ske
LTC_ARGCHK(skey != NULL); LTC_ARGCHK(skey != NULL);
Nr = skey->rijndael.Nr; Nr = skey->rijndael.Nr;
if (Nr < 2 || Nr > 16)
return CRYPT_INVALID_ROUNDS;
rk = skey->rijndael.eK; rk = skey->rijndael.eK;
/* /*
@ -475,6 +479,10 @@ int ECB_DEC(const unsigned char *ct, unsigned char *pt, const symmetric_key *ske
LTC_ARGCHK(skey != NULL); LTC_ARGCHK(skey != NULL);
Nr = skey->rijndael.Nr; Nr = skey->rijndael.Nr;
if (Nr < 2 || Nr > 16)
return CRYPT_INVALID_ROUNDS;
rk = skey->rijndael.dK; rk = skey->rijndael.dK;
/* /*