1
0
mirror of https://git.FreeBSD.org/ports.git synced 2025-01-07 06:40:06 +00:00

dns/yadifa: Fix LibreSSL build issues

- Add checks for LIBRESSL_VERSION_NUMBER

PR:		217349
Obtained from:	https://github.com/yadifa/yadifa/pull/2
This commit is contained in:
Bernard Spil 2017-02-27 10:41:46 +00:00
parent 73f350d976
commit a5c65f771e
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=434923
4 changed files with 71 additions and 0 deletions

View File

@ -0,0 +1,20 @@
--- lib/dnscore/src/dnskey_dsa.c.orig 2016-12-16 11:52:17 UTC
+++ lib/dnscore/src/dnskey_dsa.c
@@ -70,7 +70,7 @@
#error "OPENSSL_VERSION_NUMBER not defined"
#endif
-#if OPENSSL_VERSION_NUMBER < 0x10100000L
+#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
/*
* Backward-compatible interface for 0.9.x
@@ -226,7 +226,7 @@ dnskey_dsa_genkey(u32 size)
int err;
DSA* dsa;
-#if OPENSSL_VERSION_NUMBER < 0x10100000L
+#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
dsa = DSA_generate_parameters(size, NULL,0, NULL, NULL, NULL, NULL);
#else
dsa = DSA_new();

View File

@ -0,0 +1,11 @@
--- lib/dnscore/src/dnskey_ecdsa.c.orig 2016-12-16 11:52:17 UTC
+++ lib/dnscore/src/dnskey_ecdsa.c
@@ -79,7 +79,7 @@
#define DNSKEY_ALGORITHM_ECDSAP256SHA256_NID NID_X9_62_prime256v1
#define DNSKEY_ALGORITHM_ECDSAP384SHA384_NID NID_secp384r1
-#if OPENSSL_VERSION_NUMBER < 0x10100000L
+#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
#define SSL_FIELD_GET(st_,f_) if(f_ != NULL) { *f_ = st_->f_; }
#define SSL_FIELD_SET(st_,f_) if(f_ != NULL) { BN_free(st_->f_); st_->f_ = f_; }

View File

@ -0,0 +1,11 @@
--- lib/dnscore/src/dnskey_rsa.c.orig 2016-12-16 11:52:17 UTC
+++ lib/dnscore/src/dnskey_rsa.c
@@ -64,7 +64,7 @@
#define MODULE_MSG_HANDLE g_system_logger
-#if OPENSSL_VERSION_NUMBER < 0x10100000L
+#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
#define SSL_FIELD_GET(st_,f_) if(f_ != NULL) { *f_ = st_->f_; }
#define SSL_FIELD_SET(st_,f_) if(f_ != NULL) { BN_free(st_->f_); st_->f_ = f_; }

View File

@ -0,0 +1,29 @@
--- lib/dnscore/src/tsig.c.orig 2016-12-16 11:52:17 UTC
+++ lib/dnscore/src/tsig.c
@@ -233,7 +233,7 @@
tsig_hmac_t
tsig_hmac_allocate()
{
-#if OPENSSL_VERSION_NUMBER < 0x10100000L // ie: 0.9.x
+#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER) // ie: 0.9.x
HMAC_CTX *hmac;
ZALLOC_OR_DIE(HMAC_CTX*, hmac, HMAC_CTX, GENERIC_TAG);
HMAC_CTX_init(hmac);
@@ -257,7 +257,7 @@ tsig_hmac_free(tsig_hmac_t t)
{
HMAC_CTX *hmac = (HMAC_CTX*)t;
yassert(hmac != NULL);
-#if OPENSSL_VERSION_NUMBER < 0x10100000L
+#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
HMAC_CTX_cleanup(hmac);
ZFREE(t, HMAC_CTX);
#else
@@ -268,7 +268,7 @@ tsig_hmac_free(tsig_hmac_t t)
void tsig_hmac_reset(tsig_hmac_t t)
{
HMAC_CTX *hmac = (HMAC_CTX*)t;
-#if OPENSSL_VERSION_NUMBER < 0x10100000L
+#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
HMAC_CTX_cleanup(hmac);
HMAC_CTX_init(hmac);
#else