libjwt icon indicating copy to clipboard operation
libjwt copied to clipboard

Compiling under SSL 3.x triggers warnings.

Open thealexparshin opened this issue 1 year ago • 4 comments

-- The C compiler identification is GNU 12.2.0 -- The CXX compiler identification is GNU 12.2.0

Package: libssl-dev Version: 3.0.5-2ubuntu2.1

Warnings during compilation are like:

libjwt/jwt-openssl.c: In function ‘jwt_sign_sha_pem’: libjwt/jwt-openssl.c:258:17: warning: ‘EVP_PKEY_get1_EC_KEY’ is deprecated: Since OpenSSL 3.0 [-Wdeprecated-declarations] 258 | ec_key = EVP_PKEY_get1_EC_KEY(pkey); | ^~~~~~ In file included from libjwt/jwt-openssl.c:13: /usr/include/openssl/evp.h:1374:19: note: declared here 1374 | struct ec_key_st *EVP_PKEY_get1_EC_KEY(EVP_PKEY *pkey); | ^~~~~~~~~~~~~~~~~~~~ libjwt/jwt-openssl.c:262:17: warning: ‘EC_KEY_get0_group’ is deprecated: Since OpenSSL 3.0 [-Wdeprecated-declarations] 262 | degree = EC_GROUP_get_degree(EC_KEY_get0_group(ec_key)); | ^~~~~~

thealexparshin avatar Apr 06 '23 01:04 thealexparshin

Definitely a known issue. Fixing this will require some refactoring. If it becomes messy, It may be worth having a jwt-openssl.c and jwt-openssl3.c to help separate the implementation of these two.

benmcollins avatar Apr 07 '23 16:04 benmcollins

For the record, the warnings are not issues that change LibJWT or keep it from working properly.

benmcollins avatar Apr 07 '23 16:04 benmcollins

Yes, I know - my unit tests confirming that these are still working properly. But these are the only warnings in my project (60K lines). It would be nice not to have them. Also, these deprecated functions will be removed with one of the next versions of OpenSSL. That part bothers me even more.

thealexparshin avatar Apr 09 '23 00:04 thealexparshin

I'm open to having someone fix this up so we don't lose OpenSSL v1.1 compatibility.

benmcollins avatar Jul 11 '23 16:07 benmcollins