Commit 861504d9 authored by Jørgen Lind's avatar Jørgen Lind
Browse files

fix: compilation on RedHat 7

parent e9299428
Pipeline #78776 passed with stages
in 12 minutes and 48 seconds
......@@ -118,7 +118,11 @@ namespace seismicdrive
static std::string SignStringWithPem(std::string const &str, std::string const &pem_contents, JwtSigningAlgorithms alg)
{
std::string msg = "Permanent error in SignStringWithPem (failed to sign string with PEM key): Unable to ";
#if (OPENSSL_VERSION_NUMBER < 0x10100000L) // Older than version 1.1.0
std::unique_ptr<EVP_MD_CTX, decltype(&EVP_MD_CTX_destroy)> digest_ctx(EVP_MD_CTX_create(), &EVP_MD_CTX_destroy);
#else
std::unique_ptr<EVP_MD_CTX, decltype(&EVP_MD_CTX_free)> digest_ctx(EVP_MD_CTX_new(), &EVP_MD_CTX_free);
#endif
if (!digest_ctx)
{
throw error::authprovider::Error(msg + "create context for OpenSSL digest.");
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment