FreeBSD Bugzilla – Attachment 197892 Details for
Bug 231940
multimedia/librtmp : fails to build with openssl 1.1.1
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Fix openssl 1.1.x build
librtmp (text/plain), 12.83 KB, created by
Nathan
on 2018-10-07 21:48:18 UTC
(
hide
)
Description:
Fix openssl 1.1.x build
Filename:
MIME Type:
Creator:
Nathan
Created:
2018-10-07 21:48:18 UTC
Size:
12.83 KB
patch
obsolete
>multimedia/librtmp: > >* Fix OpenSSL 1.1.x build >* Removed Makefile patches, fails to apply and no longer needed >* Add LICENSE file, while here > >PR: 231940 >Submitted by: Nathan <ndowens@yahoo.com> > >Index: multimedia/librtmp/Makefile >=================================================================== >--- multimedia/librtmp/Makefile (revision 481216) >+++ multimedia/librtmp/Makefile (working copy) >@@ -2,6 +2,7 @@ > > PORTNAME= librtmp > PORTVERSION= 2.4.20151223 >+PORTREVISION= 1 > CATEGORIES= multimedia net > MASTER_SITES= LOCAL/hrs > DISTNAME= rtmpdump-2.4.fa8646da >@@ -10,14 +11,17 @@ > COMMENT= RTMP stream library > > LICENSE= GPLv2 >+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 >+MAKE_ARGS= CC="${CC}" > >+post-install: >+ ${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/librtmp.so.1 >+ > .include <bsd.port.mk> >Index: multimedia/librtmp/files/patch-dh.h >=================================================================== >--- multimedia/librtmp/files/patch-dh.h (nonexistent) >+++ multimedia/librtmp/files/patch-dh.h (working copy) >@@ -0,0 +1,22 @@ >+--- dh.h.orig 2018-10-07 19:38:43 UTC >++++ dh.h >+@@ -42,6 +42,9 @@ typedef mpi * MP_t; >+ #define MP_bytes(u) mpi_size(u) >+ #define MP_setbin(u,buf,len) mpi_write_binary(u,buf,len) >+ #define MP_getbin(u,buf,len) MP_new(u); mpi_read_binary(u,buf,len) >++#if OPENSSL_VERSION_NUMBER > 0x10100000L >++#include <openssl/dh.h> >++#endif >+ >+ typedef struct MDH { >+ MP_t p; >+@@ -245,6 +248,9 @@ failed: >+ } >+ >+ static MDH * >++#if OPENSSL_VERSION_NUMBER > 0x10100000L >++DH *DHInit = DH_new() >++#endif >+ DHInit(int nKeyBits) >+ { >+ size_t res; > >Property changes on: multimedia/librtmp/files/patch-dh.h >___________________________________________________________________ >Added: fbsd:nokeywords >## -0,0 +1 ## >+yes >\ No newline at end of property >Added: svn:eol-style >## -0,0 +1 ## >+native >\ No newline at end of property >Added: svn:mime-type >## -0,0 +1 ## >+text/plain >\ No newline at end of property >Index: multimedia/librtmp/files/patch-handshake.h >=================================================================== >--- multimedia/librtmp/files/patch-handshake.h (nonexistent) >+++ multimedia/librtmp/files/patch-handshake.h (working copy) >@@ -0,0 +1,138 @@ >+--- handshake.h.orig 2016-02-29 01:15:13 UTC >++++ handshake.h >+@@ -31,9 +31,9 @@ >+ #define SHA256_DIGEST_LENGTH 32 >+ #endif >+ #define HMAC_CTX sha2_context >+-#define HMAC_setup(ctx, key, len) sha2_hmac_starts(&ctx, (unsigned char *)key, len, 0) >+-#define HMAC_crunch(ctx, buf, len) sha2_hmac_update(&ctx, buf, len) >+-#define HMAC_finish(ctx, dig, dlen) dlen = SHA256_DIGEST_LENGTH; sha2_hmac_finish(&ctx, dig) >++#define HMAC_setup(ctx, key, len) sha2_hmac_starts(ctx, (unsigned char *)key, len, 0) >++#define HMAC_crunch(ctx, buf, len) sha2_hmac_update(ctx, buf, len) >++#define HMAC_finish(ctx, dig, dlen) dlen = SHA256_DIGEST_LENGTH; sha2_hmac_finish(ctx, dig) >+ >+ typedef arc4_context * RC4_handle; >+ #define RC4_alloc(h) *h = malloc(sizeof(arc4_context)) >+@@ -50,9 +50,9 @@ typedef arc4_context * RC4_handle; >+ #endif >+ #undef HMAC_CTX >+ #define HMAC_CTX struct hmac_sha256_ctx >+-#define HMAC_setup(ctx, key, len) hmac_sha256_set_key(&ctx, len, key) >+-#define HMAC_crunch(ctx, buf, len) hmac_sha256_update(&ctx, len, buf) >+-#define HMAC_finish(ctx, dig, dlen) dlen = SHA256_DIGEST_LENGTH; hmac_sha256_digest(&ctx, SHA256_DIGEST_LENGTH, dig) >++#define HMAC_setup(ctx, key, len) hmac_sha256_set_key(ctx, len, key) >++#define HMAC_crunch(ctx, buf, len) hmac_sha256_update(ctx, len, buf) >++#define HMAC_finish(ctx, dig, dlen) dlen = SHA256_DIGEST_LENGTH; hmac_sha256_digest(ctx, SHA256_DIGEST_LENGTH, dig) >+ #define HMAC_close(ctx) >+ >+ typedef struct arcfour_ctx* RC4_handle; >+@@ -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_CTX_new(); 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) >+ >+ typedef RC4_KEY * RC4_handle; >+ #define RC4_alloc(h) *h = malloc(sizeof(RC4_KEY)) >+@@ -82,8 +82,12 @@ typedef RC4_KEY * RC4_handle; >+ #endif >+ >+ #define FP10 >+- >++#if OPENSSL_VERSION_NUMBER < 0x10100000L >+ #include "dh.h" >++#endif >++#if OPENSSL_VERSION_NUMBER > 0x10100000L >++#include <openssl/dh.h> >++#endif >+ >+ static const uint8_t GenuineFMSKey[] = { >+ 0x47, 0x65, 0x6e, 0x75, 0x69, 0x6e, 0x65, 0x20, 0x41, 0x64, 0x6f, 0x62, >+@@ -117,7 +121,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 +270,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); >+@@ -769,7 +773,7 @@ HandShake(RTMP * r, int FP9HandShake) >+ if (encrypted) >+ { >+ /* generate Diffie-Hellmann parameters */ >+- r->Link.dh = DHInit(1024); >++ r->Link.dh = DH_get_1024_160(); >+ if (!r->Link.dh) >+ { >+ RTMP_Log(RTMP_LOGERROR, "%s: Couldn't initialize Diffie-Hellmann!", >+@@ -780,20 +784,20 @@ HandShake(RTMP * r, int FP9HandShake) >+ dhposClient = getdh(clientsig, RTMP_SIG_SIZE); >+ RTMP_Log(RTMP_LOGDEBUG, "%s: DH pubkey position: %d", __FUNCTION__, dhposClient); >+ >+- if (!DHGenerateKey(r->Link.dh)) >++ if (!DH_generate_key(r->Link.dh)) >+ { >+ RTMP_Log(RTMP_LOGERROR, "%s: Couldn't generate Diffie-Hellmann public key!", >+ __FUNCTION__); >+ return FALSE; >+ } >+- >+- if (!DHGetPublicKey(r->Link.dh, &clientsig[dhposClient], 128)) >++ if (!DHGetPublicKey(r->Link.dh, clientsig[dhposClient], 128)) >+ { >+ RTMP_Log(RTMP_LOGERROR, "%s: Couldn't write public key!", __FUNCTION__); >+ return FALSE; >+ } >+ } >+ >++ >+ digestPosClient = getdig(clientsig, RTMP_SIG_SIZE); /* reuse this value in verification */ >+ RTMP_Log(RTMP_LOGDEBUG, "%s: Client digest offset: %d", __FUNCTION__, >+ digestPosClient); >+@@ -890,8 +894,13 @@ HandShake(RTMP * r, int FP9HandShake) >+ dhposServer = getdh(serversig, RTMP_SIG_SIZE); >+ RTMP_Log(RTMP_LOGDEBUG, "%s: Server DH public key offset: %d", __FUNCTION__, >+ dhposServer); >++#if OPENSSL_VERSION_NUMBER > 0x10100000L >++ len = DH_compute_key(r->Link.dh, &serversig[dhposServer], >++ 128, secretKey); >++#else >+ len = DHComputeSharedSecretKey(r->Link.dh, &serversig[dhposServer], >+ 128, secretKey); >++#endif >+ if (len < 0) >+ { >+ RTMP_Log(RTMP_LOGDEBUG, "%s: Wrong secret key position!", __FUNCTION__); >+@@ -1157,7 +1166,7 @@ SHandShake(RTMP * r) >+ if (encrypted) >+ { >+ /* generate Diffie-Hellmann parameters */ >+- r->Link.dh = DHInit(1024); >++ DH_generate_key(r->Link.dh); >+ if (!r->Link.dh) >+ { >+ RTMP_Log(RTMP_LOGERROR, "%s: Couldn't initialize Diffie-Hellmann!", >+@@ -1168,7 +1177,7 @@ SHandShake(RTMP * r) >+ dhposServer = getdh(serversig, RTMP_SIG_SIZE); >+ RTMP_Log(RTMP_LOGDEBUG, "%s: DH pubkey position: %d", __FUNCTION__, dhposServer); >+ >+- if (!DHGenerateKey(r->Link.dh)) >++ if (!DH_generate_key(r->Link.dh)) >+ { >+ RTMP_Log(RTMP_LOGERROR, "%s: Couldn't generate Diffie-Hellmann public key!", >+ __FUNCTION__); > >Property changes on: multimedia/librtmp/files/patch-handshake.h >___________________________________________________________________ >Added: fbsd:nokeywords >## -0,0 +1 ## >+yes >\ No newline at end of property >Added: svn:eol-style >## -0,0 +1 ## >+native >\ No newline at end of property >Added: svn:mime-type >## -0,0 +1 ## >+text/plain >\ No newline at end of property >Index: multimedia/librtmp/files/patch-hashswf.c >=================================================================== >--- multimedia/librtmp/files/patch-hashswf.c (nonexistent) >+++ multimedia/librtmp/files/patch-hashswf.c (working copy) >@@ -0,0 +1,26 @@ >+--- hashswf.c.orig 2016-02-29 01:15:13 UTC >++++ hashswf.c >+@@ -57,10 +57,10 @@ >+ #include <openssl/sha.h> >+ #include <openssl/hmac.h> >+ #include <openssl/rc4.h> >+-#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_CTX_new(); 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) >+ #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; > >Property changes on: multimedia/librtmp/files/patch-hashswf.c >___________________________________________________________________ >Added: fbsd:nokeywords >## -0,0 +1 ## >+yes >\ No newline at end of property >Added: svn:eol-style >## -0,0 +1 ## >+native >\ No newline at end of property >Added: svn:mime-type >## -0,0 +1 ## >+text/plain >\ No newline at end of property >Index: multimedia/librtmp/files/patch-librtmp-Makefile >=================================================================== >--- multimedia/librtmp/files/patch-librtmp-Makefile (revision 481216) >+++ multimedia/librtmp/files/patch-librtmp-Makefile (nonexistent) >@@ -1,83 +0,0 @@ >---- Makefile.orig 2016-02-29 01:15:13 UTC >-+++ Makefile >-@@ -1,19 +1,21 @@ >- VERSION=v2.4 >- >--prefix=/usr/local >-+prefix=$(PREFIX) >- >- incdir=$(prefix)/include/librtmp >- bindir=$(prefix)/bin >- libdir=$(prefix)/lib >-+libdatadir=$(prefix)/libdata >- mandir=$(prefix)/man >- BINDIR=$(DESTDIR)$(bindir) >- INCDIR=$(DESTDIR)$(incdir) >- LIBDIR=$(DESTDIR)$(libdir) >-+LIBDATADIR=$(DESTDIR)$(libdatadir) >- MANDIR=$(DESTDIR)$(mandir) >- >--CC=$(CROSS_COMPILE)gcc >--LD=$(CROSS_COMPILE)ld >--AR=$(CROSS_COMPILE)ar >-+CC?=$(CROSS_COMPILE)gcc >-+LD?=$(CROSS_COMPILE)ld >-+AR?=$(CROSS_COMPILE)ar >- >- SYS=posix >- CRYPTO=OPENSSL >-@@ -23,14 +25,14 @@ DEF_OPENSSL=-DUSE_OPENSSL >- DEF_GNUTLS=-DUSE_GNUTLS >- DEF_=-DNO_CRYPTO >- REQ_GNUTLS=gnutls,hogweed,nettle >--REQ_OPENSSL=libssl,libcrypto >-+#REQ_OPENSSL=libssl,libcrypto >- PUB_GNUTLS=-lgmp >- LIBZ=-lz >- LIBS_posix= >- LIBS_darwin= >- LIBS_mingw=-lws2_32 -lwinmm -lgdi32 >- LIB_GNUTLS=-lgnutls -lhogweed -lnettle -lgmp $(LIBZ) >--LIB_OPENSSL=-lssl -lcrypto $(LIBZ) >-+LIB_OPENSSL=-L$(OPENSSLLIB) -lssl -lcrypto $(LIBZ) >- LIB_POLARSSL=-lpolarssl $(LIBZ) >- PRIVATE_LIBS=$(LIBS_$(SYS)) >- CRYPTO_LIB=$(LIB_$(CRYPTO)) $(PRIVATE_LIBS) >-@@ -74,8 +76,9 @@ SO_INST=$(SOINST_$(SHARED)) >- >- DEF=-DRTMPDUMP_VERSION=\"$(VERSION)\" $(CRYPTO_DEF) $(XDEF) >- OPT=-O2 >--CFLAGS=-Wall $(XCFLAGS) $(INC) $(DEF) $(OPT) $(SO_DEF) >--LDFLAGS=$(XLDFLAGS) >-+#CFLAGS=-Wall $(XCFLAGS) $(INC) $(DEF) $(OPT) $(SO_DEF) >-+CFLAGS+=$(DEF) $(SO_DEF) >-+#LDFLAGS=$(XLDFLAGS) >- >- >- OBJS=rtmp.o log.o amf.o hashswf.o parseurl.o >-@@ -102,20 +105,22 @@ librtmp.pc: librtmp.pc.in Makefile >- sed -e "s;@prefix@;$(prefix);" -e "s;@libdir@;$(libdir);" \ >- -e "s;@VERSION@;$(VERSION);" \ >- -e "s;@CRYPTO_REQ@;$(CRYPTO_REQ);" \ >-+ -e "s;@OPENSSLLIB@;$(OPENSSLLIB);" \ >-+ -e "s;@OPENSSLINC@;$(OPENSSLINC);" \ >- -e "s;@PUBLIC_LIBS@;$(PUBLIC_LIBS);" \ >- -e "s;@PRIVATE_LIBS@;$(PRIVATE_LIBS);" librtmp.pc.in > $@ >- >- install: install_base $(SO_INST) >- >- install_base: librtmp.a librtmp.pc >-- -mkdir -p $(INCDIR) $(LIBDIR)/pkgconfig $(MANDIR)/man3 $(SODIR) >-+ -mkdir -p $(INCDIR) $(LIBDATADIR)/pkgconfig $(MANDIR)/man3 $(SODIR) >- cp amf.h http.h log.h rtmp.h $(INCDIR) >- cp librtmp.a $(LIBDIR) >-- cp librtmp.pc $(LIBDIR)/pkgconfig >-+ cp librtmp.pc $(LIBDATADIR)/pkgconfig >- cp librtmp.3 $(MANDIR)/man3 >- >- install_so: librtmp$(SO_EXT) >-- cp librtmp$(SO_EXT) $(SODIR) >-+ ${BSD_INSTALL_LIB} librtmp$(SO_EXT) $(SODIR) >- $(INSTALL_IMPLIB) >- cd $(SODIR); ln -sf librtmp$(SO_EXT) librtmp.$(SOX) >- > >Property changes on: multimedia/librtmp/files/patch-librtmp-Makefile >___________________________________________________________________ >Deleted: fbsd:nokeywords >## -1 +0,0 ## >-yes >\ No newline at end of property >Deleted: svn:eol-style >## -1 +0,0 ## >-native >\ No newline at end of property >Deleted: svn:mime-type >## -1 +0,0 ## >-text/plain >\ No newline at end of property
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 231940
:
197892
|
197898
|
197899