[openssl] master update

Dr. Paul Dale pauli at openssl.org
Thu Jun 10 04:19:12 UTC 2021


The branch master has been updated
       via  b6298a7f8de45b287bfbad5de282fbceb68abb02 (commit)
       via  1dc8eb5be0375b1e3f33f711b3a62712b3042a6b (commit)
       via  807bb4255473986439c00a2fe3c798e7120709ba (commit)
      from  ef2194c4ade7b765ccf9a6e8f97d88b0fa6b223d (commit)


- Log -----------------------------------------------------------------
commit b6298a7f8de45b287bfbad5de282fbceb68abb02
Author: Pauli <pauli at openssl.org>
Date:   Wed Jun 9 13:40:54 2021 +1000

    util: convert SHA* one shots back to being functions
    
    Reviewed-by: Richard Levitte <levitte at openssl.org>
    Reviewed-by: David von Oheimb <david.von.oheimb at siemens.com>
    (Merged from https://github.com/openssl/openssl/pull/15668)

commit 1dc8eb5be0375b1e3f33f711b3a62712b3042a6b
Author: Pauli <pauli at openssl.org>
Date:   Wed Jun 9 13:40:27 2021 +1000

    changes: fix woring that mentions SHA* one shot functions are deprecated
    
    Reviewed-by: Richard Levitte <levitte at openssl.org>
    Reviewed-by: David von Oheimb <david.von.oheimb at siemens.com>
    (Merged from https://github.com/openssl/openssl/pull/15668)

commit 807bb4255473986439c00a2fe3c798e7120709ba
Author: Pauli <pauli at openssl.org>
Date:   Wed Jun 9 13:38:30 2021 +1000

    sha: convert SHA one shot macros back to being functions
    
    Fixes #15655
    
    Reviewed-by: Richard Levitte <levitte at openssl.org>
    Reviewed-by: David von Oheimb <david.von.oheimb at siemens.com>
    (Merged from https://github.com/openssl/openssl/pull/15668)

-----------------------------------------------------------------------

Summary of changes:
 CHANGES.md            |  4 ++--
 crypto/sha/sha1_one.c | 26 ++++++++++++++++++++++++++
 include/openssl/sha.h | 16 +++++-----------
 util/libcrypto.num    | 10 +++++-----
 util/other.syms       |  5 -----
 5 files changed, 38 insertions(+), 23 deletions(-)

diff --git a/CHANGES.md b/CHANGES.md
index e0423a8491..5b0f0df11e 100644
--- a/CHANGES.md
+++ b/CHANGES.md
@@ -690,8 +690,8 @@ breaking changes, and mappings for the large list of deprecated functions.
 
    *Paul Dale*
 
- * The low-level MD2, MD4, MD5, MDC2, RIPEMD160, SHA1, SHA224, SHA256,
-   SHA384, SHA512 and Whirlpool digest functions have been deprecated.
+ * The low-level MD2, MD4, MD5, MDC2, RIPEMD160 and Whirlpool digest
+   functions have been deprecated.
 
    *Paul Dale and David von Oheimb*
 
diff --git a/crypto/sha/sha1_one.c b/crypto/sha/sha1_one.c
index a21a1aded3..d6f5d1ecce 100644
--- a/crypto/sha/sha1_one.c
+++ b/crypto/sha/sha1_one.c
@@ -17,6 +17,7 @@
 #include <string.h>
 #include <openssl/crypto.h>
 #include <openssl/sha.h>
+#include <openssl/evp.h>
 #include "crypto/sha.h"
 
 unsigned char *ossl_sha1(const unsigned char *d, size_t n, unsigned char *md)
@@ -33,3 +34,28 @@ unsigned char *ossl_sha1(const unsigned char *d, size_t n, unsigned char *md)
     OPENSSL_cleanse(&c, sizeof(c));
     return md;
 }
+
+unsigned char *SHA1(const unsigned char *d, size_t n, unsigned char *md)
+{
+    return EVP_Q_digest(NULL, "SHA1", NULL, d, n, md, NULL) ? md : NULL;
+}
+
+unsigned char *SHA224(const unsigned char *d, size_t n, unsigned char *md)
+{
+    return EVP_Q_digest(NULL, "SHA224", NULL, d, n, md, NULL) ? md : NULL;
+}
+
+unsigned char *SHA256(const unsigned char *d, size_t n, unsigned char *md)
+{
+    return EVP_Q_digest(NULL, "SHA256", NULL, d, n, md, NULL) ? md : NULL;
+}
+
+unsigned char *SHA384(const unsigned char *d, size_t n, unsigned char *md)
+{
+    return EVP_Q_digest(NULL, "SHA384", NULL, d, n, md, NULL) ? md : NULL;
+}
+
+unsigned char *SHA512(const unsigned char *d, size_t n, unsigned char *md)
+{
+    return EVP_Q_digest(NULL, "SHA512", NULL, d, n, md, NULL) ? md : NULL;
+}
diff --git a/include/openssl/sha.h b/include/openssl/sha.h
index eac4b79302..6e65a04089 100644
--- a/include/openssl/sha.h
+++ b/include/openssl/sha.h
@@ -17,7 +17,6 @@
 # endif
 
 # include <openssl/e_os2.h>
-# include <openssl/evp.h>
 # include <stddef.h>
 
 # ifdef  __cplusplus
@@ -53,8 +52,7 @@ OSSL_DEPRECATEDIN_3_0 int SHA1_Final(unsigned char *md, SHA_CTX *c);
 OSSL_DEPRECATEDIN_3_0 void SHA1_Transform(SHA_CTX *c, const unsigned char *data);
 # endif
 
-# define SHA1(d, n, md) \
-    (EVP_Q_digest(NULL, "SHA1", NULL, d, n, md, NULL) ? md : NULL)
+unsigned char *SHA1(const unsigned char *d, size_t n, unsigned char *md);
 
 # ifndef OPENSSL_NO_DEPRECATED_3_0
 #  define SHA256_CBLOCK   (SHA_LBLOCK*4)/* SHA-256 treats input data as a
@@ -80,10 +78,8 @@ OSSL_DEPRECATEDIN_3_0 void SHA256_Transform(SHA256_CTX *c,
                                             const unsigned char *data);
 # endif
 
-# define SHA224(d, n, md) \
-    (EVP_Q_digest(NULL, "SHA224", NULL, d, n, md, NULL) ? md : NULL)
-# define SHA256(d, n, md) \
-    (EVP_Q_digest(NULL, "SHA256", NULL, d, n, md, NULL) ? md : NULL)
+unsigned char *SHA224(const unsigned char *d, size_t n, unsigned char *md);
+unsigned char *SHA256(const unsigned char *d, size_t n, unsigned char *md);
 
 # define SHA224_DIGEST_LENGTH    28
 # define SHA256_DIGEST_LENGTH    32
@@ -132,10 +128,8 @@ OSSL_DEPRECATEDIN_3_0 void SHA512_Transform(SHA512_CTX *c,
                                             const unsigned char *data);
 # endif
 
-# define SHA384(d, n, md) \
-    (EVP_Q_digest(NULL, "SHA384", NULL, d, n, md, NULL) ? md : NULL)
-# define SHA512(d, n, md) \
-    (EVP_Q_digest(NULL, "SHA512", NULL, d, n, md, NULL) ? md : NULL)
+unsigned char *SHA384(const unsigned char *d, size_t n, unsigned char *md);
+unsigned char *SHA512(const unsigned char *d, size_t n, unsigned char *md);
 
 # ifdef  __cplusplus
 }
diff --git a/util/libcrypto.num b/util/libcrypto.num
index 182cd2b158..8776e721a8 100644
--- a/util/libcrypto.num
+++ b/util/libcrypto.num
@@ -1144,7 +1144,7 @@ BN_security_bits                        1171	3_0_0	EXIST::FUNCTION:
 X509_PURPOSE_get0_name                  1172	3_0_0	EXIST::FUNCTION:
 TS_TST_INFO_get_serial                  1173	3_0_0	EXIST::FUNCTION:TS
 ASN1_PCTX_get_str_flags                 1174	3_0_0	EXIST::FUNCTION:
-SHA256                                  1175	3_0_0	NOEXIST::FUNCTION:
+SHA256                                  1175	3_0_0	EXIST::FUNCTION:
 X509_LOOKUP_hash_dir                    1176	3_0_0	EXIST::FUNCTION:
 ASN1_BIT_STRING_check                   1177	3_0_0	EXIST::FUNCTION:
 ENGINE_set_default_RAND                 1178	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,ENGINE
@@ -1375,7 +1375,7 @@ EVP_MD_meth_get_cleanup                 1408	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_
 SRP_Calc_server_key                     1409	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,SRP
 BN_mod_exp_simple                       1410	3_0_0	EXIST::FUNCTION:
 BIO_set_ex_data                         1411	3_0_0	EXIST::FUNCTION:
-SHA512                                  1412	3_0_0	NOEXIST::FUNCTION:
+SHA512                                  1412	3_0_0	EXIST::FUNCTION:
 X509_STORE_CTX_get_explicit_policy      1413	3_0_0	EXIST::FUNCTION:
 EVP_DecodeBlock                         1414	3_0_0	EXIST::FUNCTION:
 OSSL_HTTP_REQ_CTX_set_request_line      1415	3_0_0	EXIST::FUNCTION:
@@ -2460,7 +2460,7 @@ BN_generate_dsa_nonce                   2512	3_0_0	EXIST::FUNCTION:
 X509_verify_cert                        2513	3_0_0	EXIST::FUNCTION:
 X509_policy_level_get0_node             2514	3_0_0	EXIST::FUNCTION:
 X509_REQ_get_attr                       2515	3_0_0	EXIST::FUNCTION:
-SHA1                                    2516	3_0_0	NOEXIST::FUNCTION:
+SHA1                                    2516	3_0_0	EXIST::FUNCTION:
 X509_print                              2517	3_0_0	EXIST::FUNCTION:
 d2i_AutoPrivateKey                      2518	3_0_0	EXIST::FUNCTION:
 X509_REQ_new                            2519	3_0_0	EXIST::FUNCTION:
@@ -2927,7 +2927,7 @@ EC_GROUP_set_asn1_flag                  2991	3_0_0	EXIST::FUNCTION:EC
 EVP_PKEY_new                            2992	3_0_0	EXIST::FUNCTION:
 i2d_POLICYINFO                          2993	3_0_0	EXIST::FUNCTION:
 BN_get_flags                            2994	3_0_0	EXIST::FUNCTION:
-SHA384                                  2995	3_0_0	NOEXIST::FUNCTION:
+SHA384                                  2995	3_0_0	EXIST::FUNCTION:
 NCONF_get_string                        2996	3_0_0	EXIST::FUNCTION:
 d2i_PROXY_CERT_INFO_EXTENSION           2997	3_0_0	EXIST::FUNCTION:
 EC_POINT_point2buf                      2998	3_0_0	EXIST::FUNCTION:EC
@@ -3510,7 +3510,7 @@ EVP_MD_meth_dup                         3588	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_
 ENGINE_unregister_ciphers               3589	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,ENGINE
 X509_issuer_and_serial_cmp              3590	3_0_0	EXIST::FUNCTION:
 OCSP_response_create                    3591	3_0_0	EXIST::FUNCTION:OCSP
-SHA224                                  3592	3_0_0	NOEXIST::FUNCTION:
+SHA224                                  3592	3_0_0	EXIST::FUNCTION:
 MD2_options                             3593	3_0_0	EXIST::FUNCTION:DEPRECATEDIN_3_0,MD2
 X509_REQ_it                             3595	3_0_0	EXIST::FUNCTION:
 RAND_bytes                              3596	3_0_0	EXIST::FUNCTION:
diff --git a/util/other.syms b/util/other.syms
index 8e1824c220..cf3455bcca 100644
--- a/util/other.syms
+++ b/util/other.syms
@@ -447,11 +447,6 @@ PEM_FLAG_EAY_COMPATIBLE                 define
 PEM_FLAG_ONLY_B64                       define
 PEM_FLAG_SECURE                         define
 RAND_cleanup                            define deprecated 1.1.0
-SHA1                                    define
-SHA224                                  define
-SHA256                                  define
-SHA384                                  define
-SHA512                                  define
 SSL_COMP_free_compression_methods       define deprecated 1.1.0
 SSL_CTX_add0_chain_cert                 define
 SSL_CTX_add1_chain_cert                 define


More information about the openssl-commits mailing list