Skip to content

Commit afb6fe6

Browse files
committed
Fixes for building due to missing OCSP and DecodePolicyOID (--enable-curl and --enable-openssh).
1 parent 20f7d6f commit afb6fe6

3 files changed

Lines changed: 20 additions & 15 deletions

File tree

src/ocsp.c

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -702,8 +702,10 @@ int wolfSSL_OCSP_resp_find_status(WOLFSSL_OCSP_BASICRESP *bs,
702702
if (nextupd != NULL)
703703
*nextupd = &single->status->nextDateParsed;
704704
#else
705-
(void)thisupd;
706-
(void)nextupd;
705+
if (thisupd != NULL)
706+
*thisupd = NULL;
707+
if (nextupd != NULL)
708+
*nextupd = NULL;
707709
#endif
708710

709711
/* TODO: Not needed for Nginx or httpd */
@@ -1348,11 +1350,17 @@ int wolfSSL_OCSP_single_get0_status(WOLFSSL_OCSP_SINGLERESP *single,
13481350
if (single == NULL)
13491351
return WOLFSSL_FAILURE;
13501352

1353+
#ifdef WOLFSSL_OCSP_PARSE_STATUS
13511354
if (thisupd != NULL)
13521355
*thisupd = &single->status->thisDateParsed;
13531356
if (nextupd != NULL)
13541357
*nextupd = &single->status->nextDateParsed;
1355-
1358+
#else
1359+
if (thisupd != NULL)
1360+
*thisupd = NULL;
1361+
if (nextupd != NULL)
1362+
*nextupd = NULL;
1363+
#endif
13561364
if (reason != NULL)
13571365
*reason = 0;
13581366
if (revtime != NULL)

wolfcrypt/src/asn.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20412,7 +20412,8 @@ static int DecodeNameConstraints(const byte* input, word32 sz,
2041220412
}
2041320413
#endif /* IGNORE_NAME_CONSTRAINTS */
2041420414

20415-
#ifdef WOLFSSL_CERT_EXT
20415+
#if defined(WOLFSSL_CERT_EXT) || \
20416+
defined(OPENSSL_EXTRA) || defined(OPENSSL_EXTRA_X509_SMALL)
2041620417

2041720418
/* Decode ITU-T X.690 OID format to a string representation
2041820419
* return string length */
@@ -20464,7 +20465,7 @@ int DecodePolicyOID(char *out, word32 outSz, const byte *in, word32 inSz)
2046420465
exit:
2046520466
return w;
2046620467
}
20467-
#endif /* WOLFSSL_CERT_EXT */
20468+
#endif /* WOLFSSL_CERT_EXT || OPENSSL_EXTRA || OPENSSL_EXTRA_X509_SMALL */
2046820469

2046920470
#if defined(WOLFSSL_SEP) || defined(WOLFSSL_CERT_EXT)
2047020471
#ifdef WOLFSSL_ASN_TEMPLATE

wolfssl/ocsp.h

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -67,13 +67,11 @@ WOLFSSL_LOCAL int CheckOcspResponse(WOLFSSL_OCSP *ocsp, byte *response, int resp
6767
WOLFSSL_LOCAL int CheckOcspResponder(OcspResponse *bs, DecodedCert *cert,
6868
void* vp);
6969

70-
#if defined(OPENSSL_ALL) || defined(WOLFSSL_NGINX) || defined(WOLFSSL_HAPROXY) || \
71-
defined(WOLFSSL_APACHE_HTTPD) || defined(HAVE_LIGHTY)
72-
73-
WOLFSSL_API int wolfSSL_OCSP_resp_find_status(WOLFSSL_OCSP_BASICRESP *bs,
74-
WOLFSSL_OCSP_CERTID *id, int *status, int *reason,
75-
WOLFSSL_ASN1_TIME **revtime, WOLFSSL_ASN1_TIME **thisupd,
76-
WOLFSSL_ASN1_TIME **nextupd);
70+
#ifdef OPENSSL_EXTRA
71+
WOLFSSL_API int wolfSSL_OCSP_resp_find_status(WOLFSSL_OCSP_BASICRESP *bs,
72+
WOLFSSL_OCSP_CERTID *id, int *status, int *reason,
73+
WOLFSSL_ASN1_TIME **revtime, WOLFSSL_ASN1_TIME **thisupd,
74+
WOLFSSL_ASN1_TIME **nextupd);
7775
WOLFSSL_API const char *wolfSSL_OCSP_cert_status_str(long s);
7876
WOLFSSL_API int wolfSSL_OCSP_check_validity(WOLFSSL_ASN1_TIME* thisupd,
7977
WOLFSSL_ASN1_TIME* nextupd, long sec, long maxsec);
@@ -132,8 +130,6 @@ WOLFSSL_API int wolfSSL_OCSP_resp_count(WOLFSSL_OCSP_BASICRESP *bs);
132130
WOLFSSL_API WOLFSSL_OCSP_SINGLERESP* wolfSSL_OCSP_resp_get0(
133131
WOLFSSL_OCSP_BASICRESP *bs, int idx);
134132

135-
#endif
136-
#ifdef OPENSSL_EXTRA
137133
WOLFSSL_API int wolfSSL_OCSP_REQUEST_add_ext(OcspRequest* req,
138134
WOLFSSL_X509_EXTENSION* ext, int idx);
139135
WOLFSSL_API OcspResponse* wolfSSL_OCSP_response_create(int status,
@@ -148,7 +144,7 @@ WOLFSSL_API int wolfSSL_OCSP_request_add1_nonce(OcspRequest* req,
148144
unsigned char* val, int sz);
149145
WOLFSSL_API int wolfSSL_OCSP_check_nonce(OcspRequest* req,
150146
WOLFSSL_OCSP_BASICRESP* bs);
151-
#endif
147+
#endif /* OPENSSL_EXTRA */
152148

153149

154150
#ifdef __cplusplus

0 commit comments

Comments
 (0)