Repository navigation
openssl_wrapper.c needs to be updated for openssl 3.0.0 #67
Copy link
Copy link
Open
Description
There are new deprecations that become errors with -Werror:
openssl_wrapper.c: In function 'remove_mapping':
openssl_wrapper.c:77:17: error: 'HMAC_CTX_free' is deprecated: Since OpenSSL 3.0 [-Werror=deprecated-declarations]
77 | HMAC_CTX_free(mapping->ctx.hmac);
| ^~~~~~~~~~~~~
In file included from openssl_wrapper.c:6:
/home/alex/development/poky/build-32/tmp/work/core2-32-poky-linux/cryptodev-tests/1.12-r0/recipe-sysroot/usr/include/openssl/hmac.h:35:28: note: declared here
35 | OSSL_DEPRECATEDIN_3_0 void HMAC_CTX_free(HMAC_CTX *ctx);
| ^~~~~~~~~~~~~
openssl_wrapper.c: In function 'openssl_hmac':
openssl_wrapper.c:153:17: error: 'HMAC_CTX_new' is deprecated: Since OpenSSL 3.0 [-Werror=deprecated-declarations]
153 | ctx = HMAC_CTX_new();
| ^~~
In file included from openssl_wrapper.c:6:
/home/alex/development/poky/build-32/tmp/work/core2-32-poky-linux/cryptodev-tests/1.12-r0/recipe-sysroot/usr/include/openssl/hmac.h:33:33: note: declared here
33 | OSSL_DEPRECATEDIN_3_0 HMAC_CTX *HMAC_CTX_new(void);
| ^~~~~~~~~~~~
openssl_wrapper.c:161:17: error: 'HMAC_Init_ex' is deprecated: Since OpenSSL 3.0 [-Werror=deprecated-declarations]
161 | if (!HMAC_Init_ex(ctx, sess->mackey, sess->mackeylen,
| ^~
In file included from openssl_wrapper.c:6:
/home/alex/development/poky/build-32/tmp/work/core2-32-poky-linux/cryptodev-tests/1.12-r0/recipe-sysroot/usr/include/openssl/hmac.h:43:27: note: declared here
43 | OSSL_DEPRECATEDIN_3_0 int HMAC_Init_ex(HMAC_CTX *ctx, const void *key, int len,
| ^~~~~~~~~~~~
openssl_wrapper.c:170:17: error: 'HMAC_Update' is deprecated: Since OpenSSL 3.0 [-Werror=deprecated-declarations]
170 | if (!HMAC_Update(ctx, cop->src, cop->len)) {
| ^~
In file included from openssl_wrapper.c:6:
/home/alex/development/poky/build-32/tmp/work/core2-32-poky-linux/cryptodev-tests/1.12-r0/recipe-sysroot/usr/include/openssl/hmac.h:45:27: note: declared here
45 | OSSL_DEPRECATEDIN_3_0 int HMAC_Update(HMAC_CTX *ctx, const unsigned char *data,
| ^~~~~~~~~~~
openssl_wrapper.c:178:17: error: 'HMAC_Final' is deprecated: Since OpenSSL 3.0 [-Werror=deprecated-declarations]
178 | if (!HMAC_Final(ctx, cop->mac, 0)) {
| ^~
In file included from openssl_wrapper.c:6:
/home/alex/development/poky/build-32/tmp/work/core2-32-poky-linux/cryptodev-tests/1.12-r0/recipe-sysroot/usr/include/openssl/hmac.h:47:27: note: declared here
47 | OSSL_DEPRECATEDIN_3_0 int HMAC_Final(HMAC_CTX *ctx, unsigned char *md,
| ^~~~~~~~~~
openssl_wrapper.c: In function 'openssl_aes':
openssl_wrapper.c:244:17: error: 'AES_set_encrypt_key' is deprecated: Since OpenSSL 3.0 [-Werror=deprecated-declarations]
244 | AES_set_encrypt_key(sess->key, sess->keylen * 8, &key);
| ^~~~~~~~~~~~~~~~~~~
In file included from openssl_wrapper.c:4:
/home/alex/development/poky/build-32/tmp/work/core2-32-poky-linux/cryptodev-tests/1.12-r0/recipe-sysroot/usr/include/openssl/aes.h:51:5: note: declared here
51 | int AES_set_encrypt_key(const unsigned char *userKey, const int bits,
| ^~~~~~~~~~~~~~~~~~~
openssl_wrapper.c:248:17: error: 'AES_set_decrypt_key' is deprecated: Since OpenSSL 3.0 [-Werror=deprecated-declarations]
248 | AES_set_decrypt_key(sess->key, sess->keylen * 8, &key);
| ^~~~~~~~~~~~~~~~~~~
In file included from openssl_wrapper.c:4:
/home/alex/development/poky/build-32/tmp/work/core2-32-poky-linux/cryptodev-tests/1.12-r0/recipe-sysroot/usr/include/openssl/aes.h:54:5: note: declared here
54 | int AES_set_decrypt_key(const unsigned char *userKey, const int bits,
| ^~~~~~~~~~~~~~~~~~~
openssl_wrapper.c:259:17: error: 'AES_cbc_encrypt' is deprecated: Since OpenSSL 3.0 [-Werror=deprecated-declarations]
259 | AES_cbc_encrypt(cop->src, cop->dst, cop->len, &key, ivec, enc);
| ^~~~~~~~~~~~~~~
In file included from openssl_wrapper.c:4:
/home/alex/development/poky/build-32/tmp/work/core2-32-poky-linux/cryptodev-tests/1.12-r0/recipe-sysroot/usr/include/openssl/aes.h:66:6: note: declared here
66 | void AES_cbc_encrypt(const unsigned char *in, unsigned char *out,
| ^~~~~~~~~~~~~~~
openssl_wrapper.c:271:25: error: 'AES_ecb_encrypt' is deprecated: Since OpenSSL 3.0 [-Werror=deprecated-declarations]
271 | AES_ecb_encrypt(cop->src + i, cop->dst + i, &key, enc);
| ^~~~~~~~~~~~~~~
In file included from openssl_wrapper.c:4:
/home/alex/development/poky/build-32/tmp/work/core2-32-poky-linux/cryptodev-tests/1.12-r0/recipe-sysroot/usr/include/openssl/aes.h:63:6: note: declared here
63 | void AES_ecb_encrypt(const unsigned char *in, unsigned char *out,
| ^~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Activity
cristian-stoica commentedon Sep 10, 2021
@kanavin Are you working on a patch to fix the compilation in a backward-compatible way?
kanavin commentedon Sep 10, 2021
No, I only wanted to document the issue for now.
ceztko commentedon Jan 8, 2023
I stumbled upon this issue (I don't use your project) and since it's still open I think you may find interesting my port of a library to OpenSSL 3.0 which is backward compatible to 1.1. It has zero deprecation warning in OpenSSL 3.0 and it uses the providers properly handling also deprecated algorithms (which I have to use, you may not need that).
tests/Makefile: do not use -Werror