Skip to content
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

ecdsa: add SignatureWithOid #689

Merged
merged 1 commit into from
Apr 3, 2023
Merged

ecdsa: add SignatureWithOid #689

merged 1 commit into from
Apr 3, 2023

Conversation

tarcieri
Copy link
Member

@tarcieri tarcieri commented Apr 3, 2023

Adds a signature type which is paramaterized by an RFC5758-defined OID identifying the variant of ECDSA used to produce the signature.

cc @baloo @lumag

@tarcieri tarcieri force-pushed the ecdsa/signature-with-oid branch from d49adfb to 70cb20e Compare April 3, 2023 01:07
Adds a signature type which is paramaterized by an RFC5758-defined OID
identifying the variant of ECDSA used to produce the signature.
@tarcieri tarcieri force-pushed the ecdsa/signature-with-oid branch from 70cb20e to 59b4234 Compare April 3, 2023 01:14
@tarcieri
Copy link
Member Author

tarcieri commented Apr 3, 2023

The real benefit of this will be dynamically dispatching the hash function to use for verification, but I've left that for a followup PR.

@tarcieri tarcieri merged commit e05b64f into master Apr 3, 2023
@tarcieri tarcieri deleted the ecdsa/signature-with-oid branch April 3, 2023 01:22

/// Get the ECDSA OID for a given digest OID.
#[cfg(feature = "digest")]
const fn ecdsa_oid_for_digest(digest_oid: ObjectIdentifier) -> Option<ObjectIdentifier> {
Copy link
Member

Choose a reason for hiding this comment

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

❤️

Copy link
Member Author

Choose a reason for hiding this comment

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

It's private, but accessible via constants (with compile-time failures if given a non-SHA-2 OID, at that)

Copy link
Member

Choose a reason for hiding this comment

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

I was looking how to do that over in RSA, but this is very cool!

@tarcieri tarcieri mentioned this pull request Apr 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants