vp-build/srcpkgs/spice-gtk/patches/a45e8a56e389e41c891eaa204b1...

59 lines
2.2 KiB
Diff

From a45e8a56e389e41c891eaa204b16dd89e74e2e69 Mon Sep 17 00:00:00 2001
From: Frediano Ziglio <fziglio@redhat.com>
Date: Thu, 21 Jun 2018 06:52:56 +0100
Subject: [PATCH] Fix build for newer LibreSSL
LibreSSL 2.7 hidden some definition, like OpenSSL 1.1.
This fixes https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=229044.
Original patch from Piotr Kubaj.
Reported-by: Jack L. <xxjack12xx@gmail.com>
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Christophe Fergeau <cfergeau@redhat.com>
Upstream: Yes
---
src/bio-gio.c | 3 ++-
src/spice-channel.c | 3 ++-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/bio-gio.c b/src/bio-gio.c
index 30aa73b..79ce7f8 100644
--- a/src/bio-gio.c
+++ b/src/bio-gio.c
@@ -23,7 +23,8 @@
#include "spice-util.h"
#include "bio-gio.h"
-#if OPENSSL_VERSION_NUMBER < 0x10100000 || defined(LIBRESSL_VERSION_NUMBER)
+#if OPENSSL_VERSION_NUMBER < 0x10100000 || \
+ (defined(LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER < 0x20700000)
static BIO_METHOD one_static_bio;
static int BIO_meth_set_read(BIO_METHOD *biom,
diff --git a/src/spice-channel.c b/src/spice-channel.c
index 6f3ca27..55dcd8e 100644
--- a/src/spice-channel.c
+++ b/src/spice-channel.c
@@ -55,7 +55,8 @@ static void spice_channel_reset_capabilities(SpiceChannel *channel);
static void spice_channel_send_migration_handshake(SpiceChannel *channel);
static gboolean channel_connect(SpiceChannel *channel, gboolean tls);
-#if OPENSSL_VERSION_NUMBER < 0x10100000 || defined(LIBRESSL_VERSION_NUMBER)
+#if OPENSSL_VERSION_NUMBER < 0x10100000 || \
+ (defined(LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER < 0x20700000)
static RSA *EVP_PKEY_get0_RSA(EVP_PKEY *pkey)
{
if (pkey->type != EVP_PKEY_RSA) {
--- a/spice-common/common/ssl_verify.c
+++ b/spice-common/common/ssl_verify.c
@@ -33,7 +33,8 @@
#include <string.h>
#include <gio/gio.h>
-#if OPENSSL_VERSION_NUMBER < 0x10100000 || defined (LIBRESSL_VERSION_NUMBER)
+#if OPENSSL_VERSION_NUMBER < 0x10100000 || \
+ (defined (LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER < 0x20700000)
static const unsigned char *ASN1_STRING_get0_data(const ASN1_STRING *asn1)
{
return M_ASN1_STRING_data(asn1);