Skip to content

Commit

Permalink
build: Silence deprecation warnings from OpenSSL 3
Browse files Browse the repository at this point in the history
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 <aemerson@redhat.com>
  • Loading branch information
adamemerson committed May 18, 2022
1 parent 5dabc21 commit d5e1fdf
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/auth/Crypto.cc
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,20 @@
#include "common/debug.h"
#include <errno.h>

#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;

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
Expand Down Expand Up @@ -603,3 +610,6 @@ CryptoHandler *CryptoHandler::create(int type)
return NULL;
}
}

#pragma clang diagnostic pop
#pragma GCC diagnostic pop
9 changes: 9 additions & 0 deletions src/common/ceph_crypto.cc
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@
# include <openssl/err.h>
#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
Expand Down Expand Up @@ -213,3 +219,6 @@ void ssl::OpenSSLDigest::Final(unsigned char *digest) {
}

}

#pragma clang diagnostic pop
#pragma GCC diagnostic pop
9 changes: 9 additions & 0 deletions src/common/ceph_crypto.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -202,4 +208,7 @@ auto digest(const ceph::buffer::list& bl)
}
}

#pragma clang diagnostic pop
#pragma GCC diagnostic pop

#endif
7 changes: 7 additions & 0 deletions src/common/openssl_opts_handler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
9 changes: 9 additions & 0 deletions src/rgw/rgw_rest_sts.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -227,3 +235,4 @@ class RGWRESTMgr_STS : public RGWRESTMgr {
const rgw::auth::StrategyRegistry&,
const std::string&) override;
};

0 comments on commit d5e1fdf

Please sign in to comment.