I'm playing around TPM Endorsement Key certificates. One of the things I want to archive is to verify a EK certificate against the root CA. The function looks like
I expect all ExtKeyUsages to be correctly parsed with ParseCertificate.
What did you see instead?
UnknownExtKeyIsage of the x509.Certificate object (ek) is not empty. It contains asn1.ObjectIdentifier 2.23.133.8.1. Verification fails with x509: certificate specifies an incompatible key usage. The latter can be fixed by adding KeyUsages: []x509.ExtKeyUsage{x509.ExtKeyUsageAny} to x509.VerifyOptions.
The reason
crypto.x509 has extKeyUsageOIDs.
extKeyUsageOIDs contains the mapping between an ExtKeyUsage and its OID
There is no any tcg-kp OID.
The proposal
Add tcg-kp OIDs to extKeyUsageOIDs. However, I understand that it can be excessive as there are plenty of other OIDs people may wish to add.
The text was updated successfully, but these errors were encountered:
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes, according to the sources.
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
I'm playing around TPM Endorsement Key certificates. One of the things I want to archive is to verify a EK certificate against the root CA. The function looks like
What did you expect to see?
I expect all ExtKeyUsages to be correctly parsed with ParseCertificate.
What did you see instead?
UnknownExtKeyIsage
of the x509.Certificate object (ek
) is not empty. It contains asn1.ObjectIdentifier 2.23.133.8.1. Verification fails withx509: certificate specifies an incompatible key usage
. The latter can be fixed by addingKeyUsages: []x509.ExtKeyUsage{x509.ExtKeyUsageAny}
tox509.VerifyOptions
.The reason
crypto.x509 has extKeyUsageOIDs.
There is no any tcg-kp OID.
The proposal
Add tcg-kp OIDs to extKeyUsageOIDs. However, I understand that it can be excessive as there are plenty of other OIDs people may wish to add.
The text was updated successfully, but these errors were encountered: