OCSP request creation almost complete, added ocsp revoke error code
This commit is contained in:
@@ -1695,7 +1695,11 @@ static int DoCertificate(CYASSL* ssl, byte* input, word32* inOutIdx)
|
||||
}
|
||||
|
||||
#ifdef HAVE_OCSP
|
||||
CyaSSL_OCSP_Lookup_Cert(&ssl->ctx->ocsp, &dCert);
|
||||
if (CyaSSL_OCSP_Lookup_Cert(&ssl->ctx->ocsp, &dCert) == CERT_REVOKED) {
|
||||
CYASSL_MSG("\tOCSP Lookup returned revoked");
|
||||
ret = OCSP_CERT_REVOKED;
|
||||
fatal = 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef OPENSSL_EXTRA
|
||||
@@ -3501,6 +3505,10 @@ void SetErrorString(int error, char* str)
|
||||
XSTRNCPY(str, "Bad Cert Manager error", max);
|
||||
break;
|
||||
|
||||
case OCSP_CERT_REVOKED:
|
||||
XSTRNCPY(str, "OCSP Cert revoked", max);
|
||||
break;
|
||||
|
||||
default :
|
||||
XSTRNCPY(str, "unknown error number", max);
|
||||
}
|
||||
|
||||
@@ -305,13 +305,13 @@ int CyaSSL_OCSP_Lookup_Cert(CYASSL_OCSP* ocsp, DecodedCert* cert)
|
||||
return CERT_UNKNOWN;
|
||||
}
|
||||
|
||||
XMEMCPY(ocsp->status[0].subjectHash, cert->subjectHash, SHA_SIZE);
|
||||
XMEMCPY(ocsp->status[0].issuerHash, cert->issuerHash, SHA_SIZE);
|
||||
XMEMCPY(ocsp->status[0].issuerKeyHash, cert->issuerKeyHash, SHA_SIZE);
|
||||
XMEMCPY(ocsp->status[0].serial, cert->serial, cert->serialSz);
|
||||
ocsp->status[0].serialSz = cert->serialSz;
|
||||
ocsp->statusLen = 1;
|
||||
|
||||
ocspReqSz = build_ocsp_request(ocsp, ocspReqBuf, ocspReqSz);
|
||||
ocspReqSz = EncodeOcspRequest(cert, ocspReqBuf, ocspReqSz);
|
||||
httpBufSz = build_http_request(ocsp, ocspReqSz, httpBuf, httpBufSz);
|
||||
|
||||
tcp_connect(&sfd, ocsp->overrideName, ocsp->overridePort);
|
||||
|
||||
Reference in New Issue
Block a user