On 2015/06/22 13:24, Jérémie Courrèges-Anglas wrote:
> Stuart Henderson <[email protected]> writes:
>
>
> [...]
>
> > 2. The i386 problems are a bit concerning, it seems quite unlikely that
> > they will only affect i386.
>
> I'll take a look at them this evening, had to update my i386 box.
>
> > softhsm is probably easier to test so let's look at that first. I'm
> > fairly busy at the moment but I'll put it on my list to look at...
>
> Here's a diff against Patrick's tarball, and a new tarball attached.
> - don't hardcode the botan libs but use botan-config
> - no need for libsofthsm.{a,la}, ltdl is not used
>
> I think it's ready to import.
Since it's a PKCS#11 module which can be used by various programs
other than opendnssec, let's treat it as one - could you add the rest
of scaffolding (diff below) so that p11-kit can find it, please?
I considered installing the .so to lib/pkcs11, but since we can just
use a relative link in the module file, it's easy enough to use softhsm
upstream's preferred path, so let's do that...
OK sthen@ with this (or probably something else similar if you have a
different idea) added.
Sample p11-kit output further below.
diff --git Makefile Makefile
index ee9c335..10cc809 100644
--- Makefile
+++ Makefile
@@ -31,5 +31,7 @@ CONFIGURE_STYLE= gnu
${INSTALL_DATA_DIR} ${PREFIX}/share/doc/softhsm
cd ${WRKSRC}; ${INSTALL_DATA} LICENSE ${PREFIX}/share/doc/softhsm
rm ${PREFIX}/lib/softhsm/libsofthsm.*a
+ ${INSTALL_DATA} ${FILESDIR}/softhsm.module \
+ ${PREFIX}/share/examples/softhsm
.include <bsd.port.mk>
diff --git files/softhsm.module files/softhsm.module
new file mode 100644
index 0000000..04905c4
--- /dev/null
+++ files/softhsm.module
@@ -0,0 +1,3 @@
+# $OpenBSD$
+
+module: ../softhsm/libsofthsm.so
diff --git pkg/PLIST pkg/PLIST
index 24c4e24..4c82b91 100644
--- pkg/PLIST
+++ pkg/PLIST
@@ -11,5 +11,9 @@ share/doc/softhsm/LICENSE
share/examples/softhsm/
share/examples/softhsm/softhsm.conf
@sample ${SYSCONFDIR}/softhsm.conf
+share/examples/softhsm/softhsm.module
+@sample ${SYSCONFDIR}/pkcs11/
+@sample ${SYSCONFDIR}/pkcs11/modules/
+@sample ${SYSCONFDIR}/pkcs11/modules/softhsm.module
@sample ${LOCALSTATEDIR}/db/softhsm/
@comment share/examples/softhsm/softhsm.conf.sample
........
$ p11-kit list-modules
p11-kit-trust: p11-kit-trust.so
library-description: PKCS#11 Kit Trust Module
library-manufacturer: PKCS#11 Kit
library-version: 0.22
token: System Trust
manufacturer: PKCS#11 Kit
model: p11-kit-trust
serial-number: 1
hardware-version: 0.22
flags:
write-protected
token-initialized
gnome-keyring: gnome-keyring-pkcs11.so
library-description: GNOME Keyring (without daemon)
library-manufacturer: GNOME Keyring
library-version: 1.1
softhsm: ../softhsm/libsofthsm.so
library-description: Implementation of PKCS11
library-manufacturer: SoftHSM
library-version: 1.3
token: OpenDNSSEC
manufacturer: SoftHSM
model: SoftHSM
serial-number: 1
hardware-version: 1.3
firmware-version: 1.3
flags:
rng
login-required
user-pin-initialized
clock-on-token
token-initialized
$ p11tool --list-tokens
Token 0:
URL:
pkcs11:model=p11-kit-trust;manufacturer=PKCS%2311%20Kit;serial=1;token=System%20Trust
Label: System Trust
Type: Trust module
Manufacturer: PKCS#11 Kit
Model: p11-kit-trust
Serial: 1
Token 1:
URL: pkcs11:model=SoftHSM;manufacturer=SoftHSM;serial=1;token=OpenDNSSEC
Label: OpenDNSSEC
Type: Generic token
Manufacturer: SoftHSM
Model: SoftHSM
Serial: 1