From 752419d8f7154995c355a38801d89230a80fa8a3 Mon Sep 17 00:00:00 2001 From: Matt Caswell Date: Tue, 13 Oct 2020 17:13:01 +0100 Subject: [PATCH] Deprecate DH_new as well as i2d_DHparams and d2i_DHparams Reviewed-by: Richard Levitte (Merged from https://github.com/openssl/openssl/pull/13138) --- crypto/dh/dh_lib.c | 3 ++- include/openssl/dh.h | 10 +++++++--- util/libcrypto.num | 10 +++++----- 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/crypto/dh/dh_lib.c b/crypto/dh/dh_lib.c index e3bbe95ff4..e687b04259 100644 --- a/crypto/dh/dh_lib.c +++ b/crypto/dh/dh_lib.c @@ -51,11 +51,12 @@ const DH_METHOD *dh_get_method(const DH *dh) { return dh->meth; } - +# ifndef OPENSSL_NO_DEPRECATED_3_0 DH *DH_new(void) { return dh_new_intern(NULL, NULL); } +# endif DH *DH_new_method(ENGINE *engine) { diff --git a/include/openssl/dh.h b/include/openssl/dh.h index 69a5b79c18..86f0e73464 100644 --- a/include/openssl/dh.h +++ b/include/openssl/dh.h @@ -147,7 +147,7 @@ DEPRECATEDIN_3_0(const DH_METHOD *DH_get_default_method(void)) DEPRECATEDIN_3_0(int DH_set_method(DH *dh, const DH_METHOD *meth)) DEPRECATEDIN_3_0(DH *DH_new_method(ENGINE *engine)) -DH *DH_new(void); +DEPRECATEDIN_3_0(DH *DH_new(void)) void DH_free(DH *dh); int DH_up_ref(DH *dh); int DH_bits(const DH *dh); @@ -185,8 +185,12 @@ DEPRECATEDIN_3_0(int DH_compute_key(unsigned char *key, const BIGNUM *pub_key, DH *dh)) DEPRECATEDIN_3_0(int DH_compute_key_padded(unsigned char *key, const BIGNUM *pub_key, DH *dh)) -DECLARE_ASN1_ENCODE_FUNCTIONS_only(DH, DHparams) -DECLARE_ASN1_ENCODE_FUNCTIONS_only(DH, DHxparams) + +# ifndef OPENSSL_NO_DEPRECATED_3_0 +DECLARE_ASN1_ENCODE_FUNCTIONS_only_attr(OSSL_DEPRECATEDIN_3_0, DH, DHparams) +DECLARE_ASN1_ENCODE_FUNCTIONS_only_attr(OSSL_DEPRECATEDIN_3_0, DH, DHxparams) +# endif + # ifndef OPENSSL_NO_STDIO DEPRECATEDIN_3_0(int DHparams_print_fp(FILE *fp, const DH *x)) # endif diff --git a/util/libcrypto.num b/util/libcrypto.num index 404a706fab..841a97f7fb 100644 --- a/util/libcrypto.num +++ b/util/libcrypto.num @@ -98,7 +98,7 @@ PKCS5_pbe2_set_scrypt 99 3_0_0 EXIST::FUNCTION:SCRYPT X509_find_by_subject 100 3_0_0 EXIST::FUNCTION: DSAparams_print 101 3_0_0 EXIST::FUNCTION:DEPRECATEDIN_3_0,DSA BF_set_key 102 3_0_0 EXIST::FUNCTION:BF,DEPRECATEDIN_3_0 -d2i_DHparams 103 3_0_0 EXIST::FUNCTION:DH +d2i_DHparams 103 3_0_0 EXIST::FUNCTION:DEPRECATEDIN_3_0,DH i2d_PKCS7_ENC_CONTENT 104 3_0_0 EXIST::FUNCTION: DH_generate_key 105 3_0_0 EXIST::FUNCTION:DEPRECATEDIN_3_0,DH ENGINE_add_conf_module 106 3_0_0 EXIST::FUNCTION:DEPRECATEDIN_3_0,ENGINE @@ -152,7 +152,7 @@ X509_REVOKED_get_ext_count 154 3_0_0 EXIST::FUNCTION: BN_is_prime_fasttest_ex 155 3_0_0 EXIST::FUNCTION:DEPRECATEDIN_3_0 ERR_load_PKCS12_strings 156 3_0_0 EXIST::FUNCTION:DEPRECATEDIN_3_0 EVP_sha384 157 3_0_0 EXIST::FUNCTION: -i2d_DHparams 158 3_0_0 EXIST::FUNCTION:DH +i2d_DHparams 158 3_0_0 EXIST::FUNCTION:DEPRECATEDIN_3_0,DH TS_VERIFY_CTX_set_store 159 3_0_0 EXIST::FUNCTION:TS PKCS12_verify_mac 160 3_0_0 EXIST::FUNCTION: X509v3_addr_canonize 161 3_0_0 EXIST::FUNCTION:RFC3779 @@ -457,7 +457,7 @@ ASN1_INTEGER_to_BN 465 3_0_0 EXIST::FUNCTION: OPENSSL_memcmp 466 3_0_0 NOEXIST::FUNCTION: BUF_MEM_new 467 3_0_0 EXIST::FUNCTION: DSO_set_filename 468 3_0_0 EXIST::FUNCTION: -DH_new 469 3_0_0 EXIST::FUNCTION:DH +DH_new 469 3_0_0 EXIST::FUNCTION:DEPRECATEDIN_3_0,DH OCSP_RESPID_free 470 3_0_0 EXIST::FUNCTION:OCSP PKCS5_pbe2_set 471 3_0_0 EXIST::FUNCTION: SCT_set_signature_nid 473 3_0_0 EXIST::FUNCTION:CT @@ -717,7 +717,7 @@ TXT_DB_write 735 3_0_0 EXIST::FUNCTION: OCSP_REQUEST_get1_ext_d2i 736 3_0_0 EXIST::FUNCTION:OCSP CMS_unsigned_add1_attr_by_NID 737 3_0_0 EXIST::FUNCTION:CMS BN_mod_exp_mont 738 3_0_0 EXIST::FUNCTION: -d2i_DHxparams 739 3_0_0 EXIST::FUNCTION:DH +d2i_DHxparams 739 3_0_0 EXIST::FUNCTION:DEPRECATEDIN_3_0,DH DH_size 740 3_0_0 EXIST::FUNCTION:DEPRECATEDIN_3_0,DH CONF_imodule_get_name 741 3_0_0 EXIST::FUNCTION: ENGINE_get_pkey_meth_engine 742 3_0_0 EXIST::FUNCTION:DEPRECATEDIN_3_0,ENGINE @@ -2155,7 +2155,7 @@ BN_GF2m_add 2202 3_0_0 EXIST::FUNCTION:EC2M CMAC_resume 2203 3_0_0 EXIST::FUNCTION:CMAC,DEPRECATEDIN_3_0 TS_ACCURACY_set_millis 2204 3_0_0 EXIST::FUNCTION:TS X509V3_EXT_conf 2205 3_0_0 EXIST::FUNCTION: -i2d_DHxparams 2206 3_0_0 EXIST::FUNCTION:DH +i2d_DHxparams 2206 3_0_0 EXIST::FUNCTION:DEPRECATEDIN_3_0,DH EVP_CIPHER_CTX_free 2207 3_0_0 EXIST::FUNCTION: WHIRLPOOL_BitUpdate 2208 3_0_0 EXIST::FUNCTION:DEPRECATEDIN_3_0,WHIRLPOOL EVP_idea_ecb 2209 3_0_0 EXIST::FUNCTION:IDEA -- 2.34.1