diff mbox

[FFmpeg-devel] configure/rtmpdh: Fix OpenSSL 1.1.0 support

Message ID VI1PR0201MB2414D79F942A8CC17CEF1F2BEC500@VI1PR0201MB2414.eurprd02.prod.outlook.com
State Superseded
Headers show

Commit Message

sfan5 Feb. 22, 2017, 3:17 p.m. UTC
1) configure only looks for OPENSSL_init_ssl using pkg-config, this 
breaks in case pkg-config is not available (cross-compiling)


2) The rtmpdh code uses the DH struct from OpenSSL which was made 
private in the 1.1 series

Comments

Ricardo Constantino Feb. 22, 2017, 10:17 p.m. UTC | #1
On 22 February 2017 at 15:17, Stefan _ <sfan5@live.de> wrote:

> 1) configure only looks for OPENSSL_init_ssl using pkg-config, this
> breaks in case pkg-config is not available (cross-compiling)
>
>
> 2) The rtmpdh code uses the DH struct from OpenSSL which was made
> private in the 1.1 series
>
>
Any idea if this works with LibreSSL? They use OPENSSL_VERSION_NUMBER >=
0x1010000fL
but don't necessarily support anything that OpenSSL >1.1.0 does.
diff mbox

Patch

From ee02425f851d0c9cfb8a892f385394efe5b4fdda Mon Sep 17 00:00:00 2001
From: sfan5 <sfan5@live.de>
Date: Wed, 22 Feb 2017 15:38:16 +0100
Subject: [PATCH 2/2] rtmpdh: Support OpenSSL 1.1.0

DH (struct dh_st) was made private in the 1.1 series, a replacement
similar to the FF_DH struct for gcrypt/gmp is used instead.
---
 libavformat/rtmpdh.h | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/libavformat/rtmpdh.h b/libavformat/rtmpdh.h
index 2b250f595d..2d1489b193 100644
--- a/libavformat/rtmpdh.h
+++ b/libavformat/rtmpdh.h
@@ -48,10 +48,19 @@  typedef struct FF_DH {
 #elif CONFIG_OPENSSL
 #include <openssl/bn.h>
 #include <openssl/dh.h>
+#include <openssl/opensslv.h>
 
 typedef BIGNUM *FFBigNum;
+#if OPENSSL_VERSION_NUMBER >= 0x1010000fL
+typedef struct {
+    BIGNUM *p, *g;
+    BIGNUM *pub_key, *priv_key;
+    long length;
+} FF_DH;
+#else
 typedef DH FF_DH;
 #endif
+#endif
 
 /**
  * Initialize a Diffie-Hellmann context.
-- 
2.11.1