Merge pull request #4255 from SparkiDev/afalg_msg_fix

AF_ALG: fix debug messages
This commit is contained in:
David Garske
2021-07-28 16:40:09 -07:00
committed by GitHub

View File

@ -538,8 +538,12 @@ int wc_AesGcmEncrypt(Aes* aes, byte* out, const byte* in, word32 sz,
return BAD_FUNC_ARG;
}
if (ivSz != WC_SYSTEM_AESGCM_IV || authTagSz > WOLFSSL_MAX_AUTH_TAG_SZ) {
WOLFSSL_MSG("IV/AAD size not supported on system");
if (ivSz != WC_SYSTEM_AESGCM_IV) {
WOLFSSL_MSG("IV size not supported on system");
return BAD_FUNC_ARG;
}
if (authTagSz > WOLFSSL_MAX_AUTH_TAG_SZ) {
WOLFSSL_MSG("Authentication tag size not supported on system");
return BAD_FUNC_ARG;
}
@ -722,8 +726,12 @@ int wc_AesGcmDecrypt(Aes* aes, byte* out, const byte* in, word32 sz,
return BAD_FUNC_ARG;
}
if (ivSz != WC_SYSTEM_AESGCM_IV || authTagSz > WOLFSSL_MAX_AUTH_TAG_SZ) {
WOLFSSL_MSG("IV/AAD size not supported on system");
if (ivSz != WC_SYSTEM_AESGCM_IV) {
WOLFSSL_MSG("IV size not supported on system");
return BAD_FUNC_ARG;
}
if (authTagSz > WOLFSSL_MAX_AUTH_TAG_SZ) {
WOLFSSL_MSG("Authentication tag size not supported on system");
return BAD_FUNC_ARG;
}