diff options
author | Dr. David von Oheimb <David.von.Oheimb@siemens.com> | 2021-03-29 19:32:48 +0200 |
---|---|---|
committer | Dr. David von Oheimb <David.von.Oheimb@siemens.com> | 2021-05-08 14:41:36 +0200 |
commit | 4d49b68504cc494e552bce8e0b82ec8b501d5abe (patch) | |
tree | 24870549aee659def396116715f8d10c1ea71de3 /crypto/sha | |
parent | Add quick one-shot EVP_Q_mac() and deprecation compensation decls for MAC fun... (diff) | |
download | openssl-4d49b68504cc494e552bce8e0b82ec8b501d5abe.tar.xz openssl-4d49b68504cc494e552bce8e0b82ec8b501d5abe.zip |
Crypto: Add deprecation compatibility declarations for SHA* message digest functions
Also add hints to SHA256_Init.pod and CHANGES.md how to replace SHA256() etc.
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/14741)
Diffstat (limited to 'crypto/sha')
-rw-r--r-- | crypto/sha/sha1_one.c | 3 | ||||
-rw-r--r-- | crypto/sha/sha256.c | 28 | ||||
-rw-r--r-- | crypto/sha/sha512.c | 28 |
3 files changed, 2 insertions, 57 deletions
diff --git a/crypto/sha/sha1_one.c b/crypto/sha/sha1_one.c index 5bd9953d96..b98f078739 100644 --- a/crypto/sha/sha1_one.c +++ b/crypto/sha/sha1_one.c @@ -17,8 +17,9 @@ #include <string.h> #include <openssl/crypto.h> #include <openssl/sha.h> +#include "crypto/sha.h" -unsigned char *SHA1(const unsigned char *d, size_t n, unsigned char *md) +unsigned char *ossl_sha1(const unsigned char *d, size_t n, unsigned char *md) { SHA_CTX c; static unsigned char m[SHA_DIGEST_LENGTH]; diff --git a/crypto/sha/sha256.c b/crypto/sha/sha256.c index 4fa68953d1..7b3855f301 100644 --- a/crypto/sha/sha256.c +++ b/crypto/sha/sha256.c @@ -53,34 +53,6 @@ int SHA256_Init(SHA256_CTX *c) return 1; } -unsigned char *SHA224(const unsigned char *d, size_t n, unsigned char *md) -{ - SHA256_CTX c; - static unsigned char m[SHA224_DIGEST_LENGTH]; - - if (md == NULL) - md = m; - SHA224_Init(&c); - SHA256_Update(&c, d, n); - SHA256_Final(md, &c); - OPENSSL_cleanse(&c, sizeof(c)); - return md; -} - -unsigned char *SHA256(const unsigned char *d, size_t n, unsigned char *md) -{ - SHA256_CTX c; - static unsigned char m[SHA256_DIGEST_LENGTH]; - - if (md == NULL) - md = m; - SHA256_Init(&c); - SHA256_Update(&c, d, n); - SHA256_Final(md, &c); - OPENSSL_cleanse(&c, sizeof(c)); - return md; -} - int SHA224_Update(SHA256_CTX *c, const void *data, size_t len) { return SHA256_Update(c, data, len); diff --git a/crypto/sha/sha512.c b/crypto/sha/sha512.c index f0cf9ca902..a0d7f88ba9 100644 --- a/crypto/sha/sha512.c +++ b/crypto/sha/sha512.c @@ -338,34 +338,6 @@ void SHA512_Transform(SHA512_CTX *c, const unsigned char *data) sha512_block_data_order(c, data, 1); } -unsigned char *SHA384(const unsigned char *d, size_t n, unsigned char *md) -{ - SHA512_CTX c; - static unsigned char m[SHA384_DIGEST_LENGTH]; - - if (md == NULL) - md = m; - SHA384_Init(&c); - SHA512_Update(&c, d, n); - SHA512_Final(md, &c); - OPENSSL_cleanse(&c, sizeof(c)); - return md; -} - -unsigned char *SHA512(const unsigned char *d, size_t n, unsigned char *md) -{ - SHA512_CTX c; - static unsigned char m[SHA512_DIGEST_LENGTH]; - - if (md == NULL) - md = m; - SHA512_Init(&c); - SHA512_Update(&c, d, n); - SHA512_Final(md, &c); - OPENSSL_cleanse(&c, sizeof(c)); - return md; -} - #ifndef SHA512_ASM static const SHA_LONG64 K512[80] = { U64(0x428a2f98d728ae22), U64(0x7137449123ef65cd), |