FreeBSD Bugzilla – Attachment 202872 Details for
Bug 232901
multimedia/librtmp: OpenSSL 1.1.x patch (r482967) causes segfault
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
librtmp openssl 1.1.x patch
librtmp-openssl111.20190315-1.diff (text/plain), 22.36 KB, created by
Hiroki Sato
on 2019-03-15 05:50:42 UTC
(
hide
)
Description:
librtmp openssl 1.1.x patch
Filename:
MIME Type:
Creator:
Hiroki Sato
Created:
2019-03-15 05:50:42 UTC
Size:
22.36 KB
patch
obsolete
>Index: multimedia/librtmp/Makefile >=================================================================== >--- multimedia/librtmp/Makefile (revision 495437) >+++ multimedia/librtmp/Makefile (working copy) >@@ -2,7 +2,7 @@ > > PORTNAME= librtmp > PORTVERSION= 2.4.20151223 >-PORTREVISION= 3 >+PORTREVISION= 4 > CATEGORIES= multimedia net > MASTER_SITES= LOCAL/hrs > DISTNAME= rtmpdump-2.4.fa8646da >@@ -18,6 +18,7 @@ > > CFLAGS+= -I${OPENSSLINC} > LDFLAGS+= -L${OPENSSLLIB} >-WRKSRC= ${WRKDIR}/${DISTNAME}/librtmp >+PATCH_WRKSRC= ${WRKDIR}/${DISTNAME} >+WRKSRC= ${WRKDIR}/${DISTNAME}/librtmp > > .include <bsd.port.mk> >Index: multimedia/librtmp/files/patch-librtmp-Makefile >=================================================================== >--- multimedia/librtmp/files/patch-librtmp-Makefile (revision 495437) >+++ multimedia/librtmp/files/patch-librtmp-Makefile (working copy) >@@ -1,5 +1,5 @@ >---- Makefile.orig 2016-02-29 01:15:13 UTC >-+++ Makefile >+--- librtmp/Makefile.orig 2016-02-29 01:15:13 UTC >++++ librtmp/Makefile > @@ -1,19 +1,21 @@ > VERSION=v2.4 > >Index: multimedia/librtmp/files/patch-librtmp-dh.h >=================================================================== >--- multimedia/librtmp/files/patch-librtmp-dh.h (nonexistent) >+++ multimedia/librtmp/files/patch-librtmp-dh.h (working copy) >@@ -0,0 +1,116 @@ >+--- librtmp/dh.h.orig 2016-02-29 01:15:13 UTC >++++ librtmp/dh.h >+@@ -194,7 +194,7 @@ typedef BIGNUM * MP_t; >+ >+ /* RFC 2631, Section 2.1.5, http://www.ietf.org/rfc/rfc2631.txt */ >+ static int >+-isValidPublicKey(MP_t y, MP_t p, MP_t q) >++isValidPublicKey(const MP_t y, const MP_t p, const MP_t q) >+ { >+ int ret = TRUE; >+ MP_t bn; >+@@ -253,20 +253,43 @@ DHInit(int nKeyBits) >+ if (!dh) >+ goto failed; >+ >++#if !defined(USE_OPENSSL) || !defined(OPENSSL_VERSION_NUMBER) || OPENSSL_VERSION_NUMBER < 0x10100000L >+ MP_new(dh->g); >+ >+ if (!dh->g) >+ goto failed; >++#else >++ BIGNUM *g; >+ >++ MP_new(g); >++ if (g == NULL) >++ goto failed; >++#endif >++ >++#if !defined(USE_OPENSSL) || !defined(OPENSSL_VERSION_NUMBER) || OPENSSL_VERSION_NUMBER < 0x10100000L >+ MP_gethex(dh->p, P1024, res); /* prime P1024, see dhgroups.h */ >++#else >++ const BIGNUM *p = DH_get0_p(dh); >++ >++ MP_gethex(p, P1024, res); /* prime P1024, see dhgroups.h */ >++#endif >+ if (!res) >+ { >+ goto failed; >+ } >+ >++#if !defined(USE_OPENSSL) || !defined(OPENSSL_VERSION_NUMBER) || OPENSSL_VERSION_NUMBER < 0x10100000L >+ MP_set_w(dh->g, 2); /* base 2 */ >++#else >++ MP_set_w(g, 2); /* base 2 */ >++ DH_set0_pqg(dh, p, NULL, g); >++#endif >+ >++#if !defined(USE_OPENSSL) || !defined(OPENSSL_VERSION_NUMBER) || OPENSSL_VERSION_NUMBER < 0x10100000L >+ dh->length = nKeyBits; >++#else >++ DH_set_length(dh, nKeyBits); >++#endif >+ return dh; >+ >+ failed: >+@@ -293,12 +316,20 @@ DHGenerateKey(MDH *dh) >+ MP_gethex(q1, Q1024, res); >+ assert(res); >+ >++#if !defined(USE_OPENSSL) || !defined(OPENSSL_VERSION_NUMBER) || OPENSSL_VERSION_NUMBER < 0x10100000L >+ res = isValidPublicKey(dh->pub_key, dh->p, q1); >++#else >++ res = isValidPublicKey(DH_get0_pub_key(dh), DH_get0_p(dh), q1); >++#endif >+ if (!res) >+ { >++#if !defined(USE_OPENSSL) || !defined(OPENSSL_VERSION_NUMBER) || OPENSSL_VERSION_NUMBER < 0x10100000L >+ MP_free(dh->pub_key); >+ MP_free(dh->priv_key); >+ dh->pub_key = dh->priv_key = 0; >++#else >++ DH_set0_key(dh, NULL, NULL); >++#endif >+ } >+ >+ MP_free(q1); >+@@ -314,15 +345,27 @@ static int >+ DHGetPublicKey(MDH *dh, uint8_t *pubkey, size_t nPubkeyLen) >+ { >+ int len; >++#if !defined(USE_OPENSSL) || !defined(OPENSSL_VERSION_NUMBER) || OPENSSL_VERSION_NUMBER < 0x10100000L >+ if (!dh || !dh->pub_key) >++#else >++ if (!dh || !DH_get0_pub_key(dh)) >+ return 0; >++#endif >+ >++#if !defined(USE_OPENSSL) || !defined(OPENSSL_VERSION_NUMBER) || OPENSSL_VERSION_NUMBER < 0x10100000L >+ len = MP_bytes(dh->pub_key); >++#else >++ len = MP_bytes(DH_get0_pub_key(dh)); >++#endif >+ if (len <= 0 || len > (int) nPubkeyLen) >+ return 0; >+ >+ memset(pubkey, 0, nPubkeyLen); >++#if !defined(USE_OPENSSL) || !defined(OPENSSL_VERSION_NUMBER) || OPENSSL_VERSION_NUMBER < 0x10100000L >+ MP_setbin(dh->pub_key, pubkey + (nPubkeyLen - len), len); >++#else >++ MP_setbin(DH_get0_pub_key(dh), pubkey + (nPubkeyLen - len), len); >++#endif >+ return 1; >+ } >+ >+@@ -364,7 +407,11 @@ DHComputeSharedSecretKey(MDH *dh, uint8_t *pubkey, siz >+ MP_gethex(q1, Q1024, len); >+ assert(len); >+ >++#if !defined(USE_OPENSSL) || !defined(OPENSSL_VERSION_NUMBER) || OPENSSL_VERSION_NUMBER < 0x10100000L >+ if (isValidPublicKey(pubkeyBn, dh->p, q1)) >++#else >++ if (isValidPublicKey(pubkeyBn, DH_get0_p(dh), q1)) >++#endif >+ res = MDH_compute_key(secret, nPubkeyLen, pubkeyBn, dh); >+ else >+ res = -1; > >Property changes on: multimedia/librtmp/files/patch-librtmp-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-librtmp-handshake.h >=================================================================== >--- multimedia/librtmp/files/patch-librtmp-handshake.h (nonexistent) >+++ multimedia/librtmp/files/patch-librtmp-handshake.h (working copy) >@@ -0,0 +1,73 @@ >+--- librtmp/handshake.h.orig 2016-02-29 01:15:13 UTC >++++ librtmp/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,23 @@ 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) >++#if OPENSSL_VERSION_NUMBER < 0x10100000L >++#define HMAC_setup(ctx, key, len) HMAC_CTX_init(ctx); HMAC_Init_ex(ctx, key, len, EVP_sha256(), 0) >++#else >++#define HMAC_setup(ctx, key, len) do { \ >++ if (ctx == NULL) \ >++ ctx = HMAC_CTX_new(); \ >++ else \ >++ HMAC_CTX_reset(ctx); \ >++ HMAC_Init_ex(ctx, key, len, EVP_sha256(), 0); \ >++ } while (0) >++#endif >++#define HMAC_crunch(ctx, buf, len) HMAC_Update(ctx, buf, len) >++#if OPENSSL_VERSION_NUMBER < 0x10100000L >++#define HMAC_finish(ctx, dig, dlen) HMAC_Final(ctx, dig, &dlen); HMAC_CTX_cleanup(ctx) >++#else >++#define HMAC_finish(ctx, dig, dlen) HMAC_Final(ctx, dig, &dlen); HMAC_CTX_free(ctx); ctx = NULL >++#endif >+ >+ typedef RC4_KEY * RC4_handle; >+ #define RC4_alloc(h) *h = malloc(sizeof(RC4_KEY)) >+@@ -117,7 +131,7 @@ static void InitRC4Encryption >+ { >+ uint8_t digest[SHA256_DIGEST_LENGTH]; >+ unsigned int digestLen = 0; >+- HMAC_CTX ctx; >++ HMAC_CTX *ctx = NULL; >+ >+ RC4_alloc(rc4keyIn); >+ RC4_alloc(rc4keyOut); >+@@ -266,7 +280,7 @@ HMACsha256(const uint8_t *message, size_t messageLen, >+ size_t keylen, uint8_t *digest) >+ { >+ unsigned int digestLen; >+- HMAC_CTX ctx; >++ HMAC_CTX *ctx = NULL; >+ >+ HMAC_setup(ctx, key, keylen); >+ HMAC_crunch(ctx, message, messageLen); > >Property changes on: multimedia/librtmp/files/patch-librtmp-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-librtmp-hashswf.c >=================================================================== >--- multimedia/librtmp/files/patch-librtmp-hashswf.c (nonexistent) >+++ multimedia/librtmp/files/patch-librtmp-hashswf.c (working copy) >@@ -0,0 +1,60 @@ >+--- librtmp/hashswf.c.orig 2016-02-29 01:15:13 UTC >++++ librtmp/hashswf.c >+@@ -37,9 +37,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) >+ #define HMAC_close(ctx) >+ #elif defined(USE_GNUTLS) >+ #include <nettle/hmac.h> >+@@ -48,20 +48,28 @@ >+ #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) >+ #else /* USE_OPENSSL */ >+ #include <openssl/ssl.h> >+ #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) >++#if OPENSSL_VERSION_NUMBER < 0x10100000L >++#define HMAC_setup(ctx, key, len) HMAC_CTX_init(ctx); HMAC_Init_ex(ctx, (unsigned char *)key, len, EVP_sha256(), 0) >++#else >++#define HMAC_setup(ctx, key, len) ctx = HMAC_CTX_new(); HMAC_Init_ex(ctx, (unsigned char *)key, len, EVP_sha256(), 0) >+ #endif >++#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); >++#if OPENSSL_VERSION_NUMBER < 0x10100000L >++#define HMAC_close(ctx) HMAC_CTX_cleanup(ctx) >++#else >++#define HMAC_close(ctx) HMAC_CTX_reset(ctx); HMAC_CTX_free(ctx) >++#endif >++#endif >+ >+ extern void RTMP_TLS_Init(); >+ extern TLS_CTX RTMP_TLS_ctx; >+@@ -289,7 +297,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-librtmp-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-librtmp.pc.in >=================================================================== >--- multimedia/librtmp/files/patch-librtmp-librtmp.pc.in (revision 495437) >+++ multimedia/librtmp/files/patch-librtmp-librtmp.pc.in (working copy) >@@ -1,5 +1,5 @@ >---- librtmp.pc.in.orig 2016-02-29 01:15:13 UTC >-+++ librtmp.pc.in >+--- librtmp/librtmp.pc.in.orig 2016-02-29 01:15:13 UTC >++++ librtmp/librtmp.pc.in > @@ -8,6 +8,6 @@ Description: RTMP implementation > Version: @VERSION@ > Requires: @CRYPTO_REQ@ >Index: multimedia/librtmp/files/patch-openssl-1.1 >=================================================================== >--- multimedia/librtmp/files/patch-openssl-1.1 (revision 495437) >+++ multimedia/librtmp/files/patch-openssl-1.1 (nonexistent) >@@ -1,249 +0,0 @@ >---- dh.h.orig 2016-02-29 01:15:13 UTC >-+++ dh.h >-@@ -253,20 +253,44 @@ DHInit(int nKeyBits) >- if (!dh) >- goto failed; >- >-+#if !defined(USE_OPENSSL) || !defined(OPENSSL_VERSION_NUMBER) || OPENSSL_VERSION_NUMBER < 0x10100000L >- MP_new(dh->g); >- >- if (!dh->g) >- goto failed; >-+#else >-+ BIGNUM *g = NULL; >-+ MP_new(g); >-+ if (!g) >-+ goto failed; >- >-+ DH_set0_pqg(dh, NULL, g, NULL); >-+#endif >-+ >-+#if !defined(USE_OPENSSL) || !defined(OPENSSL_VERSION_NUMBER) || OPENSSL_VERSION_NUMBER < 0x10100000L >- MP_gethex(dh->p, P1024, res); /* prime P1024, see dhgroups.h */ >-+#else >-+ BIGNUM* p = NULL; >-+ DH_get0_pqg(dh, (BIGNUM const**)&p, NULL, NULL); >-+ MP_gethex(p, P1024, res); /* prime P1024, see dhgroups.h */ >-+#endif >- if (!res) >- { >- goto failed; >- } >- >-+#if !defined(USE_OPENSSL) || !defined(OPENSSL_VERSION_NUMBER) || OPENSSL_VERSION_NUMBER < 0x10100000L >- MP_set_w(dh->g, 2); /* base 2 */ >-+#else >-+ MP_set_w(g, 2); /* base 2 */ >-+ DH_set0_pqg(dh, NULL, g, NULL); >-+#endif >- >-+#if !defined(USE_OPENSSL) || !defined(OPENSSL_VERSION_NUMBER) || OPENSSL_VERSION_NUMBER < 0x10100000L >- dh->length = nKeyBits; >-+#else >-+ DH_set_length(dh, nKeyBits); >-+#endif >- return dh; >- >- failed: >-@@ -293,12 +317,24 @@ DHGenerateKey(MDH *dh) >- MP_gethex(q1, Q1024, res); >- assert(res); >- >-+#if !defined(USE_OPENSSL) || !defined(OPENSSL_VERSION_NUMBER) || OPENSSL_VERSION_NUMBER < 0x10100000L >- res = isValidPublicKey(dh->pub_key, dh->p, q1); >-+#else >-+ BIGNUM const* pub_key = NULL; >-+ BIGNUM const* p = NULL; >-+ DH_get0_key(dh, &pub_key, NULL); >-+ DH_get0_pqg(dh, &p, NULL, NULL); >-+ res = isValidPublicKey((BIGNUM*)pub_key, (BIGNUM*)p, q1); >-+#endif >- if (!res) >- { >-+#if !defined(USE_OPENSSL) || !defined(OPENSSL_VERSION_NUMBER) || OPENSSL_VERSION_NUMBER < 0x10100000L >- MP_free(dh->pub_key); >- MP_free(dh->priv_key); >- dh->pub_key = dh->priv_key = 0; >-+#else >-+ DH_free(dh); >-+#endif >- } >- >- MP_free(q1); >-@@ -314,15 +350,29 @@ static int >- DHGetPublicKey(MDH *dh, uint8_t *pubkey, size_t nPubkeyLen) >- { >- int len; >-+#if !defined(USE_OPENSSL) || !defined(OPENSSL_VERSION_NUMBER) || OPENSSL_VERSION_NUMBER < 0x10100000L >- if (!dh || !dh->pub_key) >-+#else >-+ BIGNUM const* pub_key = NULL; >-+ DH_get0_key(dh, &pub_key, NULL); >-+ if (!dh || !pub_key) >-+#endif >- return 0; >- >-+#if !defined(USE_OPENSSL) || !defined(OPENSSL_VERSION_NUMBER) || OPENSSL_VERSION_NUMBER < 0x10100000L >- len = MP_bytes(dh->pub_key); >-+#else >-+ len = MP_bytes(pub_key); >-+#endif >- if (len <= 0 || len > (int) nPubkeyLen) >- return 0; >- >- memset(pubkey, 0, nPubkeyLen); >-+#if !defined(USE_OPENSSL) || !defined(OPENSSL_VERSION_NUMBER) || OPENSSL_VERSION_NUMBER < 0x10100000L >- MP_setbin(dh->pub_key, pubkey + (nPubkeyLen - len), len); >-+#else >-+ MP_setbin(pub_key, pubkey + (nPubkeyLen - len), len); >-+#endif >- return 1; >- } >- >-@@ -364,7 +414,13 @@ DHComputeSharedSecretKey(MDH *dh, uint8_t *pubkey, siz >- MP_gethex(q1, Q1024, len); >- assert(len); >- >-+#if !defined(USE_OPENSSL) || !defined(OPENSSL_VERSION_NUMBER) || OPENSSL_VERSION_NUMBER < 0x10100000L >- if (isValidPublicKey(pubkeyBn, dh->p, q1)) >-+#else >-+ BIGNUM const* p = NULL; >-+ DH_get0_pqg(dh, &p, NULL, NULL); >-+ if (isValidPublicKey(pubkeyBn, (BIGNUM*)p, q1)) >-+#endif >- res = MDH_compute_key(secret, nPubkeyLen, pubkeyBn, dh); >- else >- res = -1; >---- 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; >-@@ -64,14 +64,23 @@ typedef struct arcfour_ctx* RC4_handle; >- >- #else /* USE_OPENSSL */ >- #include <openssl/sha.h> >-+#include <openssl/ossl_typ.h> >- #include <openssl/hmac.h> >- #include <openssl/rc4.h> >- #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) >-+#if OPENSSL_VERSION_NUMBER < 0x10100000L >-+#define HMAC_setup(ctx, key, len) HMAC_CTX_init(ctx); HMAC_Init_ex(ctx, key, len, EVP_sha256(), 0) >-+#else >-+#define HMAC_setup(ctx, key, len) HMAC_CTX_reset(ctx); HMAC_Init_ex(ctx, key, len, EVP_sha256(), 0) >-+#endif >-+#define HMAC_crunch(ctx, buf, len) HMAC_Update(ctx, buf, len) >-+#if OPENSSL_VERSION_NUMBER < 0x10100000L >-+#define HMAC_finish(ctx, dig, dlen) HMAC_Final(ctx, dig, &dlen); HMAC_CTX_cleanup(ctx) >-+#else >-+#define HMAC_finish(ctx, dig, dlen) HMAC_Final(ctx, dig, &dlen); HMAC_CTX_free(ctx) >-+#endif >- >- typedef RC4_KEY * RC4_handle; >- #define RC4_alloc(h) *h = malloc(sizeof(RC4_KEY)) >-@@ -117,7 +126,7 @@ static void InitRC4Encryption >- { >- uint8_t digest[SHA256_DIGEST_LENGTH]; >- unsigned int digestLen = 0; >-- HMAC_CTX ctx; >-+ HMAC_CTX* ctx = NULL; >- >- RC4_alloc(rc4keyIn); >- RC4_alloc(rc4keyOut); >-@@ -266,7 +275,7 @@ HMACsha256(const uint8_t *message, size_t messageLen, >- size_t keylen, uint8_t *digest) >- { >- unsigned int digestLen; >-- HMAC_CTX ctx; >-+ HMAC_CTX* ctx = NULL; >- >- HMAC_setup(ctx, key, keylen); >- HMAC_crunch(ctx, message, messageLen); >---- hashswf.c.orig 2016-02-29 01:15:13 UTC >-+++ hashswf.c >-@@ -37,9 +37,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) >- #define HMAC_close(ctx) >- #elif defined(USE_GNUTLS) >- #include <nettle/hmac.h> >-@@ -48,20 +48,28 @@ >- #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) >- #else /* USE_OPENSSL */ >- #include <openssl/ssl.h> >- #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) >-+#if OPENSSL_VERSION_NUMBER < 0x10100000L >-+#define HMAC_setup(ctx, key, len) HMAC_CTX_init(ctx); HMAC_Init_ex(ctx, (unsigned char *)key, len, EVP_sha256(), 0) >-+#else >-+#define HMAC_setup(ctx, key, len) HMAC_CTX_reset(ctx); HMAC_Init_ex(ctx, (unsigned char *)key, len, EVP_sha256(), 0) >- #endif >-+#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); >-+#if OPENSSL_VERSION_NUMBER < 0x10100000L >-+#define HMAC_close(ctx) HMAC_CTX_cleanup(ctx) >-+#else >-+#define HMAC_close(ctx) HMAC_CTX_reset(ctx); HMAC_CTX_free(ctx) >-+#endif >-+#endif >- >- extern void RTMP_TLS_Init(); >- extern TLS_CTX RTMP_TLS_ctx; >-@@ -289,7 +297,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-openssl-1.1 >___________________________________________________________________ >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 232901
:
199920
|
202807
| 202872