Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 8 Jul 2019 08:55:12 +0000 (UTC)
From:      Dima Panov <fluffy@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r506208 - in head/devel/qca: . files
Message-ID:  <201907080855.x688tCaB018684@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: fluffy
Date: Mon Jul  8 08:55:12 2019
New Revision: 506208
URL: https://svnweb.freebsd.org/changeset/ports/506208

Log:
  - Fix build with LibreSSL
      Provide RSA_meth_set_{sign,verify} for LibreSSL.
      Do not redefine M_ASN1_IA5STRING_new and RSA_F_RSA_EAY_PRIVATE_DECRYPT.
      Disable HKDF.
  - Add description for BOTAN option
  
  Obtained from:	Gentoo

Added:
  head/devel/qca/files/patch-plugins_qca-ossl_ossl110-compat.h   (contents, props changed)
  head/devel/qca/files/patch-plugins_qca-ossl_qca-ossl.cpp   (contents, props changed)
Modified:
  head/devel/qca/Makefile

Modified: head/devel/qca/Makefile
==============================================================================
--- head/devel/qca/Makefile	Mon Jul  8 08:31:21 2019	(r506207)
+++ head/devel/qca/Makefile	Mon Jul  8 08:55:12 2019	(r506208)
@@ -35,6 +35,7 @@ OPTIONS_DEFAULT=GNUPG OPENSSL
 OPTIONS_SUB=	yes
 
 BOTAN_CMAKE_ON=		-DWITH_botan_PLUGIN=yes
+BOTAN_DESC=		Build with Botan crypto library
 BOTAN_LIB_DEPENDS=	libbotan-2.so:security/botan2
 BOTAN_USES=		pkgconfig
 

Added: head/devel/qca/files/patch-plugins_qca-ossl_ossl110-compat.h
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/devel/qca/files/patch-plugins_qca-ossl_ossl110-compat.h	Mon Jul  8 08:55:12 2019	(r506208)
@@ -0,0 +1,49 @@
+--- plugins/qca-ossl/ossl110-compat.h.orig	2019-04-24 12:58:14 UTC
++++ plugins/qca-ossl/ossl110-compat.h
+@@ -205,22 +205,6 @@ static int RSA_meth_set_priv_dec(RSA_METHOD *rsa, int 
+     return 1;
+ }
+ 
+-static int RSA_meth_set_sign(RSA_METHOD *meth, int (*sign) (int type, const unsigned char *m,
+-    unsigned int m_length, unsigned char *sigret, unsigned int *siglen, const RSA *rsa))
+-{
+-    if (!meth) return 0;
+-    meth->rsa_sign = sign;
+-    return 1;
+-}
+-
+-static int RSA_meth_set_verify(RSA_METHOD *meth, int (*verify) (int dtype, const unsigned char *m,
+-    unsigned int m_length, const unsigned char *sigbuf, unsigned int siglen, const RSA *rsa))
+-{
+-    if (!meth) return 0;
+-    meth->rsa_verify = verify;
+-    return 1;
+-}
+-
+ static int RSA_meth_set_finish(RSA_METHOD *meth, int (*finish) (RSA *rsa))
+ {
+     if (!meth) return 0;
+@@ -271,5 +255,23 @@ static void HMAC_CTX_free(HMAC_CTX *ctx)
+ #define X509_REVOKED_get0_revocationDate(rev) (rev)->revocationDate
+ 
+ #endif // OPENSSL_VERSION_NUMBER < 0x10100000L
++
++#if (OPENSSL_VERSION_NUMBER < 0x10100000L) || defined(LIBRESSL_VERSION_NUMBER)
++static int RSA_meth_set_sign(RSA_METHOD *meth, int (*sign) (int type, const unsigned char *m,
++    unsigned int m_length, unsigned char *sigret, unsigned int *siglen, const RSA *rsa))
++{
++    if (!meth) return 0;
++    meth->rsa_sign = sign;
++    return 1;
++}
++
++static int RSA_meth_set_verify(RSA_METHOD *meth, int (*verify) (int dtype, const unsigned char *m,
++    unsigned int m_length, const unsigned char *sigbuf, unsigned int siglen, const RSA *rsa))
++{
++    if (!meth) return 0;
++    meth->rsa_verify = verify;
++    return 1;
++}
++#endif // (OPENSSL_VERSION_NUMBER < 0x10100000L) || defined(LIBRESSL_VERSION_NUMBER)
+ 
+ #endif // OSSL110COMPAT_H

Added: head/devel/qca/files/patch-plugins_qca-ossl_qca-ossl.cpp
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/devel/qca/files/patch-plugins_qca-ossl_qca-ossl.cpp	Mon Jul  8 08:55:12 2019	(r506208)
@@ -0,0 +1,44 @@
+--- plugins/qca-ossl/qca-ossl.cpp.orig	2019-04-24 12:58:14 UTC
++++ plugins/qca-ossl/qca-ossl.cpp
+@@ -62,12 +62,12 @@
+ #endif
+ 
+ // OpenSSL 1.1.0 compatibility macros
+-#ifdef OSSL_110
++#if defined(OSSL_110) && !defined(LIBRESSL_VERSION_NUMBER)
+ #define M_ASN1_IA5STRING_new() ASN1_IA5STRING_new()
+ #define RSA_F_RSA_EAY_PRIVATE_DECRYPT RSA_F_RSA_OSSL_PRIVATE_DECRYPT
+ #endif
+ 
+-#ifdef OSSL_110
++#if defined(OSSL_110) && !defined(LIBRESSL_VERSION_NUMBER)
+ #include <openssl/kdf.h>
+ #endif
+ 
+@@ -1280,7 +1280,7 @@ class opensslPbkdf2Context : public KDFContext (public
+ protected:
+ };
+ 
+-#ifdef OSSL_110
++#if defined(OSSL_110) && !defined(LIBRESSL_VERSION_NUMBER)
+ class opensslHkdfContext : public HKDFContext
+ {
+ public:
+@@ -7416,7 +7416,7 @@ class opensslProvider : public Provider (public)
+ #endif
+ 		list += "pbkdf1(sha1)";
+ 		list += "pbkdf2(sha1)";
+-#ifdef OSSL_110
++#if defined(OSSL_110) && !defined(LIBRESSL_VERSION_NUMBER)
+ 		list += "hkdf(sha256)";
+ #endif
+ 		list += "pkey";
+@@ -7489,7 +7489,7 @@ class opensslProvider : public Provider (public)
+ #endif
+ 		else if ( type == "pbkdf2(sha1)" )
+ 			return new opensslPbkdf2Context( this, type );
+-#ifdef OSSL_110
++#if defined(OSSL_110) && !defined(LIBRESSL_VERSION_NUMBER)
+ 		else if ( type == "hkdf(sha256)" )
+ 			return new opensslHkdfContext( this, type );
+ #endif



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201907080855.x688tCaB018684>