Skip to content

Commit 83d71ee

Browse files
committed
guard DES3 length test with HAVE_FIPS
1 parent 0525301 commit 83d71ee

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

tests/api/test_des3.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,11 +165,15 @@ int test_wc_Des3_CbcEncryptDecrypt(void)
165165
ExpectIntEQ(wc_Des3_CbcDecrypt(&des, plain, NULL, 24),
166166
WC_NO_ERR_TRACE(BAD_FUNC_ARG));
167167

168-
/* non-block-aligned input rejected with BAD_LENGTH_E */
168+
#ifndef HAVE_FIPS
169+
/* non-block-aligned input rejected with BAD_LENGTH_E.
170+
* FIPS builds use the FIPS-certified DES3 implementation which does not
171+
* have this check, so skip the test for FIPS. */
169172
ExpectIntEQ(wc_Des3_CbcEncrypt(&des, cipher, vector, DES_BLOCK_SIZE - 1),
170173
WC_NO_ERR_TRACE(BAD_LENGTH_E));
171174
ExpectIntEQ(wc_Des3_CbcDecrypt(&des, plain, cipher, DES_BLOCK_SIZE - 1),
172175
WC_NO_ERR_TRACE(BAD_LENGTH_E));
176+
#endif
173177

174178
wc_Des3Free(&des);
175179
#endif

0 commit comments

Comments
 (0)