Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OpenSSL deprecation warnings #6771

Open
3 tasks
vvbohdan opened this issue Nov 4, 2024 · 0 comments
Open
3 tasks

OpenSSL deprecation warnings #6771

vvbohdan opened this issue Nov 4, 2024 · 0 comments

Comments

@vvbohdan
Copy link
Contributor

vvbohdan commented Nov 4, 2024

Description
During the build there are some warnings about usage of deprecated OpenSSL functionality.

Use case
We want to replace deprecated functionality with the new one, to use latest version and don't have warnings.

Additional Context
src/common/SSLUtil.cc: In function 'int ssl_util::rsa_public_encrypt(const std::string&, std::string&)': src/common/SSLUtil.cc:271:40: warning: 'RSA* PEM_read_RSAPublicKey(FILE*, RSA**, int (*)(char*, int, int, void*), void*)' is deprecated: Since OpenSSL 3.0 [-Wdeprecated-declarations] 271 | rsa = PEM_read_RSAPublicKey(fp, &rsa, nullptr, nullptr); | ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from src/common/SSLUtil.cc:21: /usr/include/openssl/pem.h:452:1: note: declared here 452 | DECLARE_PEM_rw_attr(OSSL_DEPRECATEDIN_3_0, RSAPublicKey, RSA) | ^~~~~~~~~~~~~~~~~~~ src/common/SSLUtil.cc:281:63: warning: 'int RSA_size(const RSA*)' is deprecated: Since OpenSSL 3.0 [-Wdeprecated-declarations] 281 | char * out_c = (char *) malloc(sizeof(char) * RSA_size(rsa)); | ~~~~~~~~^~~~~ In file included from src/common/SSLUtil.cc:20: /usr/include/openssl/rsa.h:215:27: note: declared here 215 | OSSL_DEPRECATEDIN_3_0 int RSA_size(const RSA *rsa); | ^~~~~~~~ src/common/SSLUtil.cc:283:36: warning: 'int RSA_public_encrypt(int, const unsigned char*, unsigned char*, RSA*, int)' is deprecated: Since OpenSSL 3.0 [-Wdeprecated-declarations] 283 | int rc = RSA_public_encrypt(in.length(), (const unsigned char *) in.c_str(), | ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 284 | (unsigned char *) out_c, rsa, RSA_PKCS1_PADDING); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/openssl/rsa.h:293:5: note: declared here 293 | int RSA_public_encrypt(int flen, const unsigned char *from, unsigned char *to, | ^~~~~~~~~~~~~~~~~~ src/common/SSLUtil.cc: In function 'int ssl_util::rsa_private_decrypt(const std::string&, std::string&)': src/common/SSLUtil.cc:316:41: warning: 'RSA* PEM_read_RSAPrivateKey(FILE*, RSA**, int (*)(char*, int, int, void*), void*)' is deprecated: Since OpenSSL 3.0 [-Wdeprecated-declarations] 316 | rsa = PEM_read_RSAPrivateKey(fp, &rsa, nullptr, nullptr); | ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/openssl/pem.h:451:1: note: declared here 451 | DECLARE_PEM_rw_cb_attr(OSSL_DEPRECATEDIN_3_0, RSAPrivateKey, RSA) | ^~~~~~~~~~~~~~~~~~~~~~ src/common/SSLUtil.cc:328:32: warning: 'int RSA_size(const RSA*)' is deprecated: Since OpenSSL 3.0 [-Wdeprecated-declarations] 328 | int key_size = RSA_size(rsa); | ~~~~~~~~^~~~~ /usr/include/openssl/rsa.h:215:27: note: declared here 215 | OSSL_DEPRECATEDIN_3_0 int RSA_size(const RSA *rsa); | ^~~~~~~~ src/common/SSLUtil.cc:330:63: warning: 'int RSA_size(const RSA*)' is deprecated: Since OpenSSL 3.0 [-Wdeprecated-declarations] 330 | char * out_c = (char *) malloc(sizeof(char) * RSA_size(rsa)); | ~~~~~~~~^~~~~ /usr/include/openssl/rsa.h:215:27: note: declared here 215 | OSSL_DEPRECATEDIN_3_0 int RSA_size(const RSA *rsa); | ^~~~~~~~ src/common/SSLUtil.cc:343:41: warning: 'int RSA_private_decrypt(int, const unsigned char*, unsigned char*, RSA*, int)' is deprecated: Since OpenSSL 3.0 [-Wdeprecated-declarations] 343 | int rc = RSA_private_decrypt(block_size, (const unsigned char *) | ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 344 | in_c + index, (unsigned char *) out_c, rsa, RSA_PKCS1_PADDING); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/openssl/rsa.h:302:5: note: declared here 302 | int RSA_private_decrypt(int flen, const unsigned char *from, unsigned char *to, | ^~~~~~~~~~~~~~~~~~~

Progress Status

  • Code committed
  • Testing - QA
  • Documentation (Release notes - resolved issues, compatibility, known issues)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants