wolfSSL / wolfssl

The wolfSSL library is a small, fast, portable implementation of TLS/SSL for embedded devices to the cloud. wolfSSL supports up to TLS 1.3 and DTLS 1.3!
https://www.wolfssl.com
GNU General Public License v2.0
2.36k stars 834 forks source link

20241025-fixes #8114

Closed douzzer closed 3 weeks ago

douzzer commented 3 weeks ago

fixes for gating and ARM32 alignment defects:

wolfcrypt/src/port/arm/armv8-aes.c: in the WOLFSSL_ARMASM_NO_HW_CRYPTO version of wc_AesSetKey(), copy the supplied userKey to a properly aligned buffer if necessary before calling AES_set_encrypt_key();

src/dtls13.c: in Dtls13GetRnMask(), if defined(WOLFSSL_LINUXKM), return retval of wc_AesEncryptDirect();

wolfcrypt/src/misc.c: add readUnalignedWord32(), writeUnalignedWord32(), readUnalignedWords32(), and writeUnalignedWords32();

wolfcrypt/src/siphash.c: use readUnalignedWord64(), readUnalignedWord32(), and writeUnalignedWord64(), to avoid unaligned access faults, and fix cast in byte-reversing version of GET_U32().

tested with wolfssl-multi-test.sh ... linuxkm-all-fips-140-3 quantum-safe-wolfssl-all-cross-armv7a-armasm-unittest-Os quantum-safe-wolfssl-all-cross-armv7a-armasm-unittest-Os-smallstack quantum-safe-wolfssl-all-cross-armv7a-armasm-unittest-sanitizer-Os-smallstack quantum-safe-wolfssl-all-intelasm-sp-asm-valgrind-Os super-quick-check