-
-
Notifications
You must be signed in to change notification settings - Fork 753
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
allow conversion from MessageDigest to Md #2292
base: master
Are you sure you want to change the base?
Conversation
This eases porting from legacy const EVP_MD to dynamic EVP_MD, especially in codebases that need to support boringssl/libressl in addition to OpenSSL 3
e04d469
to
e81f984
Compare
mutable MD and needing to free are both ossl 3 constructs though so we'll leave those gated
@sfackler Alex and I aren't sure of the motivation behind the design of Md vs MessageDigest so we wanted to get your input here 😄 |
The MessageDigest/Hasher API is one of the oldest parts of the crate, and tries to provide a "cleaner" interface which doesn't IIRC actually cover all of the weird edge cases. Md/MdCtx is a newer iteration of the same thing that tries to provide a more direct binding. The same thing is true for the asymmetric encryption APIs, which I think had even more issues. We can hopefully remove MessageDigest/Hasher in the upcoming breaking release, but in the meantime I think this conversion should be fine. |
} | ||
} | ||
} else { | ||
enum Inner {} |
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'm a bit suspicious that this is a safe change. I vaguely remember that the new OpenSSL 3 dynamic lookup APIs were the reason I had to make the new types in the first place.
This eases porting from legacy const EVP_MD to dynamic EVP_MD, especially in codebases that need to support boringssl/libressl in addition to OpenSSL 3.