add AUTH_SZ size check to ti and armv8 ports
This commit is contained in:
parent
c1c7c90345
commit
a348898e96
@ -2532,6 +2532,11 @@ int wc_AesGcmEncrypt(Aes* aes, byte* out, const byte* in, word32 sz,
|
||||
return BAD_FUNC_ARG;
|
||||
}
|
||||
|
||||
if (authTagSz < WOLFSSL_MIN_AUTH_TAG_SZ) {
|
||||
WOLFSSL_MSG("GcmEncrypt authTagSz too small error");
|
||||
return BAD_FUNC_ARG;
|
||||
}
|
||||
|
||||
switch (aes->rounds) {
|
||||
case 10:
|
||||
return Aes128GcmEncrypt(aes, out, in, sz, iv, ivSz,
|
||||
|
@ -490,6 +490,9 @@ WOLFSSL_API int wc_AesGcmEncrypt(Aes* aes, byte* out, const byte* in, word32 sz
|
||||
byte* authTag, word32 authTagSz,
|
||||
const byte* authIn, word32 authInSz)
|
||||
{
|
||||
if (authTagSz < WOLFSSL_MIN_AUTH_TAG_SZ) {
|
||||
return BAD_FUNC_ARG;
|
||||
}
|
||||
return AesAuthEncrypt(aes, out, in, sz, iv, ivSz, authTag, authTagSz,
|
||||
authIn, authInSz, AES_CFG_MODE_GCM_HY0CALC) ;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user