mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-08-01 03:34: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;
|
||||
}
|
||||
if (haveAESNI) {
|
||||
#ifdef WOLFSSL_LINUXKM
|
||||
/* runtime alignment check */
|
||||
if ((unsigned long)&aes->key & 0xf) {
|
||||
return BAD_ALIGN_E;
|
||||
}
|
||||
#endif
|
||||
aes->use_aesni = 1;
|
||||
if (iv)
|
||||
XMEMCPY(aes->reg, iv, AES_BLOCK_SIZE);
|
||||
|
Reference in New Issue
Block a user