aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorQuentin Retornaz <gentoo@retornaz.com>2021-01-17 19:07:38 +0100
committerQuentin Retornaz <gentoo@retornaz.com>2021-01-26 01:21:41 +0100
commit3e37f0342f7a2043ef38cc37fbffae8425229347 (patch)
tree46aa4cbdad49305c23346a5cc9fba940eaf13227 /dev-libs/softhsm
parentdev-libs/mongo-c-driver: new package (diff)
downloadlibressl-3e37f0342f7a2043ef38cc37fbffae8425229347.tar.gz
libressl-3e37f0342f7a2043ef38cc37fbffae8425229347.tar.bz2
libressl-3e37f0342f7a2043ef38cc37fbffae8425229347.zip
dev-libs/softhsm: new package
Package-Manager: Portage-3.0.12, Repoman-3.0.2 Signed-off-by: Quentin Retornaz <gentoo@retornaz.com>
Diffstat (limited to 'dev-libs/softhsm')
-rw-r--r--dev-libs/softhsm/Manifest1
-rw-r--r--dev-libs/softhsm/files/softhsm-2.5.0-libressl.patch32
-rw-r--r--dev-libs/softhsm/metadata.xml9
-rw-r--r--dev-libs/softhsm/softhsm-2.5.0.ebuild50
4 files changed, 92 insertions, 0 deletions
diff --git a/dev-libs/softhsm/Manifest b/dev-libs/softhsm/Manifest
new file mode 100644
index 0000000..fd32042
--- /dev/null
+++ b/dev-libs/softhsm/Manifest
@@ -0,0 +1 @@
+DIST softhsm-2.5.0.tar.gz 1078439 BLAKE2B f96f9e08f3ea568daccb64a5de94ac91b5efcee3dea09f460e98491e7fcdca1277ed52c339a2ec10dac2f78c9e7e44fe5c4a7d36c58e97afba6e749979d4d7e0 SHA512 a1e686729196dc25591eb3da57c2c8ea8494ed274ba711842b2dcae696f477a202acda13a975b8fb1eb68e8e44a79e839dbbc6ba500cab02ad13072c660752d9
diff --git a/dev-libs/softhsm/files/softhsm-2.5.0-libressl.patch b/dev-libs/softhsm/files/softhsm-2.5.0-libressl.patch
new file mode 100644
index 0000000..9aeaf29
--- /dev/null
+++ b/dev-libs/softhsm/files/softhsm-2.5.0-libressl.patch
@@ -0,0 +1,32 @@
+From 308b0b2760d6cb218003768747346d31764f1cfe Mon Sep 17 00:00:00 2001
+From: Alon Bar-Lev <alon.barlev@gmail.com>
+Date: Fri, 19 Oct 2018 23:19:48 +0300
+Subject: [PATCH] crypto: use ENGINE_load_rdrand with recent openssl
+
+libressl and probably older openssl do not support this.
+
+Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
+---
+ src/lib/crypto/OSSLCryptoFactory.cpp | 2 ++
+ 1 file changed, 2 insertions(+)
+
+https://github.com/opendnssec/SoftHSMv2/pull/423
+
+diff --git a/src/lib/crypto/OSSLCryptoFactory.cpp b/src/lib/crypto/OSSLCryptoFactory.cpp
+index dc5f737..04d383d 100644
+--- a/src/lib/crypto/OSSLCryptoFactory.cpp
++++ b/src/lib/crypto/OSSLCryptoFactory.cpp
+@@ -141,8 +141,10 @@ OSSLCryptoFactory::OSSLCryptoFactory()
+ // Initialise OpenSSL
+ OpenSSL_add_all_algorithms();
+
++#if !( OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER) )
+ // Make sure RDRAND is loaded first
+ ENGINE_load_rdrand();
++#endif
+ // Locate the engine
+ rdrand_engine = ENGINE_by_id("rdrand");
+ // Use RDRAND if available
+--
+2.18.1
+
diff --git a/dev-libs/softhsm/metadata.xml b/dev-libs/softhsm/metadata.xml
new file mode 100644
index 0000000..b398526
--- /dev/null
+++ b/dev-libs/softhsm/metadata.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <!-- maintainer-needed -->
+ <use>
+ <flag name="gost">Enable gost algorithm</flag>
+ <flag name="migration-tool">Build db migration tool</flag>
+ </use>
+</pkgmetadata>
diff --git a/dev-libs/softhsm/softhsm-2.5.0.ebuild b/dev-libs/softhsm/softhsm-2.5.0.ebuild
new file mode 100644
index 0000000..1ad9d5b
--- /dev/null
+++ b/dev-libs/softhsm/softhsm-2.5.0.ebuild
@@ -0,0 +1,50 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+DESCRIPTION="A software PKCS#11 implementation"
+HOMEPAGE="https://www.opendnssec.org/"
+SRC_URI="https://www.opendnssec.org/files/source/${P}.tar.gz"
+
+KEYWORDS="~alpha ~amd64 ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86"
+IUSE="bindist gost libressl migration-tool test"
+RESTRICT="!test? ( test )"
+SLOT="2"
+LICENSE="BSD"
+
+RDEPEND="migration-tool? ( dev-db/sqlite:3= )
+ !libressl? ( dev-libs/openssl:0=[bindist=] )
+ libressl? ( dev-libs/libressl:= )
+ !~dev-libs/softhsm-2.0.0:0"
+DEPEND="${RDEPEND}"
+BDEPEND="virtual/pkgconfig
+ sys-devel/gcc:=[cxx]
+ test? ( dev-util/cppunit )"
+
+DOCS=(
+ NEWS
+ README.md
+)
+
+PATCHES=(
+ "${FILESDIR}/${P}-libressl.patch"
+)
+
+src_configure() {
+ econf \
+ --disable-static \
+ --with-crypto-backend=openssl \
+ --disable-p11-kit \
+ --localstatedir="${EROOT}/var" \
+ $(use_enable !bindist ecc) \
+ $(use_enable gost) \
+ $(use_with migration-tool migrate)
+}
+
+src_install() {
+ default
+ find "${D}" -name '*.la' -delete || die
+
+ keepdir "${EROOT}/var/lib/softhsm/tokens"
+}