-
Notifications
You must be signed in to change notification settings - Fork 11
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
Support for displaying OIDs for unknown algorithms #69
base: master
Are you sure you want to change the base?
Conversation
This commit supports displaying the OIDs for unknown signature and public key algorithms. The output also showsthe bytes of the public key. This can be used for example to examine certificates with PQC algorithms.
527ef26
to
21da9a3
Compare
test_certs/ML-DSA-44.crt.text.short
Outdated
@@ -0,0 +1,5 @@ | |||
X.509v3 Intermediate CA Certificate (0 unknown) [Serial: 1234...5678] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't (0 unknown)
now indicate something like ML-DSA-44
? Do these need regeneration?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in 5cd6125
@@ -406,7 +477,7 @@ func printSubjectInformation(subj *pkix.Name, pkAlgo x509.PublicKeyAlgorithm, pk | |||
return errors.New("certinfo: Expected ed25519.PublicKey for type x509.ED25519") | |||
} | |||
default: | |||
return errors.New("certinfo: Unknown public key type") | |||
printUnknownPublicKeyAlgorithm(certOrCSR, buf) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe needs a split in logic between an actually unknown algorithms, and the ones that you added in this PR, as the latter ones are not unknown algorithms (anymore).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you mean? Now, unless the certificate parsing fails, I can extract at least the OID of the public key and signature algorithms, instead of just crashing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The main thing was that the algorithms extracted using the new method aren't (fully) unknown (anymore), as they're now known in this library, but maybe it's a bit too pedantic. On the other hand: it is performing logic for the case it's the x509.UnknownPublicKeyAlgorithm
, so maybe not that bad.
Co-authored-by: Herman Slatman <[email protected]>
Description
This commit supports displaying the OIDs for unknown signature and public key algorithms. The output also shows the bytes of the public key.
This can be used for example to examine certificates with PQC algorithms.
An example of this is: