-
Notifications
You must be signed in to change notification settings - Fork 121
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
Save leaf certificate in SSL early to avoid losing external data #1074
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dkostic
reviewed
Jun 28, 2023
samuel40791765
force-pushed
the
x509-data-fix
branch
from
June 28, 2023 17:32
3051a46
to
ebed1d0
Compare
dkostic
previously approved these changes
Jun 29, 2023
skmcgrail
previously approved these changes
Jun 30, 2023
dkostic
previously approved these changes
Jul 5, 2023
samuel40791765
force-pushed
the
x509-data-fix
branch
from
July 5, 2023 16:19
00e9f74
to
1b6e672
Compare
skmcgrail
reviewed
Jul 5, 2023
skmcgrail
approved these changes
Jul 6, 2023
dkostic
approved these changes
Jul 6, 2023
samuel40791765
force-pushed
the
x509-data-fix
branch
from
July 6, 2023 16:06
a3b6bc5
to
6e78eaa
Compare
Merged
samuel40791765
added a commit
that referenced
this pull request
Jul 12, 2023
Asides from the behavior fixed in #1074, there were some slight OCSP errors when building with nginx's OCSP stapling tests. There are still a couple of tests failing due to us missing multiple certs support, but this should resolve all other issues with us failing the test. The NULL check in ocsp_find_signer_sk static function was also a bit too pedantic, so I relaxed it. It's possible for the OCSP Basic Response to be missing a cert stack, so we shouldn't be throwing an error on to the stack if that happens. Also implemented functionality for the two OCSP flags, OCSP_NOVERIFY and OCSP_TRUSTOTHER
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issues:
Resolves
CryptoAlg-1935
Description of changes:
This reverts some of the changes done in 3a2b47a.
AWS-LC/BoringSSL also allows external data to be associated with the X509 structures with the same APIs. However, our SSL connections don't directly save the X509 certificate as a structure within
SSL_CTX
. We "fold" the certificate and convert it into a binary blob to maintain withinSSL_CTX
. The certificate is not parsed back into anX509
until the user asks for it.This creates issues when the user attempts to associate data with the certificate with
X509_set_ex_data
and passes the certificate intoSSL_CTX
. The data usually associated is not ASN.1 code, thus non-parsable, and the associated data gets lost during the translation to pure bytes. This creates issues with codebases like nginx, who was associating their own OCSP stapling data structures with X509 structures in SSL_CTX.I've changed this to cache the leaf certificate early, so that the external data is kept for that cert. The same behavior is kept for the rest of the change. This keeps the changes needed contained and avoids an entire restructure of the use of
CRYPTO_BUFFER
inCERT
.Call-outs:
This lets us pass more ssl_stapling in nginx. There are some more subtle OCSP changes required, but I'll open another PR for that.
Testing:
CI
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license and the ISC license.