From 6d267e72060d21f6b01d18bd0eeb5facc3242b38 Mon Sep 17 00:00:00 2001 From: xiongziliang <771730766@qq.com> Date: Fri, 2 Mar 2018 13:40:17 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84openssl=E7=9A=84=E7=89=88?= =?UTF-8?q?=E6=9C=AC=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Rtmp/RtmpProtocol.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Rtmp/RtmpProtocol.cpp b/src/Rtmp/RtmpProtocol.cpp index d8c6234e..f11474cd 100644 --- a/src/Rtmp/RtmpProtocol.cpp +++ b/src/Rtmp/RtmpProtocol.cpp @@ -34,12 +34,15 @@ using namespace ZL::Util; #ifdef ENABLE_OPENSSL #include "Util/SSLBox.h" #include +#include + static string openssl_HMACsha256(const void *key,unsigned int key_len, const void *data,unsigned int data_len){ std::shared_ptr out(new char[32],[](char *ptr){delete [] ptr;}); unsigned int out_len; -#if defined(WIN32) || defined(ANDROID) +#if defined(OPENSSL_VERSION_NUMBER) && (OPENSSL_VERSION_NUMBER > 0x10100000L) + //openssl 1.1.0新增api,老版本api作废 HMAC_CTX *ctx = HMAC_CTX_new(); HMAC_CTX_reset(ctx); HMAC_Init_ex(ctx, key, key_len, EVP_sha256(), NULL);