-
Notifications
You must be signed in to change notification settings - Fork 74
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
Add bindings for multi-part operations #252
Add bindings for multi-part operations #252
Conversation
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 looks really good, good job ⭐ ! Very nice with all the tests that you added too! Definitely a good step to have in the code and then we can decide later if we want to add more typing to check the multi-part sequence at compile time.
Are there any strong feelings about the naming
I like your thinking about discoverability! My only opinion would be to match with the PKCS11 shorter names and have for example with decrypt
: decrypt_init
and decrypt_final
?
Should I delete these, given that this is an implementation detail of the underlying PKCS#11 device and not this library itself?
I don't think so! Those are really good and are actually not implementation details since they are written in the spec:
The message-digesting operation MUST have been initialized with C_DigestInit.
so perfectly sensible to check that :)
Do any version number changes need to be made manually?
We will do that ourselves when we decide to make a new release!
Should I add myself to CONTRIBUTORS.md as mentioned here?
No requirement on our side! That is only if you want it :) I think the original reason is to have people behind what the copyright notice says.
@hug-dev thanks for the feedback! I changed the function names as you suggested and applied the lint fixes that were preventing CI from passing :) |
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.
Thanks!
Sorry, it seems there was another CI error to fix. Should all be good now! |
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 looks very clean and nice, thank you! 👍
Would you mind rebasing this on top of main
? We recently landed a big PR and I wonder if it'll all work together nicely :)
(if @hug-dev want to merge it and potentially collect the pieces of the merge I'm fine with that too 😅 )
Signed-off-by: Jacob Prud'homme <[email protected]>
Signed-off-by: Jacob Prud'homme <[email protected]>
Signed-off-by: Jacob Prud'homme <[email protected]>
Signed-off-by: Jacob Prud'homme <[email protected]>
Signed-off-by: Jacob Prud'homme <[email protected]>
Signed-off-by: Jacob Prud'homme <[email protected]>
Signed-off-by: Jacob Prud'homme <[email protected]>
Signed-off-by: Jacob Prud'homme <[email protected]>
I found out it was not that multi-part encryption/decryption weren't supported *at all*, it's that they're just supported for symmetric schemes Signed-off-by: Jacob Prud'homme <[email protected]>
Signed-off-by: Jacob Prud'homme <[email protected]>
Signed-off-by: Jacob Prud'homme <[email protected]>
Signed-off-by: Jacob Prud'homme <[email protected]>
Signed-off-by: Jacob Prud'homme <[email protected]>
6bfe8fd
to
2639ed4
Compare
Just rebased off of |
Ugh... it seems I screwed it up this time by pressing "Enable auto-merge" but |
Ouff... I know what's causing the issue too. All the keys I created during my tests had the bare minimum template attributes necessary to not trigger an error from SoftHSM (for example, not setting Should I open another PR to fix this? |
If you could that'd be really appreciated 🙏 |
Added the missing CI checks as required now! |
Author: Jacob Prud'homme
Email: [email protected]
Description
This PR adds direct bindings for the multi-part operations
C_{Encrypt,Decrypt,Sign,Verify,Digest}{Init,Update,Final}
. Closes #250Summary of Changes
encrypt_{initialize,update,finalize}()
tosession/encryption.rs
decrypt_{initialize,update,finalize}()
tosession/decryption.rs
{sign,verify}_{initialize,update,finalize}()
tosession/signing_macing.rs
digest_{initialize,update,finalize}()
tosession/digesting.rs
tests/basic.rs
Questions/Feedback Wanted
initialize_encrypt()
be preferred overencrypt_initialize()
?)? I did things this way so that it was more discoverable, in that a user could start typingencrypt
and would see all of the encrypt operations grouped togetherCONTRIBUTORS.md
as mentioned here? Or is that only for long-term/consistent contributors? (Sorry if that's a silly question! This is my first time contributing to an open-source project in a more substantial way)