-
Notifications
You must be signed in to change notification settings - Fork 160
Pingora's patch disabling cert version validation for extensions #495
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
+65
−7
Merged
Changes from 3 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
b524bb1
Use cfg!() for detecting features
kornelski 9a7dc1a
PINGORA-2987 - Add a patch for disabling version validation for exten…
johnhurt 9d62146
Put Pingora's workaround behind a flag
kornelski a91c12e
Comment on !X509_V_FLAG_X509_STRICT hack
kornelski File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| From fe0b517fa34063990a83268edf7a3cd9ba0b2362 Mon Sep 17 00:00:00 2001 | ||
| From: Yuchen Wu <yuchen@cloudflare.com> | ||
| Date: Mon, 13 Mar 2023 14:28:10 -0700 | ||
| Subject: [PATCH] PINGORA-474: disable cert version check for openssl | ||
| compatibility | ||
|
|
||
| Some free customers use badly crafted cert (with verification off). | ||
| Openssl allows these cert but boring does't. | ||
| --- | ||
| crypto/x509/x509_test.cc | 4 ++-- | ||
| crypto/x509/x_crl.cc | 2 ++ | ||
| 2 files changed, 4 insertions(+), 2 deletions(-) | ||
|
|
||
| diff --git a/crypto/x509/x509_test.cc b/crypto/x509/x509_test.cc | ||
| index aa5bfda5d..15c1c73ee 100644 | ||
| --- a/crypto/x509/x509_test.cc | ||
| +++ b/crypto/x509/x509_test.cc | ||
| @@ -3859,8 +3859,8 @@ TEST(X509Test, InvalidVersion) { | ||
| EXPECT_FALSE(CertFromPEM(kNegativeVersionPEM)); | ||
| EXPECT_FALSE(CertFromPEM(kFutureVersionPEM)); | ||
| EXPECT_FALSE(CertFromPEM(kOverflowVersionPEM)); | ||
| - EXPECT_FALSE(CertFromPEM(kV1WithExtensionsPEM)); | ||
| - EXPECT_FALSE(CertFromPEM(kV2WithExtensionsPEM)); | ||
| + ASSERT_TRUE(CertFromPEM(kV1WithExtensionsPEM)); | ||
| + ASSERT_TRUE(CertFromPEM(kV2WithExtensionsPEM)); | ||
| EXPECT_FALSE(CertFromPEM(kV1WithIssuerUniqueIDPEM)); | ||
| EXPECT_FALSE(CertFromPEM(kV1WithSubjectUniqueIDPEM)); | ||
| EXPECT_FALSE(CRLFromPEM(kV1CRLWithExtensionsPEM)); | ||
| diff --git a/crypto/x509/x_crl.cc b/crypto/x509/x_crl.cc | ||
| index 1d22ed638..4f50bc03f 100644 | ||
| --- a/crypto/x509/x_crl.cc | ||
| +++ b/crypto/x509/x_crl.cc | ||
| @@ -148,10 +148,12 @@ static int crl_cb(int operation, ASN1_VALUE **pval, const ASN1_ITEM *it, | ||
| } | ||
|
|
||
| // Per RFC 5280, section 5.1.2.1, extensions require v2. | ||
| + /* disable this check for openssl compatibility | ||
| if (version != X509_CRL_VERSION_2 && crl->crl->extensions != nullptr) { | ||
| OPENSSL_PUT_ERROR(X509, X509_R_INVALID_FIELD_FOR_VERSION); | ||
| return 0; | ||
| } | ||
| + */ | ||
|
|
||
| // Extensions is a SEQUENCE SIZE (1..MAX), so it cannot be empty. An empty | ||
| // extensions list is encoded by omitting the OPTIONAL field. | ||
| -- | ||
| 2.39.5 | ||
|
|
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.