]> git.ipfire.org Git - thirdparty/nettle.git/commit
examples: don't use deprecated OpenSSL hashing API
authorEmil Velikov <emil.l.velikov@gmail.com>
Mon, 11 May 2020 08:43:22 +0000 (09:43 +0100)
committerNiels Möller <nisse@lysator.liu.se>
Thu, 28 May 2020 20:33:57 +0000 (22:33 +0200)
commitd55fc19dfcb6b6766fbe05292d0c62f380bec439
treee4d403a019bee253cf731595ba76dc37f32c5984
parentf5c43f5ba231813ff5cf1ba729531948f2d4b05b
examples: don't use deprecated OpenSSL hashing API

The direct $HASH_{Init,Update,Final} has been discouraged for a while.
With the upcoming OpenSSL 3.0 it will be officially deprecated.

Add a handy macro, to avoid repetition and mistakes like in the current
code. Namely - we're using SHA cblock/digest_len for md5 :-\

The macro will also make it easier to add more, as seen with next patch.

v2: Align it with the crypto implementations, namely:
 - use openssh_hash_ctx::evp, use correct sizeof()
 - move hash_update out of the macro
 - remove forward declarations for hash functions

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
examples/nettle-openssl.c