Add TPM2 software family
cover Add TPM2 software family
This series adds packages for the Trusted Computing Group's (TCG) TPM2 Software Stack (TSS). These packages supersede the ones provided by the ancient "trousers" and "tpm" packages but can coexist with them.
Patch #1 adds tpm2-tss, the libries implementing the TPM2 specification:
https://github.com/tpm2-software/tpm2-tss
Patch #2 adds tpm2-abrmd, the Access Broker & Resource Manager:
https://github.com/tpm2-software/tpm2-abrmd
Patch #3 adds tpm2-tools, a set of CLI tools based on tpm2-tss:
https://github.com/tpm2-software/tpm2-tools
Patch #4 adds me to the watchers of tpm2-{abrmd,tools,tss} in DEVELOPERS
These packages were tested on a device with an Intel C3000 processr.
Carlos Santos (4):
tpm2-tss: new package
tpm2-abrmd: new package
tpm2-tools: new package
DEVELOPERS: add myself for tpm2-{abrmd,tools,tss}.
DEVELOPERS | 3 + package/Config.in | 3 + package/tpm2-abrmd/Config.in | 26 ++++++++ package/tpm2-abrmd/S30devtpmperms | 37 +++++++++++ package/tpm2-abrmd/S80tpm2-abrmd | 74 ++++++++++++++++++++++ package/tpm2-abrmd/etc.default.tpm2-abrmd | 1 + package/tpm2-abrmd/tpm2-abrmd.hash | 3 + package/tpm2-abrmd/tpm2-abrmd.mk | 36 +++++++++++ .../tpm2-tools/0001-Fix-build-with-LibreSSL.patch | 64 +++++++++++++++++++ package/tpm2-tools/Config.in | 17 +++++ package/tpm2-tools/tpm2-tools.hash | 3 + package/tpm2-tools/tpm2-tools.mk | 13 ++++ package/tpm2-tss/Config.in | 32 ++++++++++ package/tpm2-tss/tpm2-tss.hash | 3 + package/tpm2-tss/tpm2-tss.mk | 14 ++++ 15 files changed, 329 insertions(+) create mode 100644 package/tpm2-abrmd/Config.in create mode 100755 package/tpm2-abrmd/S30devtpmperms create mode 100755 package/tpm2-abrmd/S80tpm2-abrmd create mode 100644 package/tpm2-abrmd/etc.default.tpm2-abrmd create mode 100644 package/tpm2-abrmd/tpm2-abrmd.hash create mode 100644 package/tpm2-abrmd/tpm2-abrmd.mk create mode 100644 package/tpm2-tools/0001-Fix-build-with-LibreSSL.patch create mode 100644 package/tpm2-tools/Config.in create mode 100644 package/tpm2-tools/tpm2-tools.hash create mode 100644 package/tpm2-tools/tpm2-tools.mk create mode 100644 package/tpm2-tss/Config.in create mode 100644 package/tpm2-tss/tpm2-tss.hash create mode 100644 package/tpm2-tss/tpm2-tss.mk
Signature · 1 line
2.14.3
PATCH 1/4 tpm2-tss: new package
OSS implementation of the TCG TPM2 Software Stack (TSS2). This stack consists of the following layers from top to bottom:
* System API (SAPI) as described in the system level API and TPM command transmission interface specification. This API is a 1-to-1 mapping of the TPM2 commands documented in Part 3 of the TPM2 specification. Additionally there are asynchronous versions of each command. These asynchronous variants may be useful for integration into event-driven programming environments. Both the synchronous and asynchronous API are exposed through a single library: libsapi.
* TPM Command Transmission Interface (TCTI) that is described in the same specification. This API provides a standard interface to transmit / receive TPM command / response buffers. It is expected that any number of libraries implementing the TCTI API will be implemented as a way to abstract various platform specific IPC mechanisms. Currently this repository provides two TCTI implementations: libtcti-device and libtcti-socket. The prior should be used for direct access to the TPM through the Linux kernel driver. The later implements the protocol exposed by the Microsoft software TPM2 simulator.
--- package/Config.in | 1 + package/tpm2-tss/Config.in | 32 ++++++++++++++++++++++++++++++++ package/tpm2-tss/tpm2-tss.hash | 3 +++ package/tpm2-tss/tpm2-tss.mk | 14 ++++++++++++++ 4 files changed, 50 insertions(+) create mode 100644 package/tpm2-tss/Config.in create mode 100644 package/tpm2-tss/tpm2-tss.hash create mode 100644 package/tpm2-tss/tpm2-tss.mk
package/Config.in +1 -0
@@ -1056,6 +1056,7 @@ menu "Crypto" source "package/openssl/Config.in" source "package/rhash/Config.in" source "package/tinydtls/Config.in" + source "package/tpm2-tss/Config.in" source "package/trousers/Config.in" source "package/ustream-ssl/Config.in" source "package/wolfssl/Config.in"
package/tpm2-tss/Config.in new file +32 -0
@@ -0,0 +1,32 @@ +config BR2_PACKAGE_TPM2_TSS + bool "tpm2-tss" + depends on BR2_i386 || BR2_x86_64 + select BR2_PACKAGE_LIBURIPARSER + help + OSS implementation of the Trusted Computing Group's (TCG) TPM2 + Software Stack (TSS). This stack consists of the following + layers from top to bottom: + + * System API (SAPI) as described in the system level API and + TPM command transmission interface specification. This API + is a 1-to-1 mapping of the TPM2 commands documented in Part + 3 of the TPM2 specification. Additionally there are + asynchronous versions of each command. These asynchronous + variants may be useful for integration into event-driven + programming environments. Both the synchronous and + asynchronous API are exposed through a single library: + libsapi. + + * TPM Command Transmission Interface (TCTI) that is described + in the same specification. This API provides a standard + interface to transmit / receive TPM command / response + buffers. It is expected that any number of libraries + implementing the TCTI API will be implemented as a way to + abstract various platform specific IPC mechanisms. Currently + this repository provides two TCTI implementations: + libtcti-device and libtcti-socket. The prior should be used + for direct access to the TPM through the Linux kernel + driver. The later implements the protocol exposed by the + Microsoft software TPM2 simulator. + + https://github.com/tpm2-software/tpm2-tss
package/tpm2-tss/tpm2-tss.hash new file +3 -0
@@ -0,0 +1,3 @@ +# Locally computed: +sha256 c7d627de50394e9a02593edb1ce74e1bbac17831be726c54f689507f0c41a78a tpm2-tss-1.3.0.tar.gz +sha256 18c1bf4b1ba1fb2c4ffa7398c234d83c0d55475298e470ae1e5e3a8a8bd2e448 LICENSE
package/tpm2-tss/tpm2-tss.mk new file +14 -0
@@ -0,0 +1,14 @@ +################################################################################ +# +# tpm2-tss +# +################################################################################ + +TPM2_TSS_VERSION = 1.3.0 +TPM2_TSS_SITE = https://github.com/tpm2-software/tpm2-tss/releases/download/$(TPM2_TSS_VERSION) +TPM2_TSS_LICENSE = BSD-2-Clause +TPM2_TSS_LICENSE_FILES = LICENSE +TPM2_TSS_INSTALL_STAGING = YES +TPM2_TSS_DEPENDENCIES = liburiparser host-pkgconf + +$(eval $(autotools-package))
Signature · 1 line
2.14.3
PATCH 1/4 tpm2-tss: new package
Quoted 23 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Carlos" == Carlos Santos <[email protected]> writes:
OSS implementation of the TCG TPM2 Software Stack (TSS2). This stack consists of the following layers from top to bottom:
* System API (SAPI) as described in the system level API and TPM command transmission interface specification. This API is a 1-to-1 mapping of the TPM2 commands documented in Part 3 of the TPM2 specification. Additionally there are asynchronous versions of each command. These asynchronous variants may be useful for integration into event-driven programming environments. Both the synchronous and asynchronous API are exposed through a single library: libsapi.
* TPM Command Transmission Interface (TCTI) that is described in the same specification. This API provides a standard interface to transmit / receive TPM command / response buffers. It is expected that any number of libraries implementing the TCTI API will be implemented as a way to abstract various platform specific IPC mechanisms. Currently this repository provides two TCTI implementations: libtcti-device and libtcti-socket. The prior should be used for direct access to the TPM through the Linux kernel driver. The later implements the protocol exposed by the Microsoft software TPM2 simulator.
Quoted 1 line
Signed-off-by Carlos Santos <[email protected]>
Committed, thanks.
Signature · 1 line
Bye, Peter Korsgaard
PATCH 2/4 tpm2-abrmd: new package
In reply to Carlos SantosThis is a system daemon implementing the TPM2 access broker (TAB) & Resource Manager (RM) spec from the TCG. The daemon (tpm2-abrmd) is implemented using Glib and the GObject system.
Communication between the daemon and clients using the TPM is done with a combination of DBus and Unix pipes. DBus is used for discovery, session management and the 'cancel', 'setLocality', and 'getPollHandles' API calls (mostly these aren't yet implemented). Pipes are used to send and receive TPM commands and responses (respectively) between client and server.
The daemon owns the com.intel.tss2.Tabrmd name on dbus. It can be configured to connect to either the system or the session bus.
The package also provides a client library for interacting with the daemon via TPM Command Transmission Interface (TCTI). It is intended for use with the SAPI library (libsapi) like any other TCTI.
--- package/Config.in | 1 + package/tpm2-abrmd/Config.in | 26 +++++++++++ package/tpm2-abrmd/S30devtpmperms | 37 ++++++++++++++++ package/tpm2-abrmd/S80tpm2-abrmd | 74 +++++++++++++++++++++++++++++++ package/tpm2-abrmd/etc.default.tpm2-abrmd | 1 + package/tpm2-abrmd/tpm2-abrmd.hash | 3 ++ package/tpm2-abrmd/tpm2-abrmd.mk | 36 +++++++++++++++ 7 files changed, 178 insertions(+) create mode 100644 package/tpm2-abrmd/Config.in create mode 100755 package/tpm2-abrmd/S30devtpmperms create mode 100755 package/tpm2-abrmd/S80tpm2-abrmd create mode 100644 package/tpm2-abrmd/etc.default.tpm2-abrmd create mode 100644 package/tpm2-abrmd/tpm2-abrmd.hash create mode 100644 package/tpm2-abrmd/tpm2-abrmd.mk
package/Config.in +1 -0
@@ -1996,6 +1996,7 @@ menu "System tools" source "package/sysvinit/Config.in" source "package/tar/Config.in" source "package/tpm-tools/Config.in" + source "package/tpm2-abrmd/Config.in" source "package/unscd/Config.in" source "package/util-linux/Config.in" source "package/xen/Config.in"
package/tpm2-abrmd/Config.in new file +26 -0
@@ -0,0 +1,26 @@ +config BR2_PACKAGE_TPM2_ABRMD + bool "tpm2-abrmd" + depends on BR2_i386 || BR2_x86_64 + depends on BR2_USE_WCHAR # libglib2 + depends on BR2_TOOLCHAIN_HAS_THREADS # dbus, libglib2 + depends on BR2_USE_MMU # dbus, libglib2 + select BR2_PACKAGE_DBUS + select BR2_PACKAGE_LIBGLIB2 + select BR2_PACKAGE_TPM2_TSS + help + A system daemon implementing the TPM2 access broker (TAB) & + Resource Manager (RM) spec from the TCG. It should be started + during the OS boot process. Communication between the daemon + and clients using the TPM is done with a combination of DBus + and Unix pipes. + + The package also provides a client library for interacting + with the daemon via TPM Command Transmission Interface (TCTI). + It is intended for use with the SAPI library (libsapi) like + any other TCTI. + + https://github.com/tpm2-software/tpm2-abrmd + +comment "tpm2-abrmd needs a toolchain w/ wchar, threads" + depends on BR2_USE_MMU + depends on !BR2_USE_WCHAR || !BR2_TOOLCHAIN_HAS_THREADS
package/tpm2-abrmd/S30devtpmperms new file +37 -0
@@ -0,0 +1,37 @@ +#!/bin/sh +# +# Set the permissions of /dev/tpm[0-9]* +# + +check_device() { + ls -1 /dev/tpm[0-9]* > /dev/null 2>&1 || { + echo "device driver not loaded, skipping." + exit 0 + } +} + +start() { + printf "Setting the ownership and permissions of /dev/tpm: " + check_device + chown tss:tss /dev/tpm[0-9]* && chmod 600 /dev/tpm* \ + && echo "OK" || echo "FAIL" +} + +stop() { + printf "Restoring the ownership and permissions of /dev/tpm: " + check_device + chown root:root /dev/tpm[0-9]* && chmod 600 /dev/tpm \ + && echo "OK" || echo "FAIL" +} + +case "$1" in + start|restart|reload) + start + ;; + stop) + stop + ;; + *) + echo "Usage: $0 {start|stop|restart}" + exit 1 +esac
package/tpm2-abrmd/S80tpm2-abrmd new file +74 -0
74 lines not on this page · raw message
package/tpm2-abrmd/etc.default.tpm2-abrmd new file +1 -0
@@ -0,0 +1 @@ +DAEMON_OPTS="--tcti=device --logger=syslog --max-connections=20 --max-transient-objects=20 --fail-on-loaded-trans"
package/tpm2-abrmd/tpm2-abrmd.hash new file +3 -0
@@ -0,0 +1,3 @@ +# Locally computed: +sha256 e20d2796c3097f9eec8410cec6a99d1532769d1cc138d6d9331c8ee1f0d305a4 tpm2-abrmd-1.2.0.tar.gz +sha256 18c1bf4b1ba1fb2c4ffa7398c234d83c0d55475298e470ae1e5e3a8a8bd2e448 LICENSE
package/tpm2-abrmd/tpm2-abrmd.mk new file +36 -0
@@ -0,0 +1,36 @@ +################################################################################ +# +# tpm2-abrmd +# +################################################################################ + +TPM2_ABRMD_VERSION = 1.2.0 +TPM2_ABRMD_SITE = https://github.com/tpm2-software/tpm2-abrmd/releases/download/$(TPM2_ABRMD_VERSION) +TPM2_ABRMD_LICENSE = BSD-2-Clause +TPM2_ABRMD_LICENSE_FILES = LICENSE +TPM2_ABRMD_INSTALL_STAGING = YES +TPM2_ABRMD_DEPENDENCIES = dbus libglib2 tpm2-tss host-pkgconf + +TPM2_ABRMD_CONF_OPTS += \ + --with-systemdsystemunitdir=$(if $(BR2_INIT_SYSTEMD),/usr/lib/systemd/system,no) \ + --with-udevrulesdir=$(if $(BR2_PACKAGE_HAS_UDEV),/usr/lib/udev/rules.d,no) + +define TPM2_ABRMD_INSTALL_INIT_SYSTEMD + $(TARGET_MAKE_ENV) $(MAKE1) -C $(@D) DESTDIR=$(TARGET_DIR) \ + install-systemdpresetDATA install-systemdsystemunitDATA +endef + +# Without udev we need an init script to set the ownership of /dev/tpm[0-9]* +define TPM2_ABRMD_INSTALL_INIT_SYSV + $(INSTALL) -D -m 0755 -t $(TARGET_DIR)/etc/init.d \ + $(if $(BR2_PACKAGE_HAS_UDEV),,$(TPM2_ABRMD_PKGDIR)/S30devtpmperms) \ + $(TPM2_ABRMD_PKGDIR)/S80tpm2-abrmd + $(INSTALL) -D -m 0644 $(TPM2_ABRMD_PKGDIR)/etc.default.tpm2-abrmd \ + $(TARGET_DIR)/etc/default/tpm2-abrmd +endef + +define TPM2_ABRMD_USERS + tss -1 tss -1 * - - - TPM2 Access Broker & Resource Management daemon +endef + +$(eval $(autotools-package))
Signature · 1 line
2.14.3
PATCH 3/4 tpm2-tools: new package
In reply to Carlos SantosTPM (Trusted Platform Module) 2.0 CLI tools based on system API of TPM2-TSS. These tools can be used to manage keys, perform encryption/decryption/signing/etc crypto operations, and manage non-volatile storage through a TPM2.0 HW implementation.
--- package/Config.in | 1 + .../tpm2-tools/0001-Fix-build-with-LibreSSL.patch | 64 ++++++++++++++++++++++ package/tpm2-tools/Config.in | 17 ++++++ package/tpm2-tools/tpm2-tools.hash | 3 + package/tpm2-tools/tpm2-tools.mk | 13 +++++ 5 files changed, 98 insertions(+) create mode 100644 package/tpm2-tools/0001-Fix-build-with-LibreSSL.patch create mode 100644 package/tpm2-tools/Config.in create mode 100644 package/tpm2-tools/tpm2-tools.hash create mode 100644 package/tpm2-tools/tpm2-tools.mk
package/Config.in +1 -0
@@ -1997,6 +1997,7 @@ menu "System tools" source "package/tar/Config.in" source "package/tpm-tools/Config.in" source "package/tpm2-abrmd/Config.in" + source "package/tpm2-tools/Config.in" source "package/unscd/Config.in" source "package/util-linux/Config.in" source "package/xen/Config.in"
package/tpm2-tools/0001-Fix-build-with-LibreSSL.patch new file +64 -0
64 lines not on this page · raw message
package/tpm2-tools/Config.in new file +17 -0
@@ -0,0 +1,17 @@ +config BR2_PACKAGE_TPM2_TOOLS + bool "tpm2-tools" + depends on BR2_i386 || BR2_x86_64 + select BR2_PACKAGE_DBUS + select BR2_PACKAGE_LIBCURL + select BR2_PACKAGE_LIBGLIB2 + select BR2_PACKAGE_OPENSSL + select BR2_PACKAGE_TPM2_ABRMD # run-time + select BR2_PACKAGE_TPM2_TSS + help + TPM (Trusted Platform Module) 2.0 CLI tools based on system + API of TPM2-TSS. These tools can be used to manage keys, + perform encryption/decryption/signing/etc crypto operations, + and manage non-volatile storage through a TPM2.0 HW + implementation. + + https://github.com/tpm2-software/tpm2-tools
package/tpm2-tools/tpm2-tools.hash new file +3 -0
@@ -0,0 +1,3 @@ +# Locally computed: +sha256 c990c0656165afef0fad61e1852a9a189a4b93b43d2a684b151a5dc0b3c6249d tpm2-tools-3.0.3.tar.gz +sha256 3d6b149c8b042bd5f3db678d587fbe55230d071ca084bd38dcae451679c6dd45 LICENSE
package/tpm2-tools/tpm2-tools.mk new file +13 -0
@@ -0,0 +1,13 @@ +################################################################################ +# +# tpm2-tools +# +################################################################################ + +TPM2_TOOLS_VERSION = 3.0.3 +TPM2_TOOLS_SITE = https://github.com/tpm2-software/tpm2-tools/releases/download/$(TPM2_TOOLS_VERSION) +TPM2_TOOLS_LICENSE = BSD-2-Clause +TPM2_TOOLS_LICENSE_FILES = LICENSE +TPM2_TOOLS_DEPENDENCIES = dbus libcurl libglib2 openssl tpm2-tss host-pkgconf + +$(eval $(autotools-package))
Signature · 1 line
2.14.3
PATCH 4/4 DEVELOPERS: add myself for tpm2-{abrmd, tools, tss}.
In reply to Carlos Santos--- DEVELOPERS | 3 +++ 1 file changed, 3 insertions(+)
DEVELOPERS +3 -0
@@ -386,6 +386,9 @@ F: package/libpam-radius-auth/ F: package/libpam-tacplus/ F: package/perl-file-util/ F: package/util-linux/ +F: package/tpm2-abrmd/ +F: package/tpm2-tools/ +F: package/tpm2-tss/ N: Carsten Schoenert <[email protected]> F: package/dvbsnoop/
Signature · 1 line
2.14.3