From 020fb7a161910165f8fa9675b5ecf77316afa901 Mon Sep 17 00:00:00 2001 From: samuel40791765 Date: Fri, 8 Mar 2024 02:34:24 +0000 Subject: [PATCH] fix integrations that define no-deprecated-declarations --- include/openssl/bio.h | 5 ++++- include/openssl/cipher.h | 2 +- include/openssl/conf.h | 5 ++++- include/openssl/evp.h | 15 ++++++++++++--- include/openssl/rand.h | 11 +++++++---- include/openssl/ssl.h | 18 ++++++++++++------ 6 files changed, 40 insertions(+), 16 deletions(-) diff --git a/include/openssl/bio.h b/include/openssl/bio.h index 9efced30305..b2b85e78226 100644 --- a/include/openssl/bio.h +++ b/include/openssl/bio.h @@ -880,7 +880,10 @@ OPENSSL_EXPORT int (*BIO_meth_get_puts(const BIO_METHOD *method)) (BIO *, const // General No-op Functions [Deprecated]. // BIO_set_write_buffer_size returns zero. -OPENSSL_EXPORT OPENSSL_DEPRECATED int BIO_set_write_buffer_size( +// +// TODO: Add |OPENSSL_DEPRECATED|. nginx defines -Wno-deprecated-declarations +// and depends on this. +OPENSSL_EXPORT int BIO_set_write_buffer_size( BIO *bio, int buffer_size); diff --git a/include/openssl/cipher.h b/include/openssl/cipher.h index 829e7434603..de74f5ecf7c 100644 --- a/include/openssl/cipher.h +++ b/include/openssl/cipher.h @@ -355,7 +355,7 @@ OPENSSL_EXPORT int EVP_BytesToKey(const EVP_CIPHER *type, const EVP_MD *md, #define EVP_CIPH_XTS_MODE 0x7 #define EVP_CIPH_CCM_MODE 0x8 -// Buffer length in bits not bytes: CFB1 mode only. +// EVP_CIPH_FLAG_LENGTH_BITS buffers length in bits not bytes: CFB1 mode only. #define EVP_CIPH_FLAG_LENGTH_BITS 0x2000 // The following values are never returned from |EVP_CIPHER_mode| and are // included only to make it easier to compile code with BoringSSL. diff --git a/include/openssl/conf.h b/include/openssl/conf.h index 14f3772a933..f03cccc6bd8 100644 --- a/include/openssl/conf.h +++ b/include/openssl/conf.h @@ -149,7 +149,10 @@ OPENSSL_EXPORT OPENSSL_DEPRECATED void CONF_modules_unload(int all); OPENSSL_EXPORT OPENSSL_DEPRECATED void CONF_modules_finish(void); // OPENSSL_config does nothing. This has been deprecated since OpenSSL 1.1.0. -OPENSSL_EXPORT OPENSSL_DEPRECATED void OPENSSL_config(const char *config_name); +// +// TODO: Add |OPENSSL_DEPRECATED|. nginx defines -Wno-deprecated-declarations +// and depends on this. +OPENSSL_EXPORT void OPENSSL_config(const char *config_name); // OPENSSL_no_config does nothing. This has been deprecated since OpenSSL // 1.1.0. diff --git a/include/openssl/evp.h b/include/openssl/evp.h index 840fc62bb46..b82a4172c15 100644 --- a/include/openssl/evp.h +++ b/include/openssl/evp.h @@ -1153,7 +1153,10 @@ OPENSSL_EXPORT OPENSSL_DEPRECATED void *EVP_PKEY_get0(const EVP_PKEY *pkey); // OpenSSL_add_all_algorithms does nothing. This has been deprecated since // OpenSSL 1.1.0. -OPENSSL_EXPORT OPENSSL_DEPRECATED void OpenSSL_add_all_algorithms(void); +// +// TODO: Add |OPENSSL_DEPRECATED|. nginx defines -Wno-deprecated-declarations +// and depends on this. +OPENSSL_EXPORT void OpenSSL_add_all_algorithms(void); // OPENSSL_add_all_algorithms_conf does nothing. This has been deprecated since // OpenSSL 1.1.0. @@ -1165,7 +1168,10 @@ OPENSSL_EXPORT OPENSSL_DEPRECATED void OpenSSL_add_all_ciphers(void); // OpenSSL_add_all_digests does nothing. This has been deprecated since OpenSSL // 1.1.0. -OPENSSL_EXPORT OPENSSL_DEPRECATED void OpenSSL_add_all_digests(void); +// +// TODO: Add |OPENSSL_DEPRECATED|. tpm2-tss defines -Wno-deprecated-declarations +// and depends on this. +OPENSSL_EXPORT void OpenSSL_add_all_digests(void); // EVP_cleanup does nothing. This has been deprecated since OpenSSL 1.1.0. OPENSSL_EXPORT OPENSSL_DEPRECATED void EVP_cleanup(void); @@ -1198,7 +1204,10 @@ OPENSSL_EXPORT OPENSSL_DEPRECATED int EVP_PKEY_CTX_set_dsa_paramgen_q_bits( #define EVP_PKEY_DH NID_dhKeyAgreement // EVP_PKEY_get0_DH returns NULL. -OPENSSL_EXPORT OPENSSL_DEPRECATED DH *EVP_PKEY_get0_DH(const EVP_PKEY *pkey); +// +// TODO: Add |OPENSSL_DEPRECATED|. curl defines -Wno-deprecated-declarations and +// depends on this. +OPENSSL_EXPORT DH *EVP_PKEY_get0_DH(const EVP_PKEY *pkey); // EVP_PKEY_get1_DH returns NULL. OPENSSL_EXPORT OPENSSL_DEPRECATED DH *EVP_PKEY_get1_DH(const EVP_PKEY *pkey); diff --git a/include/openssl/rand.h b/include/openssl/rand.h index f7474305739..75f9f3f825f 100644 --- a/include/openssl/rand.h +++ b/include/openssl/rand.h @@ -82,6 +82,9 @@ OPENSSL_EXPORT void RAND_seed(const void *buf, int num); // entropy and mix them into the entropy pool. AWS-LC sources entropy for the // consuming application and the following functions have been deprecated as // no-ops. Consumers should call |RAND_bytes| directly. +// +// TODO: Add |OPENSSL_DEPRECATED| to the ones that are missing. curl and +// tpm2-tss defines -Wno-deprecated-declarations and depends on them. // RAND_load_file returns a nonnegative number. OPENSSL_EXPORT OPENSSL_DEPRECATED int RAND_load_file(const char *path, @@ -105,7 +108,7 @@ OPENSSL_EXPORT OPENSSL_DEPRECATED int RAND_egd(const char *); OPENSSL_EXPORT OPENSSL_DEPRECATED int RAND_poll(void); // RAND_status returns one. -OPENSSL_EXPORT OPENSSL_DEPRECATED int RAND_status(void); +OPENSSL_EXPORT int RAND_status(void); // RAND_cleanup does nothing. OPENSSL_EXPORT OPENSSL_DEPRECATED void RAND_cleanup(void); @@ -126,13 +129,13 @@ struct rand_meth_st { OPENSSL_EXPORT OPENSSL_DEPRECATED RAND_METHOD *RAND_SSLeay(void); // RAND_OpenSSL returns a pointer to a dummy |RAND_METHOD|. -OPENSSL_EXPORT OPENSSL_DEPRECATED RAND_METHOD *RAND_OpenSSL(void); +OPENSSL_EXPORT RAND_METHOD *RAND_OpenSSL(void); // RAND_get_rand_method returns |RAND_SSLeay()|. -OPENSSL_EXPORT OPENSSL_DEPRECATED const RAND_METHOD *RAND_get_rand_method(void); +OPENSSL_EXPORT const RAND_METHOD *RAND_get_rand_method(void); // RAND_set_rand_method returns one. -OPENSSL_EXPORT OPENSSL_DEPRECATED int RAND_set_rand_method(const RAND_METHOD *); +OPENSSL_EXPORT int RAND_set_rand_method(const RAND_METHOD *); // RAND_keep_random_devices_open does nothing. OPENSSL_EXPORT OPENSSL_DEPRECATED void RAND_keep_random_devices_open(int a); diff --git a/include/openssl/ssl.h b/include/openssl/ssl.h index b4cca7c9fd0..738a9d35dcb 100644 --- a/include/openssl/ssl.h +++ b/include/openssl/ssl.h @@ -5658,8 +5658,10 @@ OPENSSL_EXPORT OPENSSL_DEPRECATED int SSL_get_server_tmp_key( SSL *ssl, EVP_PKEY **out_key); // SSL_CTX_set_tmp_dh returns 1. -OPENSSL_EXPORT OPENSSL_DEPRECATED int SSL_CTX_set_tmp_dh(SSL_CTX *ctx, - const DH *dh); +// +// TODO: Add |OPENSSL_DEPRECATED|. nginx defines -Wno-deprecated-declarations +// and depends on this. +OPENSSL_EXPORT int SSL_CTX_set_tmp_dh(SSL_CTX *ctx, const DH *dh); // SSL_set_tmp_dh returns 1. OPENSSL_EXPORT OPENSSL_DEPRECATED int SSL_set_tmp_dh(SSL *ssl, const DH *dh); @@ -5725,9 +5727,10 @@ OPENSSL_EXPORT OPENSSL_DEPRECATED void SSL_set_state(SSL *ssl, int state); // SSL_get_shared_ciphers writes an empty string to |buf| and returns a // pointer to |buf|, or NULL if |len| is less than or equal to zero. -OPENSSL_EXPORT OPENSSL_DEPRECATED char *SSL_get_shared_ciphers(const SSL *ssl, - char *buf, - int len); +// +// TODO: Add |OPENSSL_DEPRECATED|. nginx defines -Wno-deprecated-declarations +// and depends on this. +OPENSSL_EXPORT char *SSL_get_shared_ciphers(const SSL *ssl, char *buf, int len); // SSL_get_shared_sigalgs returns zero. OPENSSL_EXPORT OPENSSL_DEPRECATED int SSL_get_shared_sigalgs( @@ -5744,7 +5747,10 @@ OPENSSL_EXPORT OPENSSL_DEPRECATED int SSL_get_shared_sigalgs( OPENSSL_EXPORT OPENSSL_DEPRECATED void ERR_load_SSL_strings(void); // SSL_load_error_strings does nothing in AWS-LC and OpenSSL. -OPENSSL_EXPORT OPENSSL_DEPRECATED void SSL_load_error_strings(void); +// +// TODO: Add |OPENSSL_DEPRECATED|. nginx defines -Wno-deprecated-declarations +// and depends on this. +OPENSSL_EXPORT void SSL_load_error_strings(void); // SSL TMP_RSA No-ops [Deprecated].