mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-08-02 04:04:39 +02:00
bug fix in default ocsp lookup function
This commit is contained in:
14
src/io.c
14
src/io.c
@@ -666,11 +666,22 @@ int EmbedOcspLookup(void* ctx, const char* url, int urlSz,
|
|||||||
byte* ocspReqBuf, int ocspReqSz, byte** ocspRespBuf)
|
byte* ocspReqBuf, int ocspReqSz, byte** ocspRespBuf)
|
||||||
{
|
{
|
||||||
char domainName[80], path[80];
|
char domainName[80], path[80];
|
||||||
int port, ocspRespSz, httpBufSz, sfd;
|
int port, httpBufSz, sfd;
|
||||||
|
int ocspRespSz = 0;
|
||||||
byte* httpBuf = NULL;
|
byte* httpBuf = NULL;
|
||||||
|
|
||||||
(void)ctx;
|
(void)ctx;
|
||||||
|
|
||||||
|
if (ocspReqBuf == NULL || ocspReqSz == 0) {
|
||||||
|
CYASSL_MSG("OCSP request is required for lookup");
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ocspRespBuf == NULL) {
|
||||||
|
CYASSL_MSG("Cannot save OCSP response");
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
if (decode_url(url, urlSz, domainName, path, &port) < 0) {
|
if (decode_url(url, urlSz, domainName, path, &port) < 0) {
|
||||||
CYASSL_MSG("Unable to decode OCSP URL");
|
CYASSL_MSG("Unable to decode OCSP URL");
|
||||||
return -1;
|
return -1;
|
||||||
@@ -683,6 +694,7 @@ int EmbedOcspLookup(void* ctx, const char* url, int urlSz,
|
|||||||
CYASSL_MSG("Unable to create OCSP response buffer");
|
CYASSL_MSG("Unable to create OCSP response buffer");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
*ocspRespBuf = httpBuf;
|
||||||
|
|
||||||
httpBufSz = build_http_request(domainName, path, ocspReqSz,
|
httpBufSz = build_http_request(domainName, path, ocspReqSz,
|
||||||
httpBuf, httpBufSz);
|
httpBuf, httpBufSz);
|
||||||
|
Reference in New Issue
Block a user