Skip to content
Snippets Groups Projects
Commit abe3015f authored by Nicolas Werner's avatar Nicolas Werner
Browse files

Use older context functions for OpenSSL < 1.1

parent cd49be7d
No related branches found
No related tags found
No related merge requests found
......@@ -141,7 +141,11 @@ sha256(const std::string &data)
bool success = false;
std::string hashed;
#if OPENSSL_VERSION_NUMBER < 0x10100000L
EVP_MD_CTX *context = EVP_MD_CTX_create();
#else
EVP_MD_CTX *context = EVP_MD_CTX_new();
#endif
if (context != NULL) {
if (EVP_DigestInit_ex(context, EVP_sha256(), NULL)) {
......@@ -156,7 +160,11 @@ sha256(const std::string &data)
}
}
#if OPENSSL_VERSION_NUMBER < 0x10100000L
EVP_MD_CTX_destroy(context);
#else
EVP_MD_CTX_free(context);
#endif
}
if (success)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment