From 6e64669af3dad1569b5768d8cc5a79a7219cbe5b Mon Sep 17 00:00:00 2001 From: "Ruben S. Montero" Date: Thu, 4 May 2017 16:23:44 +0200 Subject: [PATCH] Add support for libreSSL --- src/common/NebulaUtil.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/common/NebulaUtil.cc b/src/common/NebulaUtil.cc index 1b65e004ec..54bd6190ee 100644 --- a/src/common/NebulaUtil.cc +++ b/src/common/NebulaUtil.cc @@ -162,7 +162,7 @@ string one_util::sha1_digest(const string& in) unsigned int md_len; ostringstream oss; -#if OPENSSL_VERSION_NUMBER < 0x10100000L +#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER) mdctx = (EVP_MD_CTX*) malloc(sizeof(EVP_MD_CTX)); EVP_MD_CTX_init(mdctx); #else @@ -175,7 +175,7 @@ string one_util::sha1_digest(const string& in) EVP_DigestFinal_ex(mdctx,md_value, &md_len); -#if OPENSSL_VERSION_NUMBER < 0x10100000L +#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER) EVP_MD_CTX_cleanup(mdctx); free(mdctx); #else @@ -205,7 +205,7 @@ string * one_util::aes256cbc_encrypt(const string& in, const string password) int outlen1, outlen2; -#if OPENSSL_VERSION_NUMBER < 0x10100000L +#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER) ctx = (EVP_CIPHER_CTX*) malloc(sizeof(EVP_CIPHER_CTX)); EVP_CIPHER_CTX_init(ctx); #else @@ -216,7 +216,7 @@ string * one_util::aes256cbc_encrypt(const string& in, const string password) EVP_EncryptUpdate(ctx, out, &outlen1, in_data, in.length()); EVP_EncryptFinal(ctx, out + outlen1, &outlen2); -#if OPENSSL_VERSION_NUMBER < 0x10100000L +#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER) EVP_CIPHER_CTX_cleanup(ctx); free(ctx); #else