[GH-ISSUE #110] Compilation warnings for deprecated SHA256_ functions in OpenSSL 3.0 #96

Closed
opened 2026-03-03 01:19:46 +03:00 by kerem · 0 comments
Owner

Originally created by @d99kris on GitHub (Aug 14, 2022).
Original GitHub issue: https://github.com/d99kris/nmail/issues/110

Originally assigned to: @d99kris on GitHub.

Compilation warnings observed on newer OpenSSL versions, for example in Ubuntu 22.04.1:

/home/d99kris/git/nmail/src/crypto.cpp: In static member function ‘static std::string Crypto::SHA256(const string&)’:
/home/d99kris/git/nmail/src/crypto.cpp:143:14: warning: ‘int SHA256_Init(SHA256_CTX*)’ is deprecated: Since OpenSSL 3.0 [-Wdeprecated-declarations]
  143 |   SHA256_Init(&sha256);
      |   ~~~~~~~~~~~^~~~~~~~~
In file included from /home/d99kris/git/nmail/src/crypto.cpp:18:
/usr/include/openssl/sha.h:73:27: note: declared here
   73 | OSSL_DEPRECATEDIN_3_0 int SHA256_Init(SHA256_CTX *c);
      |                           ^~~~~~~~~~~
/home/d99kris/git/nmail/src/crypto.cpp:144:16: warning: ‘int SHA256_Update(SHA256_CTX*, const void*, size_t)’ is deprecated: Since OpenSSL 3.0 [-Wdeprecated-declarations]
  144 |   SHA256_Update(&sha256, p_Str.c_str(), p_Str.size());
      |   ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/d99kris/git/nmail/src/crypto.cpp:18:
/usr/include/openssl/sha.h:74:27: note: declared here
   74 | OSSL_DEPRECATEDIN_3_0 int SHA256_Update(SHA256_CTX *c,
      |                           ^~~~~~~~~~~~~
/home/d99kris/git/nmail/src/crypto.cpp:145:15: warning: ‘int SHA256_Final(unsigned char*, SHA256_CTX*)’ is deprecated: Since OpenSSL 3.0 [-Wdeprecated-declarations]
  145 |   SHA256_Final(hash, &sha256);
      |   ~~~~~~~~~~~~^~~~~~~~~~~~~~~
In file included from /home/d99kris/git/nmail/src/crypto.cpp:18:
/usr/include/openssl/sha.h:76:27: note: declared here
   76 | OSSL_DEPRECATEDIN_3_0 int SHA256_Final(unsigned char *md, SHA256_CTX *c);
      |                           ^~~~~~~~~~~~
Originally created by @d99kris on GitHub (Aug 14, 2022). Original GitHub issue: https://github.com/d99kris/nmail/issues/110 Originally assigned to: @d99kris on GitHub. Compilation warnings observed on newer OpenSSL versions, for example in Ubuntu 22.04.1: ``` /home/d99kris/git/nmail/src/crypto.cpp: In static member function ‘static std::string Crypto::SHA256(const string&)’: /home/d99kris/git/nmail/src/crypto.cpp:143:14: warning: ‘int SHA256_Init(SHA256_CTX*)’ is deprecated: Since OpenSSL 3.0 [-Wdeprecated-declarations] 143 | SHA256_Init(&sha256); | ~~~~~~~~~~~^~~~~~~~~ In file included from /home/d99kris/git/nmail/src/crypto.cpp:18: /usr/include/openssl/sha.h:73:27: note: declared here 73 | OSSL_DEPRECATEDIN_3_0 int SHA256_Init(SHA256_CTX *c); | ^~~~~~~~~~~ /home/d99kris/git/nmail/src/crypto.cpp:144:16: warning: ‘int SHA256_Update(SHA256_CTX*, const void*, size_t)’ is deprecated: Since OpenSSL 3.0 [-Wdeprecated-declarations] 144 | SHA256_Update(&sha256, p_Str.c_str(), p_Str.size()); | ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /home/d99kris/git/nmail/src/crypto.cpp:18: /usr/include/openssl/sha.h:74:27: note: declared here 74 | OSSL_DEPRECATEDIN_3_0 int SHA256_Update(SHA256_CTX *c, | ^~~~~~~~~~~~~ /home/d99kris/git/nmail/src/crypto.cpp:145:15: warning: ‘int SHA256_Final(unsigned char*, SHA256_CTX*)’ is deprecated: Since OpenSSL 3.0 [-Wdeprecated-declarations] 145 | SHA256_Final(hash, &sha256); | ~~~~~~~~~~~~^~~~~~~~~~~~~~~ In file included from /home/d99kris/git/nmail/src/crypto.cpp:18: /usr/include/openssl/sha.h:76:27: note: declared here 76 | OSSL_DEPRECATEDIN_3_0 int SHA256_Final(unsigned char *md, SHA256_CTX *c); | ^~~~~~~~~~~~ ```
kerem closed this issue 2026-03-03 01:19:46 +03:00
Sign in to join this conversation.
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/nmail#96
No description provided.