-
Notifications
You must be signed in to change notification settings - Fork 295
Decoupled crypto backends (the rest) #428
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
base: master
Are you sure you want to change the base?
Conversation
# Conflicts: # Cargo.toml # examples/custom_header.rs # examples/validation.rs # src/crypto/ecdsa.rs # src/crypto/rsa.rs # src/jwk.rs
This is following the existing scheme established in hmac & rsa.
:o how did i miss this sorry, i'll go through it asap |
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.
Looks great overall. I think some macros would help reduce the duplication
@@ -48,8 +60,10 @@ time = { version = "0.3", features = ["wasm-bindgen"] } | |||
criterion = { version = "0.4", default-features = false } | |||
|
|||
[features] | |||
default = ["use_pem"] | |||
default = ["use_pem", "aws_lc_rs"] |
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.
should we have a default crypto backend or let users pick the one they want?
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.
I mean, that's up to you. I personally think it's nice to have a reasonable default.
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.
aws_lc_rs would be a good default
return Err(new_error(ErrorKind::MissingAlgorithm)); | ||
} | ||
|
||
// Todo: This behaviour is currently not captured anywhere. |
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.
If you have an idea on how to improve that, i'll take it
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.
This comment is actually @sidrubs', I'm not entirely sure what they mean by that, whether it's not covered by tests, or docs, or...?
I'll have a go at reducing the duplication through some macros and addressing the other comments. |
Alright, done some refactoring to reduce the duplication and re-enabled the WASM HMAC test cases. I checked that tests pass with both AWS-LC and Rust-crypto. |
This is following up on #410 with the rest of the decoupled implementations, and addressing most of the review comments (I think?).
There are still some todos left for documentation, which I haven't filled in yet.
I've verified that tests & clippy pass with all combinations of features, but a lot of this I only know enough about to be dangerous, so I'd appreciate close looks at the actual implementations to make sure e.g. I've picked the correct library functions in each case.