dma
dma copied to clipboard
Make crypto.c compile/link with OpenSSL 3
- Initialize libssl using non-deprecated APIs
OpenSSL 3 deprecated SSL_library_init and SSL_load_error_strings in
favor of OPENSSL_init_ssl. Use OPENSSL_init_ssl when dealing with
OpenSSL 1.1 and newer to unbreak the build with OpenSSL 3.
- Move MD5 APIs to EVP_MD APIs
OpenSSL 3 deprecated all of the MD5_* APIs. Move to the equivalent
EVP_MD* APIs so the code doesn't need to be pinned down to 1.1
compatible APIs and uplifted at a later date.
Co-authored-by: Pierre Pronchery [email protected] Co-authored-by: Ed Maste [email protected] Signed-off-by: Enji Cooper [email protected] Sponsored by: The FreeBSD Foundation
@emaste , @khorben: FYI
More work's required in order to get the program to compile cleanly with OpenSSL 3. I'll move this PR back to draft mode and fix those issues.
Is -DOPENSSL_API_COMPAT=0x10100000L sufficient to build with OpenSSL 3.0 at least initially?
Is
-DOPENSSL_API_COMPAT=0x10100000Lsufficient to build with OpenSSL 3.0 at least initially?
Yes, but I want to clean this up so the folks in this project don't have to do it later.
Yes, but I want to clean this up so the folks in this project don't have to do it later.
Sounds good!
\o/
I've confirmed that the newest revision is functionally correct and produces the same values as it did previously -- I also compared the logic in the python hmac module to confirm that it was sane:
$ make check
./hmac-md5-test1 --short
key: this is a passcode
text: abcdefghijklmnop
digest: 369b855bac0edb31107b180d2b76ed31
./hmac-md5-test1 --long
key: this is a SUPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPER LONG passcode
text: abcdefghijklmnop
digest: 54ecf5f3274c
./hmac-md5-test3 --short
key: this is a passcode
text: abcdefghijklmnop
digest: 369b855bac0edb31107b180d2b76ed31
./hmac-md5-test3 --long
key: this is a SUPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPER LONG passcode
text: abcdefghijklmnop
digest: 54ecf5f3274c
./hmac-md5-test.py --short
key: this is a passcode
text: abcdefghijklmnop
digest: 369b855bac0e
./hmac-md5-test.py --long
key: this is a SUPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPER LONG passcode
text: abcdefghijklmnop
digest: 54ecf5f3274c
@emaste can you check and merge this PR?
@corecode it might be a little while, but I will put it on the list.
I presume we'd like @ngie-eign to squash the fixups into one commit?
@corecode it might be a little while, but I will put it on the list.
I presume we'd like @ngie-eign to squash the fixups into one commit?
Yes, I was planning on doing that. I left them as fixup commits to aid with reviewing.