mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2026-08-04 02:24:37 +02:00
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:
@@ -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)) {
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user