attempt to fix with openssl < 1.1.0

This commit is contained in:
Andrew Pamment
2018-05-26 12:57:50 +10:00
parent cf5fdf93da
commit 56636843aa
3 changed files with 15 additions and 0 deletions

View File

@@ -5,6 +5,11 @@
#include <ctype.h>
#include <openssl/evp.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
char *hash_sha256(char *pass, char *salt) {
char *buffer = (char *)malloc(strlen(pass) + strlen(salt) + 1);
char *shash = NULL;