@@ -12610,12 +12610,7 @@ static int test_wolfSSL_tmp_dh(void)
1261012610#endif
1261112611 static const unsigned char g[] = { 0x02 };
1261212612 int gSz = (int)sizeof(g);
12613- #if !defined(NO_DSA)
12614- char file[] = "./certs/dsaparams.pem";
12615- DSA* dsa = NULL;
12616- #else
1261712613 char file[] = "./certs/dh2048.pem";
12618- #endif
1261912614 XFILE f = XBADFILE;
1262012615 int bytes = 0;
1262112616 DH* dh = NULL;
@@ -12657,14 +12652,7 @@ static int test_wolfSSL_tmp_dh(void)
1265712652
1265812653 ExpectNotNull(bio = BIO_new_mem_buf((void*)buff, bytes));
1265912654
12660- #if !defined(NO_DSA)
12661- dsa = wolfSSL_PEM_read_bio_DSAparams(bio, NULL, NULL, NULL);
12662- ExpectNotNull(dsa);
12663-
12664- dh = wolfSSL_DSA_dup_DH(dsa);
12665- #else
1266612655 dh = wolfSSL_PEM_read_bio_DHparams(bio, NULL, NULL, NULL);
12667- #endif
1266812656 ExpectNotNull(dh);
1266912657#if defined(WOLFSSL_DH_EXTRA) && \
1267012658 (defined(WOLFSSL_QT) || defined(OPENSSL_ALL) || defined(WOLFSSL_OPENSSH))
@@ -12750,9 +12738,6 @@ static int test_wolfSSL_tmp_dh(void)
1275012738#endif
1275112739
1275212740 BIO_free(bio);
12753- #if !defined(NO_DSA)
12754- DSA_free(dsa);
12755- #endif
1275612741 DH_free(dh);
1275712742 dh = NULL;
1275812743#ifndef NO_WOLFSSL_CLIENT
@@ -20525,13 +20510,12 @@ static int test_wolfSSL_CTX_ctrl(void)
2052520510 char clientFile[] = "./certs/client-cert.pem";
2052620511 SSL_CTX* ctx = NULL;
2052720512 X509* x509 = NULL;
20528- #if !defined(NO_DH) && !defined(NO_DSA) && !defined( NO_BIO)
20513+ #if !defined(NO_DH) && !defined(NO_BIO)
2052920514 byte buf[6000];
20530- char file[] = "./certs/dsaparams .pem";
20515+ char file[] = "./certs/dh2048 .pem";
2053120516 XFILE f = XBADFILE;
2053220517 int bytes = 0;
2053320518 BIO* bio = NULL;
20534- DSA* dsa = NULL;
2053520519 DH* dh = NULL;
2053620520#endif
2053720521#ifdef HAVE_ECC
@@ -20550,7 +20534,7 @@ static int test_wolfSSL_CTX_ctrl(void)
2055020534 ExpectNotNull(x509 = wolfSSL_X509_load_certificate_file(clientFile,
2055120535 WOLFSSL_FILETYPE_PEM));
2055220536
20553- #if !defined(NO_DH) && !defined(NO_DSA) && !defined( NO_BIO)
20537+ #if !defined(NO_DH) && !defined(NO_BIO)
2055420538 /* Initialize DH */
2055520539 ExpectTrue((f = XFOPEN(file, "rb")) != XBADFILE);
2055620540 ExpectIntGT(bytes = (int)XFREAD(buf, 1, sizeof(buf), f), 0);
@@ -20559,9 +20543,7 @@ static int test_wolfSSL_CTX_ctrl(void)
2055920543
2056020544 ExpectNotNull(bio = BIO_new_mem_buf((void*)buf, bytes));
2056120545
20562- ExpectNotNull(dsa = wolfSSL_PEM_read_bio_DSAparams(bio, NULL, NULL, NULL));
20563-
20564- ExpectNotNull(dh = wolfSSL_DSA_dup_DH(dsa));
20546+ ExpectNotNull(dh = wolfSSL_PEM_read_bio_DHparams(bio, NULL, NULL, NULL));
2056520547#endif
2056620548#ifdef HAVE_ECC
2056720549 /* Initialize WOLFSSL_EC_KEY */
@@ -20606,7 +20588,7 @@ static int test_wolfSSL_CTX_ctrl(void)
2060620588 /* Tests should fail with passed in NULL pointer */
2060720589 ExpectIntEQ((int)wolfSSL_CTX_ctrl(ctx, SSL_CTRL_EXTRA_CHAIN_CERT, 0, NULL),
2060820590 WC_NO_ERR_TRACE(WOLFSSL_FAILURE));
20609- #if !defined(NO_DH) && !defined(NO_DSA)
20591+ #if !defined(NO_DH)
2061020592 ExpectIntEQ((int)wolfSSL_CTX_ctrl(ctx, SSL_CTRL_SET_TMP_DH, 0, NULL),
2061120593 WC_NO_ERR_TRACE(WOLFSSL_FAILURE));
2061220594#endif
@@ -20634,7 +20616,7 @@ static int test_wolfSSL_CTX_ctrl(void)
2063420616 /* Test with SSL_CTRL_SET_TMP_DH
2063520617 * wolfSSL_CTX_ctrl should succesffuly call wolfSSL_SSL_CTX_set_tmp_dh
2063620618 */
20637- #if !defined(NO_DH) && !defined(NO_DSA) && !defined( NO_BIO)
20619+ #if !defined(NO_DH) && !defined(NO_BIO)
2063820620 ExpectIntEQ((int)wolfSSL_CTX_ctrl(ctx, SSL_CTRL_SET_TMP_DH, 0, dh),
2063920621 SSL_SUCCESS);
2064020622#endif
@@ -20674,14 +20656,11 @@ static int test_wolfSSL_CTX_ctrl(void)
2067420656#endif
2067520657#endif
2067620658 /* Cleanup and Pass */
20677- #if !defined(NO_DH) && !defined(NO_DSA)
20678- #ifndef NO_BIO
20659+ #if !defined(NO_DH) && !defined(NO_BIO)
2067920660 BIO_free(bio);
20680- DSA_free(dsa);
2068120661 DH_free(dh);
2068220662 dh = NULL;
2068320663#endif
20684- #endif
2068520664#ifdef HAVE_ECC
2068620665 wolfSSL_EC_KEY_free(ecKey);
2068720666#endif
0 commit comments