Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stop testing custom extensions in dual alg cert tests. #7794

Merged
merged 1 commit into from
Jul 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 0 additions & 31 deletions tests/api.c
Original file line number Diff line number Diff line change
Expand Up @@ -1179,8 +1179,6 @@ static int do_dual_alg_server_certgen(byte **out, char *caKeyFile,
newCert.sigType = CTC_SHA256wRSA;
newCert.isCA = 0;
ExpectIntEQ(wc_SetIssuerBuffer(&newCert, caCertBuf, caCertSz), 0);
ExpectIntEQ(wc_SetCustomExtension(&newCert, 0, "1.2.3.4.5",
(const byte *)"This is NOT a critical extension", 32), 0);
ExpectIntEQ(wc_SetCustomExtension(&newCert, 0, "2.5.29.72", sapkiBuf,
sapkiSz), 0);
ExpectIntEQ(wc_SetCustomExtension(&newCert, 0, "2.5.29.73", altSigAlgBuf,
Expand Down Expand Up @@ -1246,21 +1244,6 @@ static int do_dual_alg_tls13_connection(byte *caCert, word32 caCertSz,
return EXPECT_RESULT();
}

static int extCount = 0;
static int myUnknownExtCallback(const word16* oid, word32 oidSz, int crit,
const unsigned char* der, word32 derSz)
{
(void) oid;
(void) oidSz;
(void) crit;
(void) der;
(void) derSz;
extCount ++;
/* Accept all extensions. This is only a test. Normally we would be much more
* careful about critical extensions. */
return 0;
}

static int test_dual_alg_support(void)
{
EXPECT_DECLS;
Expand All @@ -1276,7 +1259,6 @@ static int test_dual_alg_support(void)
int rootSz = 0;
byte *server = NULL;
int serverSz = 0;
WOLFSSL_CERT_MANAGER* cm = NULL;

ExpectIntEQ(load_file(keyFile, &serverKey, &serverKeySz), 0);

Expand Down Expand Up @@ -1329,19 +1311,6 @@ static int test_dual_alg_support(void)
TEST_SUCCESS);
#endif

/* Lets see if CertManager can find the new extensions */
extCount = 0;
ExpectNotNull(cm = wolfSSL_CertManagerNew());
wolfSSL_CertManagerSetUnknownExtCallback(cm, myUnknownExtCallback);
ExpectIntEQ(wolfSSL_CertManagerLoadCABuffer(cm, root, rootSz,
SSL_FILETYPE_ASN1), WOLFSSL_SUCCESS);
ExpectIntEQ(wolfSSL_CertManagerVerifyBuffer(cm, server, serverSz,
SSL_FILETYPE_ASN1), WOLFSSL_SUCCESS);
/* There is only 1 unknown extension (1.2.3.4.5). The other ones are known
* because they are for the dual alg extensions. */
ExpectIntEQ(extCount, 1);
wolfSSL_CertManagerFree(cm);

XFREE(root, NULL, DYNAMIC_TYPE_TMP_BUFFER);
XFREE(server, NULL, DYNAMIC_TYPE_TMP_BUFFER);

Expand Down