fix F-709: AES-XTS Stream Finalize Returns Untranslated wolfCrypt Error Code to Kernel LKCAPI

This commit is contained in:
Daniel Pouzzner
2026-06-12 16:56:30 -05:00
parent 8110d567c8
commit 0272f0a506
+10
View File
@@ -2312,6 +2312,11 @@ static int km_AesXtsEncrypt(struct skcipher_request *req)
err = skcipher_walk_done(&walk, 0);
} else if (! (stream.bytes_crypted_with_this_tweak & ((word32)WC_AES_BLOCK_SIZE - 1U))) {
err = wc_AesXtsEncryptFinal(ctx->aesXts, NULL, NULL, 0, &stream);
if (unlikely(err)) {
pr_err("%s: wc_AesXtsEncryptFinal failed: %d\n",
crypto_tfm_alg_driver_name(crypto_skcipher_tfm(tfm)), err);
err = -EINVAL;
}
}
}
@@ -2458,6 +2463,11 @@ static int km_AesXtsDecrypt(struct skcipher_request *req)
err = skcipher_walk_done(&walk, 0);
} else if (! (stream.bytes_crypted_with_this_tweak & ((word32)WC_AES_BLOCK_SIZE - 1U))) {
err = wc_AesXtsDecryptFinal(ctx->aesXts, NULL, NULL, 0, &stream);
if (unlikely(err)) {
pr_err("%s: wc_AesXtsDecryptFinal failed: %d\n",
crypto_tfm_alg_driver_name(crypto_skcipher_tfm(tfm)), err);
err = -EINVAL;
}
}
}