summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app-crypt/eid-mw/files/fix_libressl_check.patch')
-rw-r--r--app-crypt/eid-mw/files/fix_libressl_check.patch45
1 files changed, 45 insertions, 0 deletions
diff --git a/app-crypt/eid-mw/files/fix_libressl_check.patch b/app-crypt/eid-mw/files/fix_libressl_check.patch
new file mode 100644
index 000000000000..5476e3e4aaff
--- /dev/null
+++ b/app-crypt/eid-mw/files/fix_libressl_check.patch
@@ -0,0 +1,45 @@
+commit 53289f71c53f3aa8047b34d6db9b0ca2ac35f4cb
+Author: Cédric Krier <ced@b2ck.com>
+Date: Wed Jun 7 11:29:13 2017 +0200
+
+ Fix OpenSSL version check for LibreSSL
+
+diff --git a/plugins_tools/eid-viewer/certhelpers.c b/plugins_tools/eid-viewer/certhelpers.c
+index de9f8bf4..1e3d1ee1 100644
+--- a/plugins_tools/eid-viewer/certhelpers.c
++++ b/plugins_tools/eid-viewer/certhelpers.c
+@@ -12,7 +12,7 @@
+
+ #include "backend.h"
+
+-#if OPENSSL_VERSION_NUMBER < 0x10100000L
++#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
+ #define X509_get0_extensions(ce) ((ce)->cert_info->extensions)
+ #define ASN1_STRING_get0_data ASN1_STRING_data
+ #endif
+diff --git a/plugins_tools/eid-viewer/verify.c b/plugins_tools/eid-viewer/verify.c
+index 04016a44..f144d2cb 100644
+--- a/plugins_tools/eid-viewer/verify.c
++++ b/plugins_tools/eid-viewer/verify.c
+@@ -22,7 +22,7 @@
+ #endif
+ // All valid OCSP URLs should have the following as their prefix:
+
+-#if OPENSSL_VERSION_NUMBER < 0x10100000L
++#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
+ #define X509_get0_extensions(ce) ((ce)->cert_info->extensions)
+
+ #define X509_get0_tbs_sigalg(ci) ((ci)->sig_alg)
+diff --git a/tests/unit/sign.c b/tests/unit/sign.c
+index 31a1ab7a..0e0e3011 100644
+--- a/tests/unit/sign.c
++++ b/tests/unit/sign.c
+@@ -37,7 +37,7 @@
+ #include <openssl/rsa.h>
+ #include <openssl/engine.h>
+
+-#if OPENSSL_VERSION_NUMBER < 0x10100000L
++#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
+ static int RSA_set0_key(RSA *r, BIGNUM *n, BIGNUM *e, BIGNUM *d) {
+ if(!r || !n || !e) {
+ return 0;