-
Notifications
You must be signed in to change notification settings - Fork 918
Add OCSP response issuer certificate callback zd#20415 #9115
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -39514,6 +39514,7 @@ static int DecodeBasicOcspResponse(byte* source, word32* ioIndex, | |
| int ret = 0; | ||
| word32 idx = *ioIndex; | ||
| Signer* ca = NULL; | ||
| CbOCSPRespCert ocspRespCertCb = (NULL != cm) ? ((WOLFSSL_CERT_MANAGER*)cm)->ocspRespCertCb: NULL; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please fix to 80 characters max: |
||
| int sigValid = 0; | ||
|
|
||
| WOLFSSL_ENTER("DecodeBasicOcspResponse"); | ||
|
|
@@ -39562,6 +39563,11 @@ static int DecodeBasicOcspResponse(byte* source, word32* ioIndex, | |
| GetASN_GetRef(&dataASN[OCSPBASICRESPASN_IDX_CERTS_SEQ], &resp->cert, | ||
| &resp->certSz); | ||
| } | ||
| /* If no certificate was read from the response data, but an response issuer certificate callback is available. */ | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please add callback in the non ASN template case too... above. Test with |
||
| if ((ret == 0) && (resp->certSz == 0) && (ocspRespCertCb != NULL)) { | ||
| /* Call callback to obtain issuing certificate data. */ | ||
| resp->certSz = ocspRespCertCb(&resp->cert); | ||
| } | ||
|
|
||
| if ((ret == 0) && resp->certSz > 0) { | ||
| ret = OcspCheckCert(resp, noVerify, noVerifySignature, | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3749,6 +3749,7 @@ typedef int (*crlErrorCb)(int ret, WOLFSSL_CRL* crl, WOLFSSL_CERT_MANAGER* cm, | |
| void* ctx); | ||
| typedef int (*CbOCSPIO)(void*, const char*, int, | ||
| unsigned char*, int, unsigned char**); | ||
| typedef int (*CbOCSPRespCert)(unsigned char**); | ||
| typedef void (*CbOCSPRespFree)(void*,unsigned char*); | ||
|
|
||
| #ifdef HAVE_CRL_IO | ||
|
|
@@ -4264,6 +4265,8 @@ WOLFSSL_API void wolfSSL_CTX_SetPerformTlsRecordProcessingCb(WOLFSSL_CTX* ctx, | |
| WOLFSSL_CERT_MANAGER* cm, const char* url); | ||
| WOLFSSL_API int wolfSSL_CertManagerSetOCSP_Cb(WOLFSSL_CERT_MANAGER* cm, | ||
| CbOCSPIO ioCb, CbOCSPRespFree respFreeCb, void* ioCbCtx); | ||
| WOLFSSL_API int wolfSSL_CertManagerSetOCSPResponseIssuer_Cb(WOLFSSL_CERT_MANAGER* cm, | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please add test case in tests/api.c for new functionality. Thank you |
||
| CbOCSPRespCert respCertCb); | ||
|
|
||
| WOLFSSL_API int wolfSSL_CertManagerEnableOCSPStapling( | ||
| WOLFSSL_CERT_MANAGER* cm); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only the public API needs
WOLFSSL_API.