d99kris / nmail

Terminal-based email client for Linux and macOS

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Compilation warnings for deprecated SHA256_ functions in OpenSSL 3.0

d99kris opened this issue · comments

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);
      |                           ^~~~~~~~~~~~