From 8c3f553579a88170f340744463001cac9cd0505b Mon Sep 17 00:00:00 2001 From: csoler Date: Mon, 20 Feb 2017 22:54:25 +0100 Subject: [PATCH] fixed compilation with openssl1.0.1 broken by previous commits --- libretroshare/src/pqi/authssl.cc | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/libretroshare/src/pqi/authssl.cc b/libretroshare/src/pqi/authssl.cc index bbe99b2a6..b74de49af 100644 --- a/libretroshare/src/pqi/authssl.cc +++ b/libretroshare/src/pqi/authssl.cc @@ -814,15 +814,13 @@ X509 *AuthSSLimpl::SignX509ReqWithGPG(X509_REQ *req, long /*days*/) //EVP_PKEY *pkey = NULL; const EVP_MD *type = EVP_sha1(); - EVP_MD_CTX *ctx = EVP_MD_CTX_new(); + EVP_MD_CTX *ctx = EVP_MD_CTX_create(); unsigned char *p,*buf_in=NULL; unsigned char *buf_hashout=NULL,*buf_sigout=NULL; int inl=0,hashoutl=0; int sigoutl=0; X509_ALGOR *a; - EVP_MD_CTX_init(ctx); - /* FIX ALGORITHMS */ a = const_cast(algor1); @@ -923,7 +921,7 @@ X509 *AuthSSLimpl::SignX509ReqWithGPG(X509_REQ *req, long /*days*/) std::cerr << "Certificate Complete" << std::endl; - EVP_MD_CTX_free(ctx) ; + EVP_MD_CTX_destroy(ctx) ; return x509; @@ -994,7 +992,7 @@ bool AuthSSLimpl::AuthX509WithGPG(X509 *x509,uint32_t& diagnostic) const EVP_MD *type = EVP_sha1(); - EVP_MD_CTX *ctx = EVP_MD_CTX_new(); + EVP_MD_CTX *ctx = EVP_MD_CTX_create(); unsigned char *p,*buf_in=NULL; unsigned char *buf_hashout=NULL,*buf_sigout=NULL; int inl=0,hashoutl=0; @@ -1080,7 +1078,7 @@ bool AuthSSLimpl::AuthX509WithGPG(X509 *x509,uint32_t& diagnostic) #ifdef AUTHSSL_DEBUG std::cerr << "AuthSSLimpl::AuthX509() X509 authenticated" << std::endl; #endif - EVP_MD_CTX_free(ctx) ; + EVP_MD_CTX_destroy(ctx) ; OPENSSL_free(buf_in) ; OPENSSL_free(buf_hashout) ;