From d5e1fdfc3cfd15b59e0e8fe2408c995b0cc8c0e7 Mon Sep 17 00:00:00 2001 From: "Adam C. Emerson" Date: Wed, 18 May 2022 18:06:01 -0400 Subject: [PATCH] build: Silence deprecation warnings from OpenSSL 3 The OpenSSL developers suggest that anyone wishing to continue using low-level functions may either live with the warnings, silence them, or switch to high level functions. As high level functions do their own memory allocation, switching to them may lead to performance regressions. We do not wish to have deprecation warnings filling up our compiler outputs when searching for other messages. So silencing the warnings, at least for now, seems the least bad option. Signed-off-by: Adam C. Emerson --- src/auth/Crypto.cc | 10 ++++++++++ src/common/ceph_crypto.cc | 9 +++++++++ src/common/ceph_crypto.h | 9 +++++++++ src/common/openssl_opts_handler.cc | 7 +++++++ src/rgw/rgw_rest_sts.h | 9 +++++++++ 5 files changed, 44 insertions(+) diff --git a/src/auth/Crypto.cc b/src/auth/Crypto.cc index c96222feafcb8..ce666e8bdc8c3 100644 --- a/src/auth/Crypto.cc +++ b/src/auth/Crypto.cc @@ -33,6 +33,12 @@ #include "common/debug.h" #include +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + using std::ostringstream; using std::string; @@ -40,6 +46,7 @@ using ceph::bufferlist; using ceph::bufferptr; using ceph::Formatter; + // use getentropy() if available. it uses the same source of randomness // as /dev/urandom without the filesystem overhead #ifdef HAVE_GETENTROPY @@ -603,3 +610,6 @@ CryptoHandler *CryptoHandler::create(int type) return NULL; } } + +#pragma clang diagnostic pop +#pragma GCC diagnostic pop diff --git a/src/common/ceph_crypto.cc b/src/common/ceph_crypto.cc index e1f8705c9e654..d658edd6af129 100644 --- a/src/common/ceph_crypto.cc +++ b/src/common/ceph_crypto.cc @@ -27,6 +27,12 @@ # include #endif /* OPENSSL_VERSION_NUMBER < 0x10100000L */ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + namespace TOPNSPC::crypto::ssl { #if OPENSSL_VERSION_NUMBER < 0x10100000L @@ -213,3 +219,6 @@ void ssl::OpenSSLDigest::Final(unsigned char *digest) { } } + +#pragma clang diagnostic pop +#pragma GCC diagnostic pop diff --git a/src/common/ceph_crypto.h b/src/common/ceph_crypto.h index 2feced03a99a5..dd1b14ffab69e 100644 --- a/src/common/ceph_crypto.h +++ b/src/common/ceph_crypto.h @@ -22,6 +22,12 @@ #include "include/ceph_assert.h" +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + extern "C" { const EVP_MD *EVP_md5(void); const EVP_MD *EVP_sha1(void); @@ -202,4 +208,7 @@ auto digest(const ceph::buffer::list& bl) } } +#pragma clang diagnostic pop +#pragma GCC diagnostic pop + #endif diff --git a/src/common/openssl_opts_handler.cc b/src/common/openssl_opts_handler.cc index bb5f27e6b26b1..81d0c478651a6 100644 --- a/src/common/openssl_opts_handler.cc +++ b/src/common/openssl_opts_handler.cc @@ -113,7 +113,14 @@ void load_module(const string &engine_conf) } OPENSSL_load_builtin_modules(); +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" ENGINE_load_builtin_engines(); +#pragma clang diagnostic pop +#pragma GCC diagnostic pop if (CONF_modules_load( conf, nullptr, diff --git a/src/rgw/rgw_rest_sts.h b/src/rgw/rgw_rest_sts.h index 754b292616ed9..54f0cfff9f895 100644 --- a/src/rgw/rgw_rest_sts.h +++ b/src/rgw/rgw_rest_sts.h @@ -8,9 +8,17 @@ #include "rgw_rest.h" #include "rgw_sts.h" #include "rgw_web_idp.h" +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" #include "jwt-cpp/jwt.h" +#pragma clang diagnostic pop +#pragma GCC diagnostic pop #include "rgw_oidc_provider.h" + namespace rgw::auth::sts { class WebTokenEngine : public rgw::auth::Engine { @@ -227,3 +235,4 @@ class RGWRESTMgr_STS : public RGWRESTMgr { const rgw::auth::StrategyRegistry&, const std::string&) override; }; +