mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-07-30 02:37:28 +02:00
fix check on non aad use
This commit is contained in:
@ -627,7 +627,7 @@ int wc_AesGcmDecrypt(Aes* aes, byte* out,
|
||||
/* calls to hardened crypto */
|
||||
XSecure_AesInitialize(&(aes->xilAes), &(aes->dma), aes->kup,
|
||||
(word32*)iv, aes->keyInit);
|
||||
XSecure_AesDecryptData(&(aes->xilAes), out, in, sz, tag);
|
||||
ret = XSecure_AesDecryptData(&(aes->xilAes), out, in, sz, tag);
|
||||
|
||||
/* account for additional data */
|
||||
if (authIn != NULL && authInSz > 0) {
|
||||
@ -640,6 +640,12 @@ int wc_AesGcmDecrypt(Aes* aes, byte* out,
|
||||
return AES_GCM_AUTH_E;
|
||||
}
|
||||
}
|
||||
else {
|
||||
/* if no aad then check the result of the initial tag passed in */
|
||||
if (ret != XST_SUCCESS) {
|
||||
return AES_GCM_AUTH_E;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
|
Reference in New Issue
Block a user