Merge pull request #493 from jbech-linaro/rijndael_range
check range in _rijndael_ecb_ functions
This commit is contained in:
commit
a1f6312416
@ -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;
|
||||
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user