-
Notifications
You must be signed in to change notification settings - Fork 916
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
Add OCSP response issuer certificate callback zd#20415 #9115
Conversation
|
🛟 Devin Lifeguard found 1 likely issues in this PR
@ptsiewie |
|
Can one of the admins verify this patch? |
|
Okay to test. Contributor agreement on file. |
| return ret; | ||
| } | ||
|
|
||
| WOLFSSL_API int wolfSSL_CertManagerSetOCSPResponseIssuer_Cb(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.
| 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. */ |
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.
Please add callback in the non ASN template case too... above. Test with --enable-asn=original.
| int ret = 0; | ||
| word32 idx = *ioIndex; | ||
| Signer* ca = NULL; | ||
| CbOCSPRespCert ocspRespCertCb = (NULL != cm) ? ((WOLFSSL_CERT_MANAGER*)cm)->ocspRespCertCb: NULL; |
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.
Please fix to 80 characters max:
src/ssl_certman.c:2487 WOLFSSL_API int wolfSSL_CertManagerSetOCSPResponseIssuer_Cb(WOLFSSL_CERT_MANAGER* cm,
wolfcrypt/src/asn.c:39517 CbOCSPRespCert ocspRespCertCb = (NULL != cm) ? ((WOLFSSL_CERT_MANAGER*)cm)->ocspRespCertCb: NULL;
wolfcrypt/src/asn.c:39566 /* If no certificate was read from the response data, but an response issuer certificate callback is available. */
wolfssl/internal.h:2699 CbOCSPRespCert ocspRespCertCb; /* Callback for OCSP response issuer certificate */
wolfssl/ssl.h:4268 WOLFSSL_API int wolfSSL_CertManagerSetOCSPResponseIssuer_Cb(WOLFSSL_CERT_MANAGER* cm,
| 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, |
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.
Please add test case in tests/api.c for new functionality. Thank you
|
Closing in favor of #9144 |
Description
This adds a callback for retrieving OCSP response issuer certificate data in case no such data is provided in the OCSP response's "certificate" extension. In our use case we have the OCSP response which is signed through an issuer chain, but that certificate is not included in the OCSP response certificate extension. This callback allows the OCSP response verification code to retrieve that certificate from the caller, after which the OCSP issuer verification can be performed.
Fixes zd#20415
Relates to zd#19571
Testing
How did you test?
Checklist