From owner-svn-ports-head@freebsd.org Tue Oct 23 15:00:05 2018 Return-Path: Delivered-To: svn-ports-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D2F98FE5BE7; Tue, 23 Oct 2018 15:00:04 +0000 (UTC) (envelope-from antoine.brodin.freebsd@gmail.com) Received: from mail-it1-f196.google.com (mail-it1-f196.google.com [209.85.166.196]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 79747809B0; Tue, 23 Oct 2018 15:00:04 +0000 (UTC) (envelope-from antoine.brodin.freebsd@gmail.com) Received: by mail-it1-f196.google.com with SMTP id c85-v6so2501454itd.1; Tue, 23 Oct 2018 08:00:04 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=aLaQMH8UUYeRevBhLYXmEvCp5hNAEmd1SwtdmcJ3Qkk=; b=ttmEDKgs3gPYQMo4PcfbdUWuUcmEUKdzQVFz3QORaBnNf18SL8mgnGfiRD0fsnBHJU Q0RqX7qITVoyQHegDOM1OJGM/TbIhVG48evkMSgBJfGzHDHHL1Dv5FzfbzECsRyKbkZu TjXvdrXBFHx0SSik6r7Cw5vopazCIimWFSyQPJd+AXkiiRv1b624jzcl9VuiNBgnZiem H+LlDS6aquH+ZCQ8BChLZld4xWLicp8+ZJY3AP9x2BknxwFZIR+cddwb5lnKU58EZlrM EISmnekbj6C6wy9ews9jhKMQ5+QeKqQ7hhJQFKNCyewdUjWxZH8w5yIOamSeMlD7q1nE xe7w== X-Gm-Message-State: ABuFfoh8PPnRzxdYvX/+UCnavf+tWIxDJmCUHcFpV+WKfyfLxosG+9PT mwqet6RqHj4rLJXFYyOP6cmrsv+sQbFjh0lazxJaiA== X-Google-Smtp-Source: ACcGV63G7tbAkOaOmSe2yOndi9qYbb0qEzGUSvuS7z5VtP+Q7OTa1dJd7/k1BeNv1G/RQUkXQfQuHDCBxxD5ywzj+dc= X-Received: by 2002:a24:9790:: with SMTP id k138-v6mr12618198ite.69.1540305330256; Tue, 23 Oct 2018 07:35:30 -0700 (PDT) MIME-Version: 1.0 References: <201810231159.w9NBxHOb080362@repo.freebsd.org> In-Reply-To: <201810231159.w9NBxHOb080362@repo.freebsd.org> From: Antoine Brodin Date: Tue, 23 Oct 2018 16:35:18 +0200 Message-ID: Subject: Re: svn commit: r482833 - in head/multimedia/librtmp: . files To: woodsb02@freebsd.org Cc: ports-committers , svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-ports-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the ports tree for head List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Oct 2018 15:00:05 -0000 Hi, This broke librtmp consumers. Antoine On Tue, Oct 23, 2018 at 1:59 PM Ben Woods wrote: > > Author: woodsb02 > Date: Tue Oct 23 11:59:16 2018 > New Revision: 482833 > URL: https://svnweb.freebsd.org/changeset/ports/482833 > > Log: > multimedia/librtmp: Fix build with OpenSSL 1.1.x > > - Update LICENSE and add LICENSE_FILE > > PR: 231940 > Submitted by: Nathan > Reported by: antoine > Approved by: hrs (maintainer timeout) > Obtained from: https://github.com/JudgeZarbi/RTMPDum-OpenSSL-1.1 > MFH: 2018Q4 > > Added: > head/multimedia/librtmp/files/patch-dh.h (contents, props changed) > head/multimedia/librtmp/files/patch-handshake.h (contents, props changed) > head/multimedia/librtmp/files/patch-hashswf.c (contents, props changed) > Modified: > head/multimedia/librtmp/Makefile > > Modified: head/multimedia/librtmp/Makefile > ============================================================================== > --- head/multimedia/librtmp/Makefile Tue Oct 23 11:48:54 2018 (r482832) > +++ head/multimedia/librtmp/Makefile Tue Oct 23 11:59:16 2018 (r482833) > @@ -2,6 +2,7 @@ > > PORTNAME= librtmp > PORTVERSION= 2.4.20151223 > +PORTREVISION= 1 > CATEGORIES= multimedia net > MASTER_SITES= LOCAL/hrs > DISTNAME= rtmpdump-2.4.fa8646da > @@ -9,13 +10,12 @@ DISTNAME= rtmpdump-2.4.fa8646da > MAINTAINER= hrs@FreeBSD.org > COMMENT= RTMP stream library > > -LICENSE= GPLv2 > +LICENSE= LGPL21+ > +LICENSE_FILE= ${WRKSRC}/COPYING > > -BROKEN_SSL= openssl-devel > -BROKEN_SSL_REASON_openssl-devel= error: incomplete definition of type 'struct dh_st' > - > USES= pkgconfig tar:bz2 ssl > USE_LDCONFIG= yes > + > CFLAGS+= -I${OPENSSLINC} > LDFLAGS+= -L${OPENSSLLIB} > WRKSRC= ${WRKDIR}/${DISTNAME}/librtmp > > Added: head/multimedia/librtmp/files/patch-dh.h > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/multimedia/librtmp/files/patch-dh.h Tue Oct 23 11:59:16 2018 (r482833) > @@ -0,0 +1,83 @@ > +--- dh.h.orig 2016-02-29 01:15:13 UTC > ++++ dh.h > +@@ -253,20 +253,23 @@ DHInit(int nKeyBits) > + if (!dh) > + goto failed; > + > +- MP_new(dh->g); > ++ const BIGNUM *p; > ++ const BIGNUM *g; > ++ DH_get0_pqg(dh,&p,NULL,&g); > ++ MP_new(g); > + > +- if (!dh->g) > ++ if (!g) > + goto failed; > + > +- MP_gethex(dh->p, P1024, res); /* prime P1024, see dhgroups.h */ > ++ MP_gethex(p, P1024, res); /* prime P1024, see dhgroups.h */ > + if (!res) > + { > + goto failed; > + } > + > +- MP_set_w(dh->g, 2); /* base 2 */ > ++ MP_set_w(g, 2); /* base 2 */ > + > +- dh->length = nKeyBits; > ++ DH_set_length(dh, nKeyBits); > + return dh; > + > + failed: > +@@ -293,12 +296,15 @@ DHGenerateKey(MDH *dh) > + MP_gethex(q1, Q1024, res); > + assert(res); > + > +- res = isValidPublicKey(dh->pub_key, dh->p, q1); > ++ BIGNUM *pub_key, *priv_key, *p; > ++ DH_get0_key(dh, &pub_key, &priv_key); > ++ DH_get0_pqg(dh,&p,NULL,NULL); > ++ res = isValidPublicKey(pub_key, p, q1); > + if (!res) > + { > +- MP_free(dh->pub_key); > +- MP_free(dh->priv_key); > +- dh->pub_key = dh->priv_key = 0; > ++ MP_free(pub_key); > ++ MP_free(priv_key); > ++ DH_set0_key(dh, 0, 0); > + } > + > + MP_free(q1); > +@@ -314,15 +320,17 @@ static int > + DHGetPublicKey(MDH *dh, uint8_t *pubkey, size_t nPubkeyLen) > + { > + int len; > +- if (!dh || !dh->pub_key) > ++ BIGNUM *pub_key; > ++ DH_get0_key(dh, &pub_key, NULL); > ++ if (!dh || !pub_key) > + return 0; > + > +- len = MP_bytes(dh->pub_key); > ++ len = MP_bytes(pub_key); > + if (len <= 0 || len > (int) nPubkeyLen) > + return 0; > + > + memset(pubkey, 0, nPubkeyLen); > +- MP_setbin(dh->pub_key, pubkey + (nPubkeyLen - len), len); > ++ MP_setbin(pub_key, pubkey + (nPubkeyLen - len), len); > + return 1; > + } > + > +@@ -364,7 +372,9 @@ DHComputeSharedSecretKey(MDH *dh, uint8_t *pubkey, siz > + MP_gethex(q1, Q1024, len); > + assert(len); > + > +- if (isValidPublicKey(pubkeyBn, dh->p, q1)) > ++ BIGNUM *p; > ++ DH_get0_pqg(dh,&p,NULL,NULL); > ++ if (isValidPublicKey(pubkeyBn, p, q1)) > + res = MDH_compute_key(secret, nPubkeyLen, pubkeyBn, dh); > + else > + res = -1; > > Added: head/multimedia/librtmp/files/patch-handshake.h > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/multimedia/librtmp/files/patch-handshake.h Tue Oct 23 11:59:16 2018 (r482833) > @@ -0,0 +1,33 @@ > +--- handshake.h.orig 2016-02-29 01:15:13 UTC > ++++ handshake.h > +@@ -69,9 +69,9 @@ typedef struct arcfour_ctx* RC4_handle; > + #if OPENSSL_VERSION_NUMBER < 0x0090800 || !defined(SHA256_DIGEST_LENGTH) > + #error Your OpenSSL is too old, need 0.9.8 or newer with SHA256 > + #endif > +-#define HMAC_setup(ctx, key, len) HMAC_CTX_init(&ctx); HMAC_Init_ex(&ctx, key, len, EVP_sha256(), 0) > +-#define HMAC_crunch(ctx, buf, len) HMAC_Update(&ctx, buf, len) > +-#define HMAC_finish(ctx, dig, dlen) HMAC_Final(&ctx, dig, &dlen); HMAC_CTX_cleanup(&ctx) > ++#define HMAC_setup(ctx, key, len) HMAC_Init_ex(ctx, key, len, EVP_sha256(), 0) > ++#define HMAC_crunch(ctx, buf, len) HMAC_Update(ctx, buf, len) > ++#define HMAC_finish(ctx, dig, dlen) HMAC_Final(ctx, dig, &dlen); HMAC_CTX_free(ctx) > + > + typedef RC4_KEY * RC4_handle; > + #define RC4_alloc(h) *h = malloc(sizeof(RC4_KEY)) > +@@ -117,7 +117,7 @@ static void InitRC4Encryption > + { > + uint8_t digest[SHA256_DIGEST_LENGTH]; > + unsigned int digestLen = 0; > +- HMAC_CTX ctx; > ++ HMAC_CTX *ctx = HMAC_CTX_new(); > + > + RC4_alloc(rc4keyIn); > + RC4_alloc(rc4keyOut); > +@@ -266,7 +266,7 @@ HMACsha256(const uint8_t *message, size_t messageLen, > + size_t keylen, uint8_t *digest) > + { > + unsigned int digestLen; > +- HMAC_CTX ctx; > ++ HMAC_CTX *ctx = HMAC_CTX_new(); > + > + HMAC_setup(ctx, key, keylen); > + HMAC_crunch(ctx, message, messageLen); > > Added: head/multimedia/librtmp/files/patch-hashswf.c > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/multimedia/librtmp/files/patch-hashswf.c Tue Oct 23 11:59:16 2018 (r482833) > @@ -0,0 +1,26 @@ > +--- hashswf.c.orig 2016-02-29 01:15:13 UTC > ++++ hashswf.c > +@@ -57,10 +57,10 @@ > + #include > + #include > + #include > +-#define HMAC_setup(ctx, key, len) HMAC_CTX_init(&ctx); HMAC_Init_ex(&ctx, (unsigned char *)key, len, EVP_sha256(), 0) > +-#define HMAC_crunch(ctx, buf, len) HMAC_Update(&ctx, (unsigned char *)buf, len) > +-#define HMAC_finish(ctx, dig, dlen) HMAC_Final(&ctx, (unsigned char *)dig, &dlen); > +-#define HMAC_close(ctx) HMAC_CTX_cleanup(&ctx) > ++#define HMAC_setup(ctx, key, len) HMAC_Init_ex(ctx, (unsigned char *)key, len, EVP_sha256(), 0) > ++#define HMAC_crunch(ctx, buf, len) HMAC_Update(ctx, (unsigned char *)buf, len) > ++#define HMAC_finish(ctx, dig, dlen) HMAC_Final(ctx, (unsigned char *)dig, &dlen); > ++#define HMAC_close(ctx) HMAC_CTX_free(ctx) > + #endif > + > + extern void RTMP_TLS_Init(); > +@@ -289,7 +289,7 @@ leave: > + struct info > + { > + z_stream *zs; > +- HMAC_CTX ctx; > ++ HMAC_CTX *ctx; > + int first; > + int zlib; > + int size; >