rusticata / x509-parser

X.509 parser written in pure Rust. Fast, zero-copy, safe.
Other
206 stars 67 forks source link

Support aws-lc-rs alternative to ring and add ECDSAWithSha512 support #154

Closed 1Dragoon closed 5 months ago

1Dragoon commented 5 months ago

Main motivation for this is I need ECDSA with SHA512 for some certs I need to verify. Problem with this is ring doesn't support it. However, aws-lc-rs, which is designed to be a drop-in replacement for ring, does support it, but it comes with a few stipulations:

Let me know what you think.

cpu commented 5 months ago

Hi there,

Thanks for the PR! I have some thoughts on this after seeing a couple other repos implement similar. Sorry for the volume of feedback. @chifflier may have his own thoughts and you should prefer his opinions over mine in the event they conflict.

Easy stuff up-front:

More involved feedback on the overall approach:

I think the best end state would be that neither the verify or ring features are enabled by default to match the status quo, activating verify with no default features should be a compile error about a required source of cryptography, activating verify with no default features and ring should use ring, activating verify with no default features and aws-lc-rs should use aws-lc-rs, and activating verify with both ring and aws-lc-rs should use ring. I believe this would be a breaking change since previously activating verify would implicitly activate ring and I'm suggesting that should be made explicit.

In order to build, you have to have cmake and nasm installed

Quick note here: the nasm requirement is only needed on Windows. Linux and MacOS shouldn't require it.

1Dragoon commented 5 months ago

Unfortunately some stuff has come up and I'm super busy and haven't had time to pick this up again, probably won't have time for some months to come. Somebody else can take it over or simply close it meanwhile.

cpu commented 5 months ago

Totally understand. Thanks for leaving an update.

I'm supportive of the goal of adding aws-lc-rs support but I also don't have time to adopt the branch at the moment. I'm going to close this, but if you or someone else finds the time to pick it up again I'd be happy to help review.

Thanks again,