Skip to content

Commit

Permalink
ocsp: minors
Browse files Browse the repository at this point in the history
  • Loading branch information
rizlik committed Feb 5, 2025
1 parent 36f2e1f commit f6d13fd
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
17 changes: 9 additions & 8 deletions tests/api/ocsp.c
Original file line number Diff line number Diff line change
Expand Up @@ -145,10 +145,9 @@ int test_ocsp_response_parsing(void)

/* Test response with unusable internal cert but that can be verified in CM
*/
conf.resp = (unsigned char*)
resp_bad_embedded_cert; // Response with wrong internal cert
conf.resp = (unsigned char*)resp_bad_embedded_cert;
conf.respSz = sizeof(resp_bad_embedded_cert);
conf.ca0 = root_ca_cert_pem; // Root CA cert
conf.ca0 = root_ca_cert_pem;
conf.ca0Sz = sizeof(root_ca_cert_pem);
conf.ca1 = NULL;
conf.ca1Sz = 0;
Expand Down Expand Up @@ -200,6 +199,7 @@ int test_ocsp_basic_verify(void)
const unsigned char* ptr = NULL;
OcspResponse* response = NULL;
DecodedCert cert;
int expectedRet;

wc_InitDecodedCert(&cert, ocsp_responder_cert_pem,
sizeof(ocsp_responder_cert_pem), NULL);
Expand Down Expand Up @@ -329,12 +329,13 @@ int test_ocsp_basic_verify(void)
ptr = (const unsigned char*)resp_bad_noauth;
ExpectNotNull(response = wolfSSL_d2i_OCSP_RESPONSE(NULL, &ptr,
sizeof(resp_bad_noauth)));
ExpectIntEQ(wolfSSL_OCSP_basic_verify(response, certs, store, 0),
#ifndef WOLFSSL_NO_OCSP_ISSUER_CHECK
WOLFSSL_FAILURE);
#else
WOLFSSL_SUCCESS);

expectedRet = WOLFSSL_FAILURE;
#ifdef WOLFSSL_NO_OCSP_ISSUER_CHECK
expectedRet = WOLFSSL_SUCCESS;
#endif
ExpectIntEQ(wolfSSL_OCSP_basic_verify(response, certs, store, 0),
expectedRet);
/* should pass with OCSP_NOCHECKS ...*/
ExpectIntEQ(
wolfSSL_OCSP_basic_verify(response, certs, store, OCSP_NOCHECKS),
Expand Down
2 changes: 1 addition & 1 deletion wolfcrypt/src/asn.c
Original file line number Diff line number Diff line change
Expand Up @@ -37408,7 +37408,7 @@ static int DecodeBasicOcspResponse(byte* source, word32* ioIndex,
sigValid = 1;
}
else {
WOLFSSL_MSG("OCSP Internal certificate can't verify the response\n");
WOLFSSL_MSG("OCSP Internal cert can't verify the response\n");
/* try to verify the OCSP response with CA certs */
ret = 0;
}
Expand Down

0 comments on commit f6d13fd

Please sign in to comment.