mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2026-07-11 03:20:51 +02:00
4880b27d55
Several AES ArgMcdc tests corrupt aes.rounds (or cmac.aes.rounds) and expect the subsequent op to fail with KEYUSAGE_E from the in-process software AES path. Under WOLF_CRYPTO_CB_FIND (e.g. --enable-swdev), the "devId != INVALID_DEVID" guard is removed, so CTR/CCM/CMAC ops are offloaded to the registered crypto callback even for INVALID_DEVID; the callback re-derives the key and ignores the corrupted struct, returning 0 instead of KEYUSAGE_E and failing the assertion. Guard those internal-failure checks with #ifndef WOLF_CRYPTO_CB_FIND (wc_AesCtrEncrypt, wc_AesCfb/OfbEncrypt/Decrypt, wc_AesCcmEncrypt/Decrypt, wc_CmacUpdate); the raw-block wc_AesEncryptDirect path in SetKey does not route through cryptocb, so it stays. (void)-cast the locals only used by the guarded checks to keep -Werror clean. MC/DC is unioned across configs, so no union coverage is lost. Verified: --enable-swdev ... (WOLF_CRYPTO_CB_FIND) now passes, and a non-CB_FIND build with all these modes still runs and passes the checks.
Before creating any new configure files (.conf) read the CONF_FILES_README.md