anomalizer / ngx_aws_auth

nginx module to proxy to authenticated AWS services
BSD 2-Clause "Simplified" License
470 stars 144 forks source link

‘SHA256_Init’ is deprecated, can't compile on ubuntu 22.04, nginx 1.19.7 #86

Closed scottf-tvw closed 9 months ago

scottf-tvw commented 1 year ago

compile error

cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g -O3  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules \
        -o objs/addon/ngx_aws_auth-2.1.1/crypto_helper_openssl.o \
        ../ngx_aws_auth-2.1.1/crypto_helper_openssl.c
../ngx_aws_auth-2.1.1/crypto_helper_openssl.c: In function ‘ngx_aws_auth__hash_sha256’:
../ngx_aws_auth-2.1.1/crypto_helper_openssl.c:43:5: error: ‘SHA256_Init’ is deprecated: Since OpenSSL 3.0 [-Werror=deprecated-declarations]
   43 |     SHA256_Init(&sha256);
      |     ^~~~~~~~~~~
In file included from ../ngx_aws_auth-2.1.1/crypto_helper_openssl.c:14:
/usr/include/openssl/sha.h:73:27: note: declared here
   73 | OSSL_DEPRECATEDIN_3_0 int SHA256_Init(SHA256_CTX *c);
      |                           ^~~~~~~~~~~
../ngx_aws_auth-2.1.1/crypto_helper_openssl.c:44:5: error: ‘SHA256_Update’ is deprecated: Since OpenSSL 3.0 [-Werror=deprecated-declarations]
   44 |     SHA256_Update(&sha256, blob->data, blob->len);
      |     ^~~~~~~~~~~~~
In file included from ../ngx_aws_auth-2.1.1/crypto_helper_openssl.c:14:
/usr/include/openssl/sha.h:74:27: note: declared here
   74 | OSSL_DEPRECATEDIN_3_0 int SHA256_Update(SHA256_CTX *c,
      |                           ^~~~~~~~~~~~~
../ngx_aws_auth-2.1.1/crypto_helper_openssl.c:45:5: error: ‘SHA256_Final’ is deprecated: Since OpenSSL 3.0 [-Werror=deprecated-declarations]
   45 |     SHA256_Final(hash, &sha256);
      |     ^~~~~~~~~~~~
In file included from ../ngx_aws_auth-2.1.1/crypto_helper_openssl.c:14:
/usr/include/openssl/sha.h:76:27: note: declared here
   76 | OSSL_DEPRECATEDIN_3_0 int SHA256_Final(unsigned char *md, SHA256_CTX *c);
      |                           ^~~~~~~~~~~~
cc1: all warnings being treated as errors

Any Ideas how to get around this?

ubmaity commented 1 year ago

Downgrade your openSSL version to 1.x.x and this should go away when you rebuild.

gauravko commented 1 year ago

Have pushed a PR to maintain compatibility with OpenSSL 3.0.

selfing12 commented 1 year ago

@anomalizer

gauravko commented 10 months ago

@scottf-tvw - this is resolved now !