aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGleb Popov <arrowd@FreeBSD.org>2024-01-07 19:12:42 +0000
committerGleb Popov <arrowd@FreeBSD.org>2024-01-08 12:17:39 +0000
commite94d07c580641ab63b7103ab92ded89042941346 (patch)
tree9ee657f3492970fd3b535e56001af9bc84ca2872
parentb228375db216bf87b61b51b65f158648e54cbd6a (diff)
security/tpm2-pkcs11: New port
Sponsored by: Serenity Cybersecurity, LLC
-rw-r--r--security/Makefile1
-rw-r--r--security/tpm2-pkcs11/Makefile29
-rw-r--r--security/tpm2-pkcs11/distinfo3
-rw-r--r--security/tpm2-pkcs11/files/patch-src_lib_db.c11
-rw-r--r--security/tpm2-pkcs11/files/patch-src_lib_twist.c10
-rw-r--r--security/tpm2-pkcs11/pkg-descr3
-rw-r--r--security/tpm2-pkcs11/pkg-plist4
7 files changed, 61 insertions, 0 deletions
diff --git a/security/Makefile b/security/Makefile
index 24e5ef2f8ead..ceb39475fa1b 100644
--- a/security/Makefile
+++ b/security/Makefile
@@ -1327,6 +1327,7 @@
SUBDIR += tpm-quote-tools
SUBDIR += tpm-tools
SUBDIR += tpm2-abrmd
+ SUBDIR += tpm2-pkcs11
SUBDIR += tpm2-tools
SUBDIR += tpm2-tss
SUBDIR += transcrypt
diff --git a/security/tpm2-pkcs11/Makefile b/security/tpm2-pkcs11/Makefile
new file mode 100644
index 000000000000..56d347a40460
--- /dev/null
+++ b/security/tpm2-pkcs11/Makefile
@@ -0,0 +1,29 @@
+PORTNAME= tpm2-pkcs11
+PORTVERSION= 1.9.0
+CATEGORIES= security
+MASTER_SITES= https://github.com/tpm2-software/tpm2-pkcs11/releases/download/${PORTVERSION}/
+
+MAINTAINER= arrowd@FreeBSD.org
+COMMENT= PKCS\#11 interface for TPM2 hardware
+WWW= https://tpm2-software.github.io/software/
+
+LICENSE= BSD2CLAUSE
+LICENSE_FILE= ${WRKSRC}/LICENSE
+
+LIB_DEPENDS= libyaml.so:textproc/libyaml \
+ libtss2-esys.so:security/tpm2-tss
+
+USES= libtool pkgconfig sqlite:3 ssl
+
+GNU_CONFIGURE= yes
+INSTALL_TARGET= install-strip
+TEST_TARGET= check-TESTS
+
+OPTIONS_DEFINE= TEST
+
+TEST_USES= python:3.9+
+TEST_CONFIGURE_ENABLE= ptool-checks unit
+TEST_LIB_DEPENDS= libcmocka.so:sysutils/cmocka
+TEST_RUN_DEPENDS= dbus-run-session:devel/dbus
+
+.include <bsd.port.mk>
diff --git a/security/tpm2-pkcs11/distinfo b/security/tpm2-pkcs11/distinfo
new file mode 100644
index 000000000000..1ca135b2ffc3
--- /dev/null
+++ b/security/tpm2-pkcs11/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1704652212
+SHA256 (tpm2-pkcs11-1.9.0.tar.gz) = 35bf06c30cfa76fc0eba2c5f503cf7dd0d34a66afb2d292fee896b90362f633b
+SIZE (tpm2-pkcs11-1.9.0.tar.gz) = 1396590
diff --git a/security/tpm2-pkcs11/files/patch-src_lib_db.c b/security/tpm2-pkcs11/files/patch-src_lib_db.c
new file mode 100644
index 000000000000..1dafaa2e68ba
--- /dev/null
+++ b/security/tpm2-pkcs11/files/patch-src_lib_db.c
@@ -0,0 +1,11 @@
+--- src/lib/db.c.orig 2023-01-20 15:32:09 UTC
++++ src/lib/db.c
+@@ -12,8 +12,6 @@
+ #include <libgen.h>
+ #include <unistd.h>
+
+-#include <linux/limits.h>
+-
+ #include <sys/file.h>
+ #include <sys/stat.h>
+ #include <sys/types.h>
diff --git a/security/tpm2-pkcs11/files/patch-src_lib_twist.c b/security/tpm2-pkcs11/files/patch-src_lib_twist.c
new file mode 100644
index 000000000000..382fc6c85f60
--- /dev/null
+++ b/security/tpm2-pkcs11/files/patch-src_lib_twist.c
@@ -0,0 +1,10 @@
+--- src/lib/twist.c.orig 2021-09-29 17:04:30 UTC
++++ src/lib/twist.c
+@@ -2,7 +2,6 @@
+
+ #include <config.h>
+
+-#include <alloca.h>
+ #include <ctype.h>
+ #include <stdint.h>
+ #include <stdarg.h>
diff --git a/security/tpm2-pkcs11/pkg-descr b/security/tpm2-pkcs11/pkg-descr
new file mode 100644
index 000000000000..e8e4f820f83d
--- /dev/null
+++ b/security/tpm2-pkcs11/pkg-descr
@@ -0,0 +1,3 @@
+PKCS #11 is a Public-Key Cryptography Standard that defines a standard method to
+access cryptographic services from tokens/devices. This package allows to use
+a TPM2 device as the cryptographic token.
diff --git a/security/tpm2-pkcs11/pkg-plist b/security/tpm2-pkcs11/pkg-plist
new file mode 100644
index 000000000000..102440d169b2
--- /dev/null
+++ b/security/tpm2-pkcs11/pkg-plist
@@ -0,0 +1,4 @@
+lib/libtpm2_pkcs11.so
+lib/libtpm2_pkcs11.so.0
+lib/libtpm2_pkcs11.so.0.0.0
+libdata/pkgconfig/tpm2-pkcs11.pc