1
0
mirror of https://github.com/wolfSSL/wolfssl.git synced 2026-10-24 04:09:07 +03:00

tests: skip single-DES NULL-arg MC/DC under FIPS/selftest (SIGSEGV)

test_wc_Des_CbcEncryptDecrypt drove the per-operand NULL guards of
wc_Des_CbcEncrypt/CbcDecrypt/EcbEncrypt/SetIV. The frozen FIPS/selftest
single-DES module predates those open-build NULL checks and dereferences a
NULL des/out/in directly, so the probes segfault (exit 139) in a FIPS build.
Gate the whole test on !HAVE_FIPS && !HAVE_SELFTEST -- this single-DES MC/DC
coverage is gathered in the open build; the frozen module is out of its scope.
This commit is contained in:
Daniele Lacamera
2026-07-29 15:47:25 +02:00
parent 6213cbf1cf
commit 7aee0419ea

View File

@@ -302,7 +302,12 @@ int test_wc_Des3_EcbEncrypt(void)
int test_wc_Des_CbcEncryptDecrypt(void)
{
EXPECT_DECLS;
#ifndef NO_DES3
/* The frozen FIPS/selftest single-DES module does not NULL-check its arguments
* (the open-build guards these tests exercise were added post-freeze), so the
* per-operand NULL probes below dereference NULL and crash under HAVE_FIPS /
* HAVE_SELFTEST. This single-DES MC/DC coverage is gathered in the open build;
* skip it on the frozen modules. */
#if !defined(NO_DES3) && !defined(HAVE_FIPS) && !defined(HAVE_SELFTEST)
Des des;
byte cipher[DES_BLOCK_SIZE];
byte plain[DES_BLOCK_SIZE];