-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Certificate verification fails if the certificate being verified does not contain the relevant extensions #11042
Comments
The certificate can be verified by openssl
or pyOpenSSL
|
OK it turned out the verification fails even with openssl when strict mode is enabled ...
|
Since the issue is also detected by openssl, I've reported the issue in virtee/snpguest#57 (comment) . |
Our verifier currently is based on the WebPKI, which requires AKIs. This doesn't prohibit us having alternate verification options in the future (e.g., our client verifier), although some API discussion would be needed to determine what makes sense. One concern I have is that it's not clear to me that AMD did the diligence to understand X.509 and generate proper certificates as opposed to just doing some quick empirical checks against existing implementations. Separately, our error message would be more useful if it explained what required extensions were missing. cc @woodruffw for when he's back from vacation 😄 |
Thanks for the ping @reaperhulk! 100% agreed about improving the error message; I can take a poke at that sometime in the coming days. See also #10276 (comment) for a similar request (Intel SGX instead of AMD SEV, but also caused by profile variants). |
Looping back: #11162 improved the extension error messages here. |
I have this issue while using only cryptography. I made sure to have AKI in my root CA and certs (no intermediates in my application) and I still get this message "cryptography.hazmat.bindings._rust.x509.VerificationError: validation failed: Certificate is missing required extension" during verification. |
We're all volunteers working on an OSS project, no, we don't have an ETA. |
I am running against this too. OpenSSL says that the end-entity certificate that is signed using my self-signed CA keys is correct even with x509 strict mode: openssl verify -x509_strict -CAfile cc_root.crt leaf.crt
leaf.crt: OK But our Python server says:
Which one is missing then? Here are all extensions I used: CA cert:
leaf cert:
|
Is this the list of extensions
|
We currently require Subject Alt Names for all EE certs
…On Wed, Oct 23, 2024, 10:33 AM Matthias Käppler ***@***.***> wrote:
I am running against this too.
OpenSSL says that the end-entity certificate that is signed using my
self-signed CA keys is correct even with x509 strict mode:
openssl verify -x509_strict -CAfile cc_root.crt leaf.crt
leaf.crt: OK
But our Python server says:
validation failed: Certificate is missing required extension"
Which one is missing then? Here are all extensions I used:
CA cert:
X509v3 extensions:
X509v3 Subject Key Identifier:
82:BE:9A:E8:E5:47:83:EF:43:94:66:1C:A0:9C:43:75:D4:7B:43:D8
X509v3 Authority Key Identifier:
82:BE:9A:E8:E5:47:83:EF:43:94:66:1C:A0:9C:43:75:D4:7B:43:D8
X509v3 Basic Constraints: critical
CA:TRUE
X509v3 Key Usage:
Certificate Sign
leaf cert:
X509v3 extensions:
X509v3 Key Usage:
Digital Signature
X509v3 Subject Key Identifier:
62:74:0D:DE:C5:C0:52:2F:EB:C5:92:0E:EC:CA:D7:3A:E2:48:0C:DF
X509v3 Authority Key Identifier:
82:BE:9A:E8:E5:47:83:EF:43:94:66:1C:A0:9C:43:75:D4:7B:43:D8
—
Reply to this email directly, view it on GitHub
<#11042 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAAGBBN2G3ZFZXAJRGP2IDZ46XS5AVCNFSM6AAAAABISCKMK6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIMZSGQZDKNRQHA>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
To add on to what @alex said: SANs are required because the current validator is a CABF validator, meaning it uses the rules for X.509 certificates on the web PKI. CABF says that SANs are required, so that requirement is enforced. (OpenSSL's strict enforcement mode is insufficient: they don't implement all of the CABF rules and are unlikely to do so, since it'd be a major breaking change.) |
Thank you @alex @woodruffw, adding the SAN extension fixed the problem for me. Thanks for explaining the rationale as well, I am not overly familiar with the PKIX space so this is helpful. |
Problem description
I'm trying to verify the VCEK certificate published by AMD. According to the document VCEK is supposed to be verified by ARK (root certificate) and ASK (intermediate certificate).
However verification consistently fails because of
Certificate is missing required extension
.I suspect "the missing required extension" is Authority Key Identifier (or Subject Key Identifier) . RFC5280 states that
To facilitate certification path construction, this extension MUST appear in all conforming CA certificates
while it also states thatConforming CAs MUST mark this extension as non-critical.
I'm wondering if it makes sense that cryptography would ignore missing Subject Key Identifier field, if the field is supposed to be always non-critical.Versions
Certificate contents
certs/vcek.pem
certs/ask.pem
certs/ark.pem
The text was updated successfully, but these errors were encountered: