Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Fix assert in MapVerifyErrorToChainStatus from DigiCert CRLs - #39430

Merged
bartonjs merged 2 commits into
dotnet:masterfrom
bartonjs:fix_crl_assert
Jul 13, 2019
Merged

Fix assert in MapVerifyErrorToChainStatus from DigiCert CRLs#39430
bartonjs merged 2 commits into
dotnet:masterfrom
bartonjs:fix_crl_assert

Conversation

@bartonjs

Copy link
Copy Markdown
Member
  • Define all of the X509_V_ERR* values form OpenSSL 1.0/1.1
  • Exempt X509_V_ERR_DIFFERENT_CRL_SCOPE from being reported, as it is redundant to X509_V_ERR_UNABLE_TO_GET_CRL

The remaining new X509_V_ERR* codes will still trip the assert, largely because
they should be behind option flags that we don't enable.

Fixes #39372.

* Define all of the X509_V_ERR* values form OpenSSL 1.0/1.1
* Exempt X509_V_ERR_DIFFERENT_CRL_SCOPE from being reported, as it is redundant to X509_V_ERR_UNABLE_TO_GET_CRL

The remaining new X509_V_ERR* codes will still trip the assert, largely because
they should be behind option flags that we don't enable.
@bartonjs
bartonjs requested review from krwq and stephentoub July 12, 2019 17:59
@davidsh davidsh added this to the 3.0 milestone Jul 12, 2019
@bartonjs

Copy link
Copy Markdown
Member Author

The test failure is #39381.

// which will trigger OCSP, so is ignorable.
if (errorCode != Interop.Crypto.X509VerifyStatusCode.X509_V_OK &&
errorCode != Interop.Crypto.X509VerifyStatusCode.X509_V_ERR_CRL_NOT_YET_VALID)
errorCode != Interop.Crypto.X509VerifyStatusCode.X509_V_ERR_CRL_NOT_YET_VALID &&

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

X509_V_ERR_PERMITTED_VIOLATION also seems like something which could be ignored

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's "A name constraint violation occurred in the permitted subtrees." which might mean "this certificate has name constraints that exceed the bounds of the parent"... which probably isn't something we'd want to ignore.

I don't really want to ignore things until we can see it, and understand that we're mapping it the same as on Windows 😄.

@krwq krwq left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change makes sense to me although I have very little context on this subject

DigiCert currently has at least two distinct CRLs running for the same CA
(C = US, O = DigiCert Inc, CN = DigiCert SHA2 Secure Server CA)
* URI:http://crl3.digicert.com/ssca-sha2-g5.crl
* URI:http://crl3.digicert.com/ssca-sha2-g6.crl

Using the current cache name strategy, just a hash of the CA name, some of the
certs get meaningful revocation, and others do not.

Now the file name will be {ca name hash}.{url hash}.crl, enabling the DigiCert
scenario.  Upgrading across this change will cause CRLs to be re-downloaded,
but that's a thing that happens over time anyways.
@bartonjs

Copy link
Copy Markdown
Member Author

Huh. I thought I had made a new branch for this last commit, and also that I had merged this change already.

But, neither of these things is actually true. @stephentoub / @krwq wanna look at the "fix the problem" commit that goes with the earlier "fix the symptom" commit?

@bartonjs

Copy link
Copy Markdown
Member Author
$ ls ~/.dotnet/corefx/cryptography/crls/
3513523f.858ba208.crl  85cf5865.7a464d31.crl  85cf5865.7ea99b1a.crl

Now both DigitCert CRLs get used (as appropriate).

@GrabYourPitchforks GrabYourPitchforks left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I reviewed specifically the commit at 4f3b75e and it LGTM.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Assertion in certificate validation code when talking to HTTP2 remote server on Linux

5 participants