Skip to content

openssl_wrapper.c needs to be updated for openssl 3.0.0 #67

Open

Description

@kanavin

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

Activity

  1. cristian-stoica commented on Sep 10, 2021

    @cristian-stoica
    Collaborator

    @kanavin Are you working on a patch to fix the compilation in a backward-compatible way?

  2. kanavin commented on Sep 10, 2021

    @kanavin
    ContributorAuthor

    No, I only wanted to document the issue for now.

  3. ceztko commented on Jan 8, 2023

    @ceztko

    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).

  4. added a commit that references this issue on Jun 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions