I recently updated my OS to 22.04, which uses openssl-3 by default. That's excellent, but we get a bunch of deprecation warnings now, such as:
/home/patti/Code/aktualizr/src/libaktualizr/crypto/p11engine.h: In destructor ‘virtual P11Engine::~P11Engine()’:
/home/patti/Code/aktualizr/src/libaktualizr/crypto/p11engine.h:56:20: warning: ‘int ENGINE_finish(ENGINE*)’ is deprecated: Since OpenSSL 3.0 [-Wdeprecated-declarations]
56 | ENGINE_finish(ssl_engine_);
| ~~~~~~~~~~~~~^~~~~~~~~~~~~
/home/patti/Code/aktualizr/src/libaktualizr/crypto/p11engine.h:57:18: warning: ‘int ENGINE_free(ENGINE*)’ is deprecated: Since OpenSSL 3.0 [-Wdeprecated-declarations]
57 | ENGINE_free(ssl_engine_);
| ~~~~~~~~~~~^~~~~~~~~~~~~
/home/patti/Code/aktualizr/src/libaktualizr/crypto/crypto.cc: In static member function ‘static std::string Crypto::RSAPSSSign(ENGINE*, const string&, const string&)’:
/home/patti/Code/aktualizr/src/libaktualizr/crypto/crypto.cc:143:33: warning: ‘void RSA_free(RSA*)’ is deprecated: Since OpenSSL 3.0 [-Wdeprecated-declarations]
143 | StructGuard<RSA> rsa(nullptr, RSA_free);
| ^~~~~~~~
/home/patti/Code/aktualizr/src/libaktualizr/crypto/crypto.cc:146:38: warning: ‘EVP_PKEY* ENGINE_load_private_key(ENGINE*, const char*, UI_METHOD*, void*)’ is deprecated: Since OpenSSL 3.0 [-Wdeprecated-declarations]
146 | key.reset(ENGINE_load_private_key(engine, private_key.c_str(), nullptr, nullptr));
| ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/patti/Code/aktualizr/src/libaktualizr/crypto/crypto.cc:153:32: warning: ‘rsa_st* EVP_PKEY_get1_RSA(EVP_PKEY*)’ is deprecated: Since OpenSSL 3.0 [-Wdeprecated-declarations]
153 | rsa.reset(EVP_PKEY_get1_RSA(key.get()));
| ~~~~~~~~~~~~~~~~~^~~~~~~~~~~
/home/patti/Code/aktualizr/src/libaktualizr/crypto/crypto.cc:174:48: warning: ‘const RSA_METHOD* RSA_PKCS1_OpenSSL()’ is deprecated: Since OpenSSL 3.0 [-Wdeprecated-declarations]
174 | RSA_set_method(rsa.get(), RSA_PKCS1_OpenSSL());
| ~~~~~~~~~~~~~~~~~^~
/home/patti/Code/aktualizr/src/libaktualizr/crypto/crypto.cc:174:19: warning: ‘int RSA_set_method(RSA*, const RSA_METHOD*)’ is deprecated: Since OpenSSL 3.0 [-Wdeprecated-declarations]
174 | RSA_set_method(rsa.get(), RSA_PKCS1_OpenSSL());
| ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/patti/Code/aktualizr/src/libaktualizr/crypto/crypto.cc:178:60: warning: ‘int RSA_size(const RSA*)’ is deprecated: Since OpenSSL 3.0 [-Wdeprecated-declarations]
178 | const auto sign_size = static_cast<unsigned int>(RSA_size(rsa.get()));
| ~~~~~~~~^~~~~~~~~~~
/home/patti/Code/aktualizr/src/libaktualizr/crypto/crypto.cc:183:41: warning: ‘int RSA_padding_add_PKCS1_PSS(RSA*, unsigned char*, const unsigned char*, const EVP_MD*, int)’ is deprecated: Since OpenSSL 3.0 [-Wdeprecated-declarations]
183 | int status = RSA_padding_add_PKCS1_PSS(rsa.get(), EM.get(), reinterpret_cast<const unsigned char *>(digest.c_str()),
| ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
184 | EVP_sha256(), -1 /* maximum salt length*/);
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/openssl/rsa.h:428:5: note: declared here
428 | int RSA_padding_add_PKCS1_PSS(RSA *rsa, unsigned char *EM,
| ^~~~~~~~~~~~~~~~~~~~~~~~~
/home/patti/Code/aktualizr/src/libaktualizr/crypto/crypto.cc:191:40: warning: ‘int RSA_size(const RSA*)’ is deprecated: Since OpenSSL 3.0 [-Wdeprecated-declarations]
/home/patti/Code/aktualizr/src/libaktualizr/crypto/crypto.cc:191:31: warning: ‘int RSA_private_encrypt(int, const unsigned char*, unsigned char*, RSA*, int)’ is deprecated: Since OpenSSL 3.0 [-Wdeprecated-declarations]
191 | status = RSA_private_encrypt(RSA_size(rsa.get()), EM.get(), pSignature.get(), rsa.get(), RSA_NO_PADDING);
| ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/patti/Code/aktualizr/src/libaktualizr/crypto/crypto.cc: In static member function ‘static bool Crypto::RSAPSSVerify(const string&, const string&, const string&)’:
/home/patti/Code/aktualizr/src/libaktualizr/crypto/crypto.cc:215:33: warning: ‘void RSA_free(RSA*)’ is deprecated: Since OpenSSL 3.0 [-Wdeprecated-declarations]
215 | StructGuard<RSA> rsa(nullptr, RSA_free);
| ^~~~~~~~
/home/patti/Code/aktualizr/src/libaktualizr/crypto/crypto.cc:220:32: warning: ‘RSA* PEM_read_bio_RSA_PUBKEY(BIO*, RSA**, int (*)(char*, int, int, void*), void*)’ is deprecated: Since OpenSSL 3.0 [-Wdeprecated-declarations]
220 | if (PEM_read_bio_RSA_PUBKEY(bio.get(), &r, nullptr, nullptr) == nullptr) {
| ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
... and so on. There are also a couple boost errors I'm seeing (with 1.74.0) like this:
/usr/include/boost/bind.hpp:36:1: note: ‘#pragma message: The practice of declaring the Bind placeholders (_1, _2, ...) in the global namespace is deprecated. Please use <boost/bind/bind.hpp> + using namespace boost::placeholders, or define BOOST_BIND_GLOBAL_PLACEHOLDERS to retain the current behavior.’
36 | BOOST_PRAGMA_MESSAGE(
| ^~~~~~~~~~~~~~~~~~~~
[144/190] Building CXX object src/sota_tools/CMakeFiles/sota_tools_lib.dir/server_credentials.cc.o
I recently updated my OS to 22.04, which uses openssl-3 by default. That's excellent, but we get a bunch of deprecation warnings now, such as:
... and so on. There are also a couple boost errors I'm seeing (with 1.74.0) like this: