Import softhsm2 2.5.0, developement of SoftHSM crypto store

ok sthen@
This commit is contained in:
pvk 2018-11-14 22:23:07 +00:00
parent 6b8e265514
commit 03646ce00f
7 changed files with 120 additions and 0 deletions

View File

@ -0,0 +1,42 @@
# $OpenBSD: Makefile,v 1.1.1.1 2018/11/14 22:23:07 pvk Exp $
COMMENT = software PKCS\#11 cryptographic token
DISTNAME = softhsm-2.5.0
PKGNAME = ${DISTNAME:S/-/2-/}
CATEGORIES = security
HOMEPAGE = http://www.opendnssec.org/softhsm/
MAINTAINER = Pavel Korovin <pvk@openbsd.org>
# BSD
PERMIT_PACKAGE_CDROM = Yes
WANTLIB += ${COMPILER_LIBCXX} c crypto m sqlite3 z
MASTER_SITES = http://dist.opendnssec.org/source/
COMPILER = base-clang ports-gcc base-gcc
BUILD_DEPENDS = devel/cppunit
LIB_DEPENDS = databases/sqlite3
TEST_DEPENDS = ${BUILD_DEPENDS}
FAKE_FLAGS = sysconfdir=${PREFIX}/share/examples/softhsm2
SEPARATE_BUILD = Yes
CONFIGURE_STYLE = gnu
CONFIGURE_ARGS = --disable-gost \
--with-migrate \
--with-objectstore-backend-db \
--with-sqlite3=${PREFIX} \
--with-p11-kit=${PREFIX}/share/examples/softhsm2
post-install:
${INSTALL_DATA_DIR} ${PREFIX}/share/doc/softhsm2
cd ${WRKSRC}; ${INSTALL_DATA} LICENSE ${PREFIX}/share/doc/softhsm2
rm ${PREFIX}/lib/softhsm/libsofthsm2.*a
.include <bsd.port.mk>

View File

@ -0,0 +1,2 @@
SHA256 (softhsm-2.5.0.tar.gz) = kqpWz0XiWJIybpi4UcRN6crIVZ4ghyDleb+OLNHBMrI=
SIZE (softhsm-2.5.0.tar.gz) = 1078439

View File

@ -0,0 +1,14 @@
$OpenBSD: patch-configure,v 1.1.1.1 2018/11/14 22:23:07 pvk Exp $
Index: configure
--- configure.orig
+++ configure
@@ -8495,7 +8495,7 @@ full_sysconfdir=`eval eval eval eval eval echo "${sysc
full_localstatedir=`eval eval eval eval eval echo "${localstatedir}" | sed "s#NONE#${prefix}#" | sed "s#NONE#${ac_default_prefix}#"`
full_libdir=`eval eval eval eval eval echo "${libdir}" | sed "s#NONE#${prefix}#" | sed "s#NONE#${ac_default_prefix}#"`
default_softhsm2_conf="`eval echo ${full_sysconfdir} | sed s,NONE,$ac_default_prefix,g`/softhsm2.conf"
-softhsmtokendir=${full_localstatedir}/lib/softhsm/tokens/
+softhsmtokendir=${full_localstatedir}/db/softhsm/tokens/
# Install the library in a sub-directory
full_libdir="$full_libdir/softhsm"

View File

@ -0,0 +1,11 @@
$OpenBSD: patch-softhsm2_module_in,v 1.1.1.1 2018/11/14 22:23:07 pvk Exp $
Index: softhsm2.module.in
--- softhsm2.module.in.orig
+++ softhsm2.module.in
@@ -1,4 +1,4 @@
# This file describes how to load the pk11 module
-# See: http://p11-glue.freedesktop.org/doc/p11-kit/config.html
+# See: https://p11-glue.github.io/p11-glue/p11-kit/manual/pkcs11-conf.html
module: @default_softhsm2_lib@

View File

@ -0,0 +1,22 @@
$OpenBSD: patch-src_lib_crypto_OSSLCryptoFactory_cpp,v 1.1.1.1 2018/11/14 22:23:07 pvk Exp $
ENGINE_load_rdrand() was removed from libcrypto in 2014:
https://cvsweb.openbsd.org/cgi-bin/cvsweb/src/lib/libcrypto/engine/engine.h.diff?r1=1.25&r2=1.26&f=h
OpenDNSSEC GH commit:
https://github.com/opendnssec/SoftHSMv2/pull/423/commits/308b0b2760d6cb218003768747346d31764f1cfe
Index: src/lib/crypto/OSSLCryptoFactory.cpp
--- src/lib/crypto/OSSLCryptoFactory.cpp.orig
+++ 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

View File

@ -0,0 +1,3 @@
SoftHSM is an implementation of a cryptographic store accessible through a
PKCS#11 interface, using Botan for its cryptographic operations. You can use
it to explore PKCS#11 without having a Hardware Security Module.

View File

@ -0,0 +1,26 @@
@comment $OpenBSD: PLIST,v 1.1.1.1 2018/11/14 22:23:07 pvk Exp $
@sample ${SYSCONFDIR}/pkcs11/
@sample ${SYSCONFDIR}/pkcs11/modules/
@bin bin/softhsm2-dump-db
@bin bin/softhsm2-dump-file
@bin bin/softhsm2-keyconv
@bin bin/softhsm2-migrate
@bin bin/softhsm2-util
lib/softhsm/
lib/softhsm/libsofthsm2.so
@man man/man1/softhsm2-dump-db.1
@man man/man1/softhsm2-dump-file.1
@man man/man1/softhsm2-keyconv.1
@man man/man1/softhsm2-migrate.1
@man man/man1/softhsm2-util.1
@man man/man5/softhsm2.conf.5
share/doc/softhsm2/
share/doc/softhsm2/LICENSE
share/examples/softhsm2/
share/examples/softhsm2/softhsm2.conf
@sample ${SYSCONFDIR}/softhsm2.conf
@comment share/examples/softhsm2/softhsm2.conf.sample
share/examples/softhsm2/softhsm2.module
@sample ${SYSCONFDIR}/pkcs11/modules/softhsm2.module
@sample ${LOCALSTATEDIR}/db/softhsm/
@sample ${LOCALSTATEDIR}/db/softhsm/tokens/