Menu

Resolve -Wdeprecated-declarations warnings for OpenSSL 3.x

2025-04-28
2025-05-02
  • Yegor Yefremov

    Yegor Yefremov - 2025-04-28

    Hi Dennis,

    I get a bunch of -Wdeprecated-declarations warnings on GCC 14.2.0:

    encrypt_openssl.c: In function ‘RSA_keylen’:
    encrypt_openssl.c:487:5: warning: ‘RSA_size’ is deprecated: Since OpenSSL 3.0 [-Wdeprecated-declarations]
    487 | return RSA_size(rsa);
    | ^~~~~~
    In file included from encrypt_openssl.c:43:
    /usr/include/openssl/rsa.h:215:27: note: declared here
    215 | OSSL_DEPRECATEDIN_3_0 int RSA_size(const RSA *rsa);
    | ^~~~~~~~
    encrypt_openssl.c: In function ‘EC_keylen’:
    encrypt_openssl.c:501:5: warning: ‘i2o_ECPublicKey’ is deprecated: Since OpenSSL 3.0 [-Wdeprecated-declarations]

    Just to name a few.

    Could you take a look at them? Thanks.

     
  • Dennis Bush

    Dennis Bush - 2025-05-02

    Yegor,

    Changing this code to use the EVP_PKEY function instead of the RSA and EC functions will take some time, and I'm not sure if doing so will break systems still using OpenSSL 1.1.

    In the meantime, you can add -Wno-deprecated-declarations to the CFLAGS variable in the makefile to silence the warnings.

    Regards,
    Dennis

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.