mirror of
https://github.com/openembedded/meta-openembedded.git
synced 2026-07-17 04:37:19 +00:00
librtmp: add a patch to fix build with nettle-4
This was taken from Archlinux: https://gitlab.archlinux.org/archlinux/packaging/packages/rtmpdump/-/blob/main/nettle-4.patch Signed-off-by: Markus Volk <f_l_k@t-online.de> Signed-off-by: Khem Raj <khem.raj@oss.qualcomm.com>
This commit is contained in:
@@ -0,0 +1,78 @@
|
||||
This patch was taken from Archlinux
|
||||
|
||||
Upstream-Status: Inappropriate [https://gitlab.archlinux.org/archlinux/packaging/packages/rtmpdump/-/blob/main/nettle-4.patch]
|
||||
|
||||
Signed-off-by: Markus Volk <f_l_k@t-online.de>
|
||||
|
||||
diff --git a/librtmp/handshake.h b/librtmp/handshake.h
|
||||
index ac38c88..53301c7 100644
|
||||
--- a/librtmp/handshake.h
|
||||
+++ b/librtmp/handshake.h
|
||||
@@ -45,6 +45,7 @@ typedef arc4_context * RC4_handle;
|
||||
#elif defined(USE_GNUTLS)
|
||||
#include <nettle/hmac.h>
|
||||
#include <nettle/arcfour.h>
|
||||
+#include <nettle/version.h>
|
||||
#ifndef SHA256_DIGEST_LENGTH
|
||||
#define SHA256_DIGEST_LENGTH 32
|
||||
#endif
|
||||
@@ -52,7 +53,11 @@ typedef arc4_context * RC4_handle;
|
||||
#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)
|
||||
+#if NETTLE_VERSION_MAJOR > 3
|
||||
+#define HMAC_finish(ctx, dig, dlen) dlen = SHA256_DIGEST_LENGTH; hmac_sha256_digest(&ctx, dig)
|
||||
+#else
|
||||
#define HMAC_finish(ctx, dig, dlen) dlen = SHA256_DIGEST_LENGTH; hmac_sha256_digest(&ctx, SHA256_DIGEST_LENGTH, dig)
|
||||
+#endif
|
||||
#define HMAC_close(ctx)
|
||||
|
||||
typedef struct arcfour_ctx* RC4_handle;
|
||||
diff --git a/librtmp/hashswf.c b/librtmp/hashswf.c
|
||||
index fc5f824..3ab1d3f 100644
|
||||
--- a/librtmp/hashswf.c
|
||||
+++ b/librtmp/hashswf.c
|
||||
@@ -44,6 +44,7 @@
|
||||
#define HMAC_close(ctx)
|
||||
#elif defined(USE_GNUTLS)
|
||||
#include <nettle/hmac.h>
|
||||
+#include <nettle/version.h>
|
||||
#ifndef SHA256_DIGEST_LENGTH
|
||||
#define SHA256_DIGEST_LENGTH 32
|
||||
#endif
|
||||
@@ -51,7 +52,11 @@
|
||||
#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)
|
||||
+#if NETTLE_VERSION_MAJOR > 3
|
||||
+#define HMAC_finish(ctx, dig, dlen) dlen = SHA256_DIGEST_LENGTH; hmac_sha256_digest(&ctx, dig)
|
||||
+#else
|
||||
#define HMAC_finish(ctx, dig, dlen) dlen = SHA256_DIGEST_LENGTH; hmac_sha256_digest(&ctx, SHA256_DIGEST_LENGTH, dig)
|
||||
+#endif
|
||||
#define HMAC_close(ctx)
|
||||
#else /* USE_OPENSSL */
|
||||
#include <openssl/ssl.h>
|
||||
diff --git a/librtmp/rtmp.c b/librtmp/rtmp.c
|
||||
index cf1de70..a53ed9f 100644
|
||||
--- a/librtmp/rtmp.c
|
||||
+++ b/librtmp/rtmp.c
|
||||
@@ -57,6 +57,7 @@ static const char *my_dhm_G = "4";
|
||||
#define MD5_DIGEST_LENGTH 16
|
||||
#include <nettle/base64.h>
|
||||
#include <nettle/md5.h>
|
||||
+#include <nettle/version.h>
|
||||
#else /* USE_OPENSSL */
|
||||
#include <openssl/ssl.h>
|
||||
#include <openssl/rc4.h>
|
||||
@@ -2492,7 +2493,11 @@ b64enc(const unsigned char *input, int length, char *output, int maxsize)
|
||||
typedef struct md5_ctx MD5_CTX;
|
||||
#define MD5_Init(ctx) md5_init(ctx)
|
||||
#define MD5_Update(ctx,data,len) md5_update(ctx,len,data)
|
||||
+#if NETTLE_VERSION_MAJOR > 3
|
||||
+#define MD5_Final(dig,ctx) md5_digest(ctx,dig)
|
||||
+#else
|
||||
#define MD5_Final(dig,ctx) md5_digest(ctx,MD5_DIGEST_LENGTH,dig)
|
||||
+#endif
|
||||
#else
|
||||
#endif
|
||||
|
||||
@@ -11,6 +11,7 @@ PV .= "+git"
|
||||
SRCREV = "6f6bb1353fc84f4cc37138baa99f586750028a01"
|
||||
SRC_URI = " \
|
||||
git://git.ffmpeg.org/rtmpdump;branch=master \
|
||||
file://nettle-4.patch \
|
||||
"
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user