forked from wolfSSL/wolfssl
handeling DER to internal of an OCSP response with no optional certificates
This commit is contained in:
13
tests/api.c
13
tests/api.c
@@ -1407,6 +1407,7 @@ static void test_wolfSSL_CheckOCSPResponse(void)
|
||||
{
|
||||
#if defined(HAVE_OCSP) && !defined(NO_RSA) && defined(OPENSSL_ALL)
|
||||
const char* responseFile = "./certs/ocsp/test-response.der";
|
||||
const char* responseNoInternFile = "./certs/ocsp/test-response-nointern.der";
|
||||
const char* caFile = "./certs/ocsp/root-ca-cert.pem";
|
||||
OcspResponse* res = NULL;
|
||||
byte data[4096];
|
||||
@@ -1442,6 +1443,18 @@ static void test_wolfSSL_CheckOCSPResponse(void)
|
||||
wolfSSL_X509_STORE_free(st);
|
||||
wolfSSL_X509_free(issuer);
|
||||
|
||||
/* check loading a response with optional certs */
|
||||
f = XFOPEN(responseNoInternFile, "rb");
|
||||
AssertTrue(f != XBADFILE);
|
||||
dataSz = (word32)XFREAD(data, 1, sizeof(data), f);
|
||||
AssertIntGT(dataSz, 0);
|
||||
XFCLOSE(f);
|
||||
|
||||
pt = data;
|
||||
res = wolfSSL_d2i_OCSP_RESPONSE(NULL, &pt, dataSz);
|
||||
AssertNotNull(res);
|
||||
wolfSSL_OCSP_RESPONSE_free(res);
|
||||
|
||||
printf(resultFmt, passed);
|
||||
#endif /* HAVE_OCSP */
|
||||
}
|
||||
|
Reference in New Issue
Block a user