From e4b7857e4302329da125a6dcb9a4e070462c1804 Mon Sep 17 00:00:00 2001 From: Anthony Hu Date: Thu, 28 Mar 2024 17:59:26 -0400 Subject: [PATCH] If WOLFSSL_TRUST_PEER_CERT is defined, the negative test is no longer negative. --- tests/api.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tests/api.c b/tests/api.c index c6c6cc90b..33e40f173 100644 --- a/tests/api.c +++ b/tests/api.c @@ -1136,7 +1136,9 @@ static int test_dual_alg_support(void) /* Now we try a negative case. Note that we use wrongPrivFile to generate * the alternative signature and then set negative_test to true for the * call to do_dual_alg_tls13_connection(). Its expecting a failed connection - * because the signature won't verify. */ + * because the signature won't verify. The exception is if + * WOLFSSL_TRUST_PEER_CERT is defined. In that case, no verfication happens + * and this is no longer a negative test. */ rootSz = do_dual_alg_root_certgen(&root, keyFile, sapkiFile, wrongPrivFile); ExpectNotNull(root); ExpectIntGT(rootSz, 0); @@ -1144,9 +1146,15 @@ static int test_dual_alg_support(void) wrongPrivFile, keyFile, root, rootSz); ExpectNotNull(server); ExpectIntGT(serverSz, 0); +#ifdef WOLFSSL_TRUST_PEER_CERT + ExpectIntEQ(do_dual_alg_tls13_connection(root, rootSz, + server, serverSz, serverKey, (word32)serverKeySz, 0), + TEST_SUCCESS); +#else ExpectIntEQ(do_dual_alg_tls13_connection(root, rootSz, server, serverSz, serverKey, (word32)serverKeySz, 1), TEST_SUCCESS); +#endif /* Lets see if CertManager can find the new extensions */ extCount = 0;