[GH-ISSUE #48] Various HMAC_* functions are deprecated since OpenSSL 3.0 #28

Open
opened 2026-02-25 22:30:48 +03:00 by kerem · 0 comments
Owner

Originally created by @spike77453 on GitHub (Aug 11, 2023).
Original GitHub issue: https://github.com/evgeny-gridasov/openvpn-otp/issues/48

Compiling openvpn-otp against OpenSSL 3.0 results in various deprecation warnings:

otp.c: In function 'otp_verify':
otp.c:415:13: warning: 'HMAC_CTX_new' is deprecated: Since OpenSSL 3.0 [-Wdeprecated-declarations]
  415 |             HMAC_CTX* hmac = HMAC_CTX_new();
      |             ^~~~~~~~
In file included from otp.c:22:
/usr/include/openssl/hmac.h:33:33: note: declared here
   33 | OSSL_DEPRECATEDIN_3_0 HMAC_CTX *HMAC_CTX_new(void);
      |                                 ^~~~~~~~~~~~
otp.c:440:17: warning: 'HMAC_CTX_reset' is deprecated: Since OpenSSL 3.0 [-Wdeprecated-declarations]
  440 |                 HMAC_CTX_reset(hmac);
      |                 ^~~~~~~~~~~~~~
/usr/include/openssl/hmac.h:34:27: note: declared here
   34 | OSSL_DEPRECATEDIN_3_0 int HMAC_CTX_reset(HMAC_CTX *ctx);
      |                           ^~~~~~~~~~~~~~
otp.c:441:17: warning: 'HMAC_Init_ex' is deprecated: Since OpenSSL 3.0 [-Wdeprecated-declarations]
  441 |                 HMAC_Init_ex(hmac, otp_key, key_len, otp_digest, NULL);
      |                 ^~~~~~~~~~~~
/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,
      |                           ^~~~~~~~~~~~
otp.c:442:17: warning: 'HMAC_Update' is deprecated: Since OpenSSL 3.0 [-Wdeprecated-declarations]
  442 |                 HMAC_Update(hmac, (uint8_t *)&Tn, sizeof(Tn));
      |                 ^~~~~~~~~~~
/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,
      |                           ^~~~~~~~~~~
otp.c:443:17: warning: 'HMAC_Final' is deprecated: Since OpenSSL 3.0 [-Wdeprecated-declarations]
  443 |                 HMAC_Final(hmac, mac, &maclen);
      |                 ^~~~~~~~~~
/usr/include/openssl/hmac.h:47:27: note: declared here
   47 | OSSL_DEPRECATEDIN_3_0 int HMAC_Final(HMAC_CTX *ctx, unsigned char *md,
      |                           ^~~~~~~~~~
otp.c:466:13: warning: 'HMAC_CTX_free' is deprecated: Since OpenSSL 3.0 [-Wdeprecated-declarations]
  466 |             HMAC_CTX_free(hmac);
      |             ^~~~~~~~~~~~~
/usr/include/openssl/hmac.h:35:28: note: declared here
   35 | OSSL_DEPRECATEDIN_3_0 void HMAC_CTX_free(HMAC_CTX *ctx);
      |                            ^~~~~~~~~~~~~
otp.c:471:13: warning: 'HMAC_CTX_new' is deprecated: Since OpenSSL 3.0 [-Wdeprecated-declarations]
  471 |             HMAC_CTX* hmac = HMAC_CTX_new();
      |             ^~~~~~~~
/usr/include/openssl/hmac.h:33:33: note: declared here
   33 | OSSL_DEPRECATEDIN_3_0 HMAC_CTX *HMAC_CTX_new(void);
      |                                 ^~~~~~~~~~~~
otp.c:493:19: warning: 'HMAC_CTX_reset' is deprecated: Since OpenSSL 3.0 [-Wdeprecated-declarations]
  493 |                   HMAC_CTX_reset(hmac);
      |                   ^~~~~~~~~~~~~~
/usr/include/openssl/hmac.h:34:27: note: declared here
   34 | OSSL_DEPRECATEDIN_3_0 int HMAC_CTX_reset(HMAC_CTX *ctx);
      |                           ^~~~~~~~~~~~~~
otp.c:494:19: warning: 'HMAC_Init_ex' is deprecated: Since OpenSSL 3.0 [-Wdeprecated-declarations]
  494 |                   HMAC_Init_ex(hmac, otp_key, key_len, otp_digest, NULL);
      |                   ^~~~~~~~~~~~
/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,
      |                           ^~~~~~~~~~~~
otp.c:495:19: warning: 'HMAC_Update' is deprecated: Since OpenSSL 3.0 [-Wdeprecated-declarations]
  495 |                   HMAC_Update(hmac, (uint8_t *)&Tn, sizeof(Tn));
      |                   ^~~~~~~~~~~
/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,
      |                           ^~~~~~~~~~~
otp.c:496:19: warning: 'HMAC_Final' is deprecated: Since OpenSSL 3.0 [-Wdeprecated-declarations]
  496 |                   HMAC_Final(hmac, mac, &maclen);
      |                   ^~~~~~~~~~
/usr/include/openssl/hmac.h:47:27: note: declared here
   47 | OSSL_DEPRECATEDIN_3_0 int HMAC_Final(HMAC_CTX *ctx, unsigned char *md,
      |                           ^~~~~~~~~~
otp.c:521:13: warning: 'HMAC_CTX_free' is deprecated: Since OpenSSL 3.0 [-Wdeprecated-declarations]
  521 |             HMAC_CTX_free(hmac);
      |             ^~~~~~~~~~~~~
/usr/include/openssl/hmac.h:35:28: note: declared here
   35 | OSSL_DEPRECATEDIN_3_0 void HMAC_CTX_free(HMAC_CTX *ctx);
      |                            ^~~~~~~~~~~~~
Originally created by @spike77453 on GitHub (Aug 11, 2023). Original GitHub issue: https://github.com/evgeny-gridasov/openvpn-otp/issues/48 Compiling openvpn-otp against OpenSSL 3.0 results in various deprecation warnings: ``` otp.c: In function 'otp_verify': otp.c:415:13: warning: 'HMAC_CTX_new' is deprecated: Since OpenSSL 3.0 [-Wdeprecated-declarations] 415 | HMAC_CTX* hmac = HMAC_CTX_new(); | ^~~~~~~~ In file included from otp.c:22: /usr/include/openssl/hmac.h:33:33: note: declared here 33 | OSSL_DEPRECATEDIN_3_0 HMAC_CTX *HMAC_CTX_new(void); | ^~~~~~~~~~~~ otp.c:440:17: warning: 'HMAC_CTX_reset' is deprecated: Since OpenSSL 3.0 [-Wdeprecated-declarations] 440 | HMAC_CTX_reset(hmac); | ^~~~~~~~~~~~~~ /usr/include/openssl/hmac.h:34:27: note: declared here 34 | OSSL_DEPRECATEDIN_3_0 int HMAC_CTX_reset(HMAC_CTX *ctx); | ^~~~~~~~~~~~~~ otp.c:441:17: warning: 'HMAC_Init_ex' is deprecated: Since OpenSSL 3.0 [-Wdeprecated-declarations] 441 | HMAC_Init_ex(hmac, otp_key, key_len, otp_digest, NULL); | ^~~~~~~~~~~~ /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, | ^~~~~~~~~~~~ otp.c:442:17: warning: 'HMAC_Update' is deprecated: Since OpenSSL 3.0 [-Wdeprecated-declarations] 442 | HMAC_Update(hmac, (uint8_t *)&Tn, sizeof(Tn)); | ^~~~~~~~~~~ /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, | ^~~~~~~~~~~ otp.c:443:17: warning: 'HMAC_Final' is deprecated: Since OpenSSL 3.0 [-Wdeprecated-declarations] 443 | HMAC_Final(hmac, mac, &maclen); | ^~~~~~~~~~ /usr/include/openssl/hmac.h:47:27: note: declared here 47 | OSSL_DEPRECATEDIN_3_0 int HMAC_Final(HMAC_CTX *ctx, unsigned char *md, | ^~~~~~~~~~ otp.c:466:13: warning: 'HMAC_CTX_free' is deprecated: Since OpenSSL 3.0 [-Wdeprecated-declarations] 466 | HMAC_CTX_free(hmac); | ^~~~~~~~~~~~~ /usr/include/openssl/hmac.h:35:28: note: declared here 35 | OSSL_DEPRECATEDIN_3_0 void HMAC_CTX_free(HMAC_CTX *ctx); | ^~~~~~~~~~~~~ otp.c:471:13: warning: 'HMAC_CTX_new' is deprecated: Since OpenSSL 3.0 [-Wdeprecated-declarations] 471 | HMAC_CTX* hmac = HMAC_CTX_new(); | ^~~~~~~~ /usr/include/openssl/hmac.h:33:33: note: declared here 33 | OSSL_DEPRECATEDIN_3_0 HMAC_CTX *HMAC_CTX_new(void); | ^~~~~~~~~~~~ otp.c:493:19: warning: 'HMAC_CTX_reset' is deprecated: Since OpenSSL 3.0 [-Wdeprecated-declarations] 493 | HMAC_CTX_reset(hmac); | ^~~~~~~~~~~~~~ /usr/include/openssl/hmac.h:34:27: note: declared here 34 | OSSL_DEPRECATEDIN_3_0 int HMAC_CTX_reset(HMAC_CTX *ctx); | ^~~~~~~~~~~~~~ otp.c:494:19: warning: 'HMAC_Init_ex' is deprecated: Since OpenSSL 3.0 [-Wdeprecated-declarations] 494 | HMAC_Init_ex(hmac, otp_key, key_len, otp_digest, NULL); | ^~~~~~~~~~~~ /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, | ^~~~~~~~~~~~ otp.c:495:19: warning: 'HMAC_Update' is deprecated: Since OpenSSL 3.0 [-Wdeprecated-declarations] 495 | HMAC_Update(hmac, (uint8_t *)&Tn, sizeof(Tn)); | ^~~~~~~~~~~ /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, | ^~~~~~~~~~~ otp.c:496:19: warning: 'HMAC_Final' is deprecated: Since OpenSSL 3.0 [-Wdeprecated-declarations] 496 | HMAC_Final(hmac, mac, &maclen); | ^~~~~~~~~~ /usr/include/openssl/hmac.h:47:27: note: declared here 47 | OSSL_DEPRECATEDIN_3_0 int HMAC_Final(HMAC_CTX *ctx, unsigned char *md, | ^~~~~~~~~~ otp.c:521:13: warning: 'HMAC_CTX_free' is deprecated: Since OpenSSL 3.0 [-Wdeprecated-declarations] 521 | HMAC_CTX_free(hmac); | ^~~~~~~~~~~~~ /usr/include/openssl/hmac.h:35:28: note: declared here 35 | OSSL_DEPRECATEDIN_3_0 void HMAC_CTX_free(HMAC_CTX *ctx); | ^~~~~~~~~~~~~ ```
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/openvpn-otp#28
No description provided.