View | Details | Raw Unified | Return to bug 231940 | Differences between
and this patch

Collapse All | Expand All

(-)multimedia/librtmp/Makefile (-3 / +3 lines)
Lines 2-7 Link Here
2
2
3
PORTNAME=	librtmp
3
PORTNAME=	librtmp
4
PORTVERSION=	2.4.20151223
4
PORTVERSION=	2.4.20151223
5
PORTREVISION=	1
5
CATEGORIES=	multimedia net
6
CATEGORIES=	multimedia net
6
MASTER_SITES=	LOCAL/hrs
7
MASTER_SITES=	LOCAL/hrs
7
DISTNAME=	rtmpdump-2.4.fa8646da
8
DISTNAME=	rtmpdump-2.4.fa8646da
Lines 10-21 Link Here
10
COMMENT=	RTMP stream library
11
COMMENT=	RTMP stream library
11
12
12
LICENSE=	GPLv2
13
LICENSE=	GPLv2
14
LICESE_FILE=	${WRKSRC}/COPYING
13
15
14
BROKEN_SSL=	openssl-devel
15
BROKEN_SSL_REASON_openssl-devel=	error: incomplete definition of type 'struct dh_st'
16
17
USES=		pkgconfig tar:bz2 ssl
16
USES=		pkgconfig tar:bz2 ssl
18
USE_LDCONFIG=	yes
17
USE_LDCONFIG=	yes
18
19
CFLAGS+=	-I${OPENSSLINC}
19
CFLAGS+=	-I${OPENSSLINC}
20
LDFLAGS+=	-L${OPENSSLLIB}
20
LDFLAGS+=	-L${OPENSSLLIB}
21
WRKSRC=		${WRKDIR}/${DISTNAME}/librtmp
21
WRKSRC=		${WRKDIR}/${DISTNAME}/librtmp
(-)multimedia/librtmp/files/patch-dh.h (+87 lines)
Line 0 Link Here
1
--- dh.h.orig	2018-10-08 01:20:49 UTC
2
+++ dh.h
3
@@ -250,23 +250,27 @@ DHInit(int nKeyBits)
4
   size_t res;
5
   MDH *dh = MDH_new();
6
 
7
+
8
   if (!dh)
9
     goto failed;
10
 
11
-  MP_new(dh->g);
12
+  const BIGNUM *p;
13
+  const BIGNUM *g;
14
+  DH_get0_pqg(dh,&p,NULL,&g);
15
+  MP_new(g);
16
 
17
-  if (!dh->g)
18
+  if (!g)
19
     goto failed;
20
 
21
-  MP_gethex(dh->p, P1024, res);	/* prime P1024, see dhgroups.h */
22
+  MP_gethex(p, P1024, res);	/* prime P1024, see dhgroups.h */
23
   if (!res)
24
     {
25
       goto failed;
26
     }
27
 
28
-  MP_set_w(dh->g, 2);	/* base 2 */
29
+  MP_set_w(g, 2);	/* base 2 */
30
 
31
-  dh->length = nKeyBits;
32
+  DH_set_length(dh, nKeyBits);
33
   return dh;
34
 
35
 failed:
36
@@ -293,12 +297,15 @@ DHGenerateKey(MDH *dh)
37
       MP_gethex(q1, Q1024, res);
38
       assert(res);
39
 
40
-      res = isValidPublicKey(dh->pub_key, dh->p, q1);
41
+      BIGNUM *pub_key, *priv_key, *p;
42
+      DH_get0_key(dh, &pub_key, &priv_key);
43
+      DH_get0_pqg(dh,&p,NULL,NULL);
44
+      res = isValidPublicKey(pub_key, p, q1);
45
       if (!res)
46
 	{
47
-	  MP_free(dh->pub_key);
48
-	  MP_free(dh->priv_key);
49
-	  dh->pub_key = dh->priv_key = 0;
50
+	  MP_free(pub_key);
51
+	  MP_free(priv_key);
52
+          DH_set0_key(dh, 0, 0);
53
 	}
54
 
55
       MP_free(q1);
56
@@ -314,15 +321,17 @@ static int
57
 DHGetPublicKey(MDH *dh, uint8_t *pubkey, size_t nPubkeyLen)
58
 {
59
   int len;
60
-  if (!dh || !dh->pub_key)
61
+  BIGNUM *pub_key;
62
+  DH_get0_key(dh, &pub_key, NULL);
63
+  if (!dh || !pub_key)
64
     return 0;
65
 
66
-  len = MP_bytes(dh->pub_key);
67
+  len = MP_bytes(pub_key);
68
   if (len <= 0 || len > (int) nPubkeyLen)
69
     return 0;
70
 
71
   memset(pubkey, 0, nPubkeyLen);
72
-  MP_setbin(dh->pub_key, pubkey + (nPubkeyLen - len), len);
73
+  MP_setbin(pub_key, pubkey + (nPubkeyLen - len), len);
74
   return 1;
75
 }
76
 
77
@@ -364,7 +373,9 @@ DHComputeSharedSecretKey(MDH *dh, uint8_t *pubkey, siz
78
   MP_gethex(q1, Q1024, len);
79
   assert(len);
80
 
81
-  if (isValidPublicKey(pubkeyBn, dh->p, q1))
82
+  BIGNUM *p;
83
+  DH_get0_pqg(dh,&p,NULL,NULL);
84
+  if (isValidPublicKey(pubkeyBn, p, q1))
85
     res = MDH_compute_key(secret, nPubkeyLen, pubkeyBn, dh);
86
   else
87
     res = -1;
(-)multimedia/librtmp/files/patch-handshake.h (+33 lines)
Line 0 Link Here
1
--- handshake.h.orig	2018-10-08 01:20:49 UTC
2
+++ handshake.h
3
@@ -69,9 +69,9 @@ typedef struct arcfour_ctx*	RC4_handle;
4
 #if OPENSSL_VERSION_NUMBER < 0x0090800 || !defined(SHA256_DIGEST_LENGTH)
5
 #error Your OpenSSL is too old, need 0.9.8 or newer with SHA256
6
 #endif
7
-#define HMAC_setup(ctx, key, len)	HMAC_CTX_init(&ctx); HMAC_Init_ex(&ctx, key, len, EVP_sha256(), 0)
8
-#define HMAC_crunch(ctx, buf, len)	HMAC_Update(&ctx, buf, len)
9
-#define HMAC_finish(ctx, dig, dlen)	HMAC_Final(&ctx, dig, &dlen); HMAC_CTX_cleanup(&ctx)
10
+#define HMAC_setup(ctx, key, len)	HMAC_Init_ex(ctx, key, len, EVP_sha256(), 0)
11
+#define HMAC_crunch(ctx, buf, len)	HMAC_Update(ctx, buf, len)
12
+#define HMAC_finish(ctx, dig, dlen)	HMAC_Final(ctx, dig, &dlen); HMAC_CTX_free(ctx)
13
 
14
 typedef RC4_KEY *	RC4_handle;
15
 #define RC4_alloc(h)	*h = malloc(sizeof(RC4_KEY))
16
@@ -117,7 +117,7 @@ static void InitRC4Encryption
17
 {
18
   uint8_t digest[SHA256_DIGEST_LENGTH];
19
   unsigned int digestLen = 0;
20
-  HMAC_CTX ctx;
21
+  HMAC_CTX *ctx = HMAC_CTX_new();
22
 
23
   RC4_alloc(rc4keyIn);
24
   RC4_alloc(rc4keyOut);
25
@@ -266,7 +266,7 @@ HMACsha256(const uint8_t *message, size_t messageLen, 
26
 	   size_t keylen, uint8_t *digest)
27
 {
28
   unsigned int digestLen;
29
-  HMAC_CTX ctx;
30
+  HMAC_CTX *ctx = HMAC_CTX_new();
31
 
32
   HMAC_setup(ctx, key, keylen);
33
   HMAC_crunch(ctx, message, messageLen);
(-)multimedia/librtmp/files/patch-hashswf.c (+26 lines)
Line 0 Link Here
1
--- hashswf.c.orig	2018-10-08 01:24:25 UTC
2
+++ hashswf.c
3
@@ -57,10 +57,10 @@
4
 #include <openssl/sha.h>
5
 #include <openssl/hmac.h>
6
 #include <openssl/rc4.h>
7
-#define HMAC_setup(ctx, key, len)	HMAC_CTX_init(&ctx); HMAC_Init_ex(&ctx, (unsigned char *)key, len, EVP_sha256(), 0)
8
-#define HMAC_crunch(ctx, buf, len)	HMAC_Update(&ctx, (unsigned char *)buf, len)
9
-#define HMAC_finish(ctx, dig, dlen)	HMAC_Final(&ctx, (unsigned char *)dig, &dlen);
10
-#define HMAC_close(ctx)	HMAC_CTX_cleanup(&ctx)
11
+#define HMAC_setup(ctx, key, len)	HMAC_Init_ex(ctx, (unsigned char *)key, len, EVP_sha256(), 0)
12
+#define HMAC_crunch(ctx, buf, len)	HMAC_Update(ctx, (unsigned char *)buf, len)
13
+#define HMAC_finish(ctx, dig, dlen)	HMAC_Final(ctx, (unsigned char *)dig, &dlen);
14
+#define HMAC_close(ctx)	HMAC_CTX_free(ctx)
15
 #endif
16
 
17
 extern void RTMP_TLS_Init();
18
@@ -289,7 +289,7 @@ leave:
19
 struct info
20
 {
21
   z_stream *zs;
22
-  HMAC_CTX ctx;
23
+  HMAC_CTX *ctx;
24
   int first;
25
   int zlib;
26
   int size;

Return to bug 231940