KCAPI and linuxkm fixes from peer review:

linuxkm/lkcapi_aes_glue.c: zero the ephemeral ivOut in AesGcmCrypt_1().

wolfcrypt/src/port/kcapi/kcapi_aes.c: tighten the test on the return value from kcapi_aead_decrypt().
This commit is contained in:
Daniel Pouzzner
2026-07-13 17:12:20 -05:00
parent 436bce8f41
commit 2cf826f03d
2 changed files with 2 additions and 1 deletions
+1
View File
@@ -1505,6 +1505,7 @@ static int AesGcmCrypt_1(struct aead_request *req, int decrypt_p, int rfc4106_p)
byte ivOut[GCM_NONCE_MID_SZ];
err = wc_AesGcmEncrypt_ex(aes_copy, out_text, in_text, req->cryptlen, ivOut, GCM_NONCE_MID_SZ, authTag,
tfm->authsize, assoc, assoclen);
ForceZero(ivOut, GCM_NONCE_MID_SZ);
}
if (unlikely(err)) {
+1 -1
View File
@@ -428,7 +428,7 @@ int wc_AesGcmDecrypt(Aes* aes, byte* out, const byte* in, word32 sz,
if (ret == -EBADMSG)
ret = AES_GCM_AUTH_E;
}
else if (ret > outbuflen) {
else if ((word32)ret != sz + authInSz) {
WOLFSSL_MSG("GcmDecrypt produced wrong output length");
ret = BAD_FUNC_ARG;
}