From 56636843aa396c21a7bf16c2bbd2a5b1f230ac60 Mon Sep 17 00:00:00 2001 From: Andrew Pamment Date: Sat, 26 May 2018 12:57:50 +1000 Subject: [PATCH] attempt to fix with openssl < 1.1.0 --- src/users.c | 5 +++++ utils/magiftpd/magiftpd.c | 5 +++++ utils/reset_pass/reset_pass.c | 5 +++++ 3 files changed, 15 insertions(+) diff --git a/src/users.c b/src/users.c index 9619d8a..2cf02a0 100644 --- a/src/users.c +++ b/src/users.c @@ -7,6 +7,11 @@ #include "bbs.h" #include "inih/ini.h" +#if (OPENSSL_VERSION_NUMBER < 0x10100000L) || defined (LIBRESSL_VERSION_NUMBER) +#define EVP_MD_CTX_new EVP_MD_CTX_create +#define EVP_MD_CTX_free EVP_MD_CTX_destroy +#endif + extern struct bbs_config conf; extern struct user_record *gUser; diff --git a/utils/magiftpd/magiftpd.c b/utils/magiftpd/magiftpd.c index 4b90985..4789c4a 100644 --- a/utils/magiftpd/magiftpd.c +++ b/utils/magiftpd/magiftpd.c @@ -19,6 +19,11 @@ #include "magiftpd.h" #include "../../src/inih/ini.h" +#if (OPENSSL_VERSION_NUMBER < 0x10100000L) || defined (LIBRESSL_VERSION_NUMBER) +#define EVP_MD_CTX_new EVP_MD_CTX_create +#define EVP_MD_CTX_free EVP_MD_CTX_destroy +#endif + static struct ftpclient **clients; static int client_count = 0; diff --git a/utils/reset_pass/reset_pass.c b/utils/reset_pass/reset_pass.c index 616f531..50adfde 100644 --- a/utils/reset_pass/reset_pass.c +++ b/utils/reset_pass/reset_pass.c @@ -5,6 +5,11 @@ #include #include +#if (OPENSSL_VERSION_NUMBER < 0x10100000L) || defined (LIBRESSL_VERSION_NUMBER) +#define EVP_MD_CTX_new EVP_MD_CTX_create +#define EVP_MD_CTX_free EVP_MD_CTX_destroy +#endif + char *hash_sha256(char *pass, char *salt) { char *buffer = (char *)malloc(strlen(pass) + strlen(salt) + 1); char *shash = NULL;