forked from gentoo/gentoo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fix_libressl_check.patch
45 lines (38 loc) · 1.58 KB
/
fix_libressl_check.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
commit 53289f71c53f3aa8047b34d6db9b0ca2ac35f4cb
Author: Cédric Krier <[email protected]>
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;