app-crypt/efitools: add compatibility patch for LibreSSL
authorAaron Bauman <bman@gentoo.org>
Mon, 23 Apr 2018 17:29:24 +0000 (13:29 -0400)
committerAaron Bauman <bman@gentoo.org>
Mon, 23 Apr 2018 17:29:37 +0000 (13:29 -0400)
This patch fixes building with LibreSSL due to a conditional function
for API.

Closes: https://bugs.gentoo.org/653716
Package-Manager: Portage-2.3.31, Repoman-2.3.9

app-crypt/efitools/efitools-1.8.1.ebuild
app-crypt/efitools/files/efitools-1.8.1-libressl-compatibility.patch [new file with mode: 0644]

index 073dcca2de89dca0d352cd73e987c5fed5ae5877..f18e8b8ea2711ea03d3fb72554d268d0f1d7048d 100644 (file)
@@ -25,6 +25,8 @@ DEPEND="${RDEPEND}
        sys-boot/gnu-efi
        virtual/pkgconfig"
 
+PATCHES=( "${FILESDIR}/${P}-libressl-compatibility.patch" )
+
 src_prepare() {
        # Respect users CFLAGS
        sed -i -e 's/CFLAGS.*= -O2 -g/CFLAGS += /' Make.rules || die
diff --git a/app-crypt/efitools/files/efitools-1.8.1-libressl-compatibility.patch b/app-crypt/efitools/files/efitools-1.8.1-libressl-compatibility.patch
new file mode 100644 (file)
index 0000000..876baae
--- /dev/null
@@ -0,0 +1,11 @@
+--- a/cert-to-efi-hash-list.c  2018-04-21 20:59:24.814748503 +0200
++++ b/cert-to-efi-hash-list.c  2018-04-21 20:59:51.868581307 +0200
+@@ -135,7 +135,7 @@
+         X509 *cert = PEM_read_bio_X509(cert_bio, NULL, NULL, NULL);
+       unsigned char *cert_buf = NULL;
+ 
+-#if OPENSSL_VERSION_NUMBER < 0x10100000L
++#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
+       int cert_len = i2d_X509_CINF(cert->cert_info, &cert_buf);
+ #else
+       int cert_len = i2d_re_X509_tbs(cert, &cert_buf);