diff --git a/src/ciphers/aes/aes.c b/src/ciphers/aes/aes.c index 8ba1bfcc..0352d209 100644 --- a/src/ciphers/aes/aes.c +++ b/src/ciphers/aes/aes.c @@ -295,6 +295,10 @@ int ECB_ENC(const unsigned char *pt, unsigned char *ct, const symmetric_key *ske LTC_ARGCHK(skey != NULL); Nr = skey->rijndael.Nr; + + if (Nr < 2 || Nr > 16) + return CRYPT_INVALID_ROUNDS; + 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); Nr = skey->rijndael.Nr; + + if (Nr < 2 || Nr > 16) + return CRYPT_INVALID_ROUNDS; + rk = skey->rijndael.dK; /*