mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-08-02 04:04:39 +02:00
wolfcrypt/src/aes.c: in wc_AesSetKeyLocal(), add an alignment check in the haveAESNI path for WOLFSSL_LINUXKM, because the failure mode is module crash.
This commit is contained in:
@@ -3129,6 +3129,12 @@ static WARN_UNUSED_RESULT int wc_AesDecrypt(
|
|||||||
checkAESNI = 1;
|
checkAESNI = 1;
|
||||||
}
|
}
|
||||||
if (haveAESNI) {
|
if (haveAESNI) {
|
||||||
|
#ifdef WOLFSSL_LINUXKM
|
||||||
|
/* runtime alignment check */
|
||||||
|
if ((unsigned long)&aes->key & 0xf) {
|
||||||
|
return BAD_ALIGN_E;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
aes->use_aesni = 1;
|
aes->use_aesni = 1;
|
||||||
if (iv)
|
if (iv)
|
||||||
XMEMCPY(aes->reg, iv, AES_BLOCK_SIZE);
|
XMEMCPY(aes->reg, iv, AES_BLOCK_SIZE);
|
||||||
|
Reference in New Issue
Block a user