Skip to content

Commit 6081818

Browse files
committed
Update functions renamed in recent OpenSSL versions
1 parent 62cdd65 commit 6081818

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/SignatureVerifier_OpenSSL.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,11 @@ verify(basic_Error & e, RSA * rsa, std::string const& message, std::string const
4141

4242
if (rsa == NULL) { e.set(api, Subsystem::SignatureVerifier, RSA_NULL); return; }
4343

44-
EVP_MD_CTX * ctx = EVP_MD_CTX_create();
44+
#if OPENSSL_VERSION_NUMBER < 0x10100000L
45+
ctx = EVP_MD_CTX_create();
46+
#else
47+
ctx = EVP_MD_CTX_new();
48+
#endif
4549
if (ctx == NULL) { e.set(api, Subsystem::SignatureVerifier, CTX_CREATE_FAILED); return; }
4650

4751
EVP_PKEY * pkey = EVP_PKEY_new();
@@ -65,7 +69,11 @@ verify(basic_Error & e, RSA * rsa, std::string const& message, std::string const
6569
EVP_PKEY_free(pkey);
6670

6771
// Void return type
72+
#if OPENSSL_VERSION_NUMBER < 0x10100000L
6873
EVP_MD_CTX_destroy(ctx);
74+
#else
75+
EVP_MD_CTX_free(ctx);
76+
#endif
6977
}
7078

7179
SignatureVerifier_OpenSSL::SignatureVerifier_OpenSSL(basic_Error & e)

0 commit comments

Comments
 (0)