diff options
author | Shane Lontis <shane.lontis@oracle.com> | 2019-12-18 14:46:01 +1000 |
---|---|---|
committer | Shane Lontis <shane.lontis@oracle.com> | 2019-12-18 14:46:01 +1000 |
commit | b2055d67f0d6cc3156ac89dae255e4abc8881b69 (patch) | |
tree | 953d8331bae9fd2980f2380cd35cb341d842af29 /crypto/evp/legacy_blake2.c | |
parent | 1ac7e15375be39c8f03171c02658cf703f58217a (diff) |
Cleanup legacy digest methods.
Macros have been added to generate the simple legacy methods.
Engines and EVP_MD_METH_get methods still require access to the old legacy methods,
so they needed to be added back in.
They may only be removed after engines are deprecated and removed.
Removed some unnecessary #includes and #ifndef guards (which are done in build.info instead).
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/10602)
Diffstat (limited to 'crypto/evp/legacy_blake2.c')
-rw-r--r-- | crypto/evp/legacy_blake2.c | 30 |
1 files changed, 11 insertions, 19 deletions
diff --git a/crypto/evp/legacy_blake2.c b/crypto/evp/legacy_blake2.c index 04b1e84865..e03403406f 100644 --- a/crypto/evp/legacy_blake2.c +++ b/crypto/evp/legacy_blake2.c @@ -7,25 +7,23 @@ * https://www.openssl.org/source/license.html */ -#include <openssl/opensslconf.h> +#include "crypto/evp.h" +#include "prov/blake2.h" /* diverse BLAKE2 macros */ +#include "legacy_meth.h" -#ifndef OPENSSL_NO_BLAKE2 +#define blake2b_init blake2b512_init +#define blake2s_init blake2s256_init -# include <openssl/obj_mac.h> -# include "crypto/evp.h" -# include "prov/blake2.h" /* diverse BLAKE2 macros */ +IMPLEMENT_LEGACY_EVP_MD_METH_LC(blake2s_int, blake2s) +IMPLEMENT_LEGACY_EVP_MD_METH_LC(blake2b_int, blake2b) static const EVP_MD blake2b_md = { NID_blake2b512, 0, BLAKE2B_DIGEST_LENGTH, 0, - NULL, - NULL, - NULL, - NULL, - NULL, - BLAKE2B_BLOCKBYTES, + LEGACY_EVP_MD_METH_TABLE(blake2b_int_init, blake2b_int_update, + blake2b_int_final, NULL, BLAKE2B_BLOCKBYTES), }; const EVP_MD *EVP_blake2b512(void) @@ -38,17 +36,11 @@ static const EVP_MD blake2s_md = { 0, BLAKE2S_DIGEST_LENGTH, 0, - NULL, - NULL, - NULL, - NULL, - NULL, - BLAKE2S_BLOCKBYTES, + LEGACY_EVP_MD_METH_TABLE(blake2s_int_init, blake2s_int_update, + blake2s_int_final, NULL, BLAKE2S_BLOCKBYTES), }; const EVP_MD *EVP_blake2s256(void) { return &blake2s_md; } - -#endif /* OPENSSL_NO_BLAKE2 */ |