@@ -662,7 +662,8 @@ int test_ocsp_certid_enc_dec(void)
662662#if defined(HAVE_OCSP ) && defined(WOLFSSL_CERT_SETUP_CB ) && \
663663 defined(HAVE_SSL_MEMIO_TESTS_DEPENDENCIES ) && !defined(NO_RSA ) && \
664664 (defined(HAVE_CERTIFICATE_STATUS_REQUEST ) || \
665- defined(HAVE_CERTIFICATE_STATUS_REQUEST_V2 ))
665+ defined(HAVE_CERTIFICATE_STATUS_REQUEST_V2 )) && \
666+ defined(SESSION_CERTS )
666667
667668static struct {
668669 size_t chainLen ;
@@ -792,15 +793,9 @@ static int test_ocsp_tls_cert_cb_verify_cb(int preverify,
792793#endif
793794 ) {
794795 WOLFSSL_BUFFER_INFO * bInfo = & store -> certs [idx ];
795- #if defined(WOLFSSL_TLS13 ) && defined(HAVE_CERTIFICATE_STATUS_REQUEST )
796- WOLFSSL * ssl = (WOLFSSL * )store -> userCtx ;
797- WOLFSSL_BUFFER_INFO * ocspStaple =
798- wolfSSL_GetTls13OcspStatusResp (ssl , (word32 )idx );
799- #endif
800796 WOLFSSL_CERT_MANAGER * cm = NULL ;
801797 DecodedCert cert ;
802798 byte certInit = 0 ;
803- WOLFSSL_OCSP * ocsp = NULL ;
804799
805800 ret = 1 ;
806801 cm = wolfSSL_CertManagerNew ();
@@ -824,24 +819,6 @@ static int test_ocsp_tls_cert_cb_verify_cb(int preverify,
824819 if (ret == 1 && wc_ParseCert (& cert , CERT_TYPE , VERIFY , cm ) != 0 )
825820 ret = 0 ;
826821
827- #if defined(WOLFSSL_TLS13 ) && defined(HAVE_CERTIFICATE_STATUS_REQUEST )
828- /* In this test we only expect a staple on the leaf cert */
829- if (wolfSSL_version (ssl ) == TLS1_3_VERSION ||
830- wolfSSL_version (ssl ) == DTLS1_3_VERSION ) {
831- /* Verify OCSP with CA */
832- if (ret == 1 && (ocspStaple == NULL || ocspStaple -> buffer == NULL ||
833- ocspStaple -> length == 0 ))
834- ret = 0 ;
835- if (ret == 1 && (ocsp = wc_NewOCSP (cm )) == NULL )
836- ret = 0 ;
837- if (ret == 1 &&
838- wc_CheckCertOcspResponse (ocsp , & cert , ocspStaple -> buffer ,
839- ocspStaple -> length , NULL ) != 0 )
840- ret = 0 ;
841- }
842- #endif
843-
844- wc_FreeOCSP (ocsp );
845822 if (certInit )
846823 wc_FreeDecodedCert (& cert );
847824 wolfSSL_CertManagerFree (cm );
@@ -850,7 +827,6 @@ static int test_ocsp_tls_cert_cb_verify_cb(int preverify,
850827 return ret ;
851828}
852829
853- #ifdef SESSION_CERTS
854830static int test_ocsp_tls_cert_cb_ocsp_verify_cb (WOLFSSL * ssl , int err ,
855831 byte * staple , word32 stapleSz , word32 idx , void * arg )
856832{
@@ -899,7 +875,6 @@ static int test_ocsp_tls_cert_cb_ocsp_verify_cb(WOLFSSL* ssl, int err,
899875 }
900876 return err ;
901877}
902- #endif
903878
904879static int test_ocsp_tls_cert_cb_ctx_ready (WOLFSSL_CTX * ctx )
905880{
@@ -931,7 +906,7 @@ int test_ocsp_tls_cert_cb(void)
931906 byte useV2multi :1 ;
932907 byte maxFail :2 ;
933908 } params [] = {
934- #if !defined (WOLFSSL_NO_TLS12 ) && defined ( SESSION_CERTS )
909+ #if !defined (WOLFSSL_NO_TLS12 )
935910 { wolfTLSv1_2_client_method , wolfTLSv1_2_server_method , "TLSv1_2" , 0 , 0 , 1 },
936911 { wolfTLSv1_2_client_method , wolfTLSv1_2_server_method , "TLSv1_2" , 1 , 0 , 1 },
937912 { wolfTLSv1_2_client_method , wolfTLSv1_2_server_method , "TLSv1_2" , 1 , 1 , 1 },
@@ -1000,13 +975,9 @@ int test_ocsp_tls_cert_cb(void)
1000975 /* client: request stapling */
1001976 wolfSSL_set_verify (test_ctx .c_ssl , WOLFSSL_VERIFY_DEFAULT ,
1002977 test_ocsp_tls_cert_cb_verify_cb );
1003- #ifdef SESSION_CERTS
1004- if (wolfSSL_version (test_ctx .c_ssl ) == TLS1_2_VERSION ||
1005- wolfSSL_version (test_ctx .c_ssl ) == DTLS1_2_VERSION ) {
1006- wolfSSL_CTX_set_tls12_ocsp_status_verify_cb (test_ctx .c_ctx ,
1007- test_ocsp_tls_cert_cb_ocsp_verify_cb , NULL );
1008- }
1009- #endif
978+ wolfSSL_CTX_set_ocsp_status_verify_cb (test_ctx .c_ctx ,
979+ test_ocsp_tls_cert_cb_ocsp_verify_cb , NULL );
980+
1010981 /* No way to get ssl from the store without OPENSSL_EXTRA */
1011982 wolfSSL_SetCertCbCtx (test_ctx .c_ssl , test_ctx .c_ssl );
1012983 ExpectIntEQ (wolfSSL_CTX_EnableOCSPStapling (test_ctx .c_ctx ), WOLFSSL_SUCCESS );
0 commit comments