From: Adam C. Emerson Date: Wed, 18 May 2022 22:06:01 +0000 (-0400) Subject: build: Silence deprecation warnings from OpenSSL 3 X-Git-Tag: v17.2.4~107^2~5 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=f48ace075ab7ec6071f5e8bde0e13ca37953d924;p=ceph.git 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 (cherry picked from commit d5e1fdfc3cfd15b59e0e8fe2408c995b0cc8c0e7) --- diff --git a/src/auth/Crypto.cc b/src/auth/Crypto.cc index c96222feafcb..ce666e8bdc8c 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 e1f8705c9e65..d658edd6af12 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 2feced03a99a..dd1b14ffab69 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 bb5f27e6b26b..81d0c478651a 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 754b292616ed..54f0cfff9f89 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 @@ public: const rgw::auth::StrategyRegistry&, const std::string&) override; }; +