summaryrefslogtreecommitdiff
path: root/app-crypt/trousers/files
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
committerV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
commit4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch)
treeba5f07bf3f9d22d82e54a462313f5d244036c768 /app-crypt/trousers/files
reinit the tree, so we can have metadata
Diffstat (limited to 'app-crypt/trousers/files')
-rw-r--r--app-crypt/trousers/files/61-trousers.rules2
-rw-r--r--app-crypt/trousers/files/tcsd.confd9
-rw-r--r--app-crypt/trousers/files/tcsd.initd38
-rw-r--r--app-crypt/trousers/files/tcsd.service10
-rw-r--r--app-crypt/trousers/files/trousers-0.3.13-nouseradd.patch12
-rw-r--r--app-crypt/trousers/files/trousers-0.3.14-libressl.patch26
6 files changed, 97 insertions, 0 deletions
diff --git a/app-crypt/trousers/files/61-trousers.rules b/app-crypt/trousers/files/61-trousers.rules
new file mode 100644
index 000000000000..20e89cbe3acd
--- /dev/null
+++ b/app-crypt/trousers/files/61-trousers.rules
@@ -0,0 +1,2 @@
+KERNEL=="tpm[0-9]*", MODE="0660", OWNER="tss", GROUP="tss", SYMLINK+="tpm"
+# vim: ft=udevrules:
diff --git a/app-crypt/trousers/files/tcsd.confd b/app-crypt/trousers/files/tcsd.confd
new file mode 100644
index 000000000000..78bedb9fda30
--- /dev/null
+++ b/app-crypt/trousers/files/tcsd.confd
@@ -0,0 +1,9 @@
+# /etc/conf.d/tscd
+
+# Configuration file for the TrouSerS' TCS daemon (tcsd) init script
+# Have a look on /etc/tcsd.conf too, there is more to configure there.
+
+# TPM_MODULES: name of the module(s) that should be loaded. You only need to
+# set this if your driver is not compiled in kernel and is not already loaded
+# on boot. (default: unset)
+#TPM_MODULES="tpm_atmel"
diff --git a/app-crypt/trousers/files/tcsd.initd b/app-crypt/trousers/files/tcsd.initd
new file mode 100644
index 000000000000..19278c5658d3
--- /dev/null
+++ b/app-crypt/trousers/files/tcsd.initd
@@ -0,0 +1,38 @@
+#!/sbin/openrc-run
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+depend() {
+ use logger
+ need net
+}
+
+checkconfig() {
+ local mod
+ if [ -n "${TPM_MODULES}" ] ; then
+ for mod in ${TPM_MODULES} ; do
+ lsmod | grep -q "^${mod}\b" \
+ || modprobe ${mod} &>/dev/null \
+ || ewarn "Failed to load module ${mod}"
+ done
+ # Should we sleep or something to wait for device creation?
+ fi
+ if [ ! -c /dev/tpm ] && [ ! -c /dev/tpm0 ] ; then
+ eerror "No TPM device found!"
+ return 1
+ fi
+ return 0
+}
+
+start() {
+ ebegin "Starting TrouSerS' TCS daemon (tcsd)"
+ checkconfig || eend $?
+ start-stop-daemon --start --user tss --exec /usr/sbin/tcsd
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping TrouSerS' TCS daemon (tcsd)"
+ start-stop-daemon --stop --quiet --exec /usr/sbin/tcsd --user tss
+ eend $?
+}
diff --git a/app-crypt/trousers/files/tcsd.service b/app-crypt/trousers/files/tcsd.service
new file mode 100644
index 000000000000..4a46e6143bc1
--- /dev/null
+++ b/app-crypt/trousers/files/tcsd.service
@@ -0,0 +1,10 @@
+[Unit]
+Description=TCG Core Services Daemon
+
+[Service]
+User=tss
+ExecStart=/usr/sbin/tcsd -f
+
+[Install]
+WantedBy=multi-user.target
+
diff --git a/app-crypt/trousers/files/trousers-0.3.13-nouseradd.patch b/app-crypt/trousers/files/trousers-0.3.13-nouseradd.patch
new file mode 100644
index 000000000000..5426e9929f13
--- /dev/null
+++ b/app-crypt/trousers/files/trousers-0.3.13-nouseradd.patch
@@ -0,0 +1,12 @@
+diff -urNp trousers-0.3.13.org/dist/Makefile.am trousers-0.3.13/dist/Makefile.am
+--- trousers-0.3.13.org/dist/Makefile.am 2014-04-24 21:05:43.000000000 +0300
++++ trousers-0.3.13/dist/Makefile.am 2015-04-08 10:05:51.018955728 +0300
+@@ -11,8 +11,6 @@ endif
+ install-exec-hook:
+ /bin/sh -c 'if [ ! -e ${DESTDIR}/@localstatedir@/lib/tpm ];then mkdir -p ${DESTDIR}/@localstatedir@/lib/tpm; fi'
+ if !NOUSERCHECK
+- /usr/sbin/groupadd tss || true
+- /usr/sbin/useradd -r tss -g tss || true
+ /bin/chown tss:tss ${DESTDIR}/@localstatedir@/lib/tpm || true
+ /bin/chmod 0700 ${DESTDIR}/@localstatedir@/lib/tpm
+ endif
diff --git a/app-crypt/trousers/files/trousers-0.3.14-libressl.patch b/app-crypt/trousers/files/trousers-0.3.14-libressl.patch
new file mode 100644
index 000000000000..927626892b19
--- /dev/null
+++ b/app-crypt/trousers/files/trousers-0.3.14-libressl.patch
@@ -0,0 +1,26 @@
+From b8b1cda430270f03dc556cf9cf7d2fd478101525 Mon Sep 17 00:00:00 2001
+From: Alon Bar-Lev <alon.barlev@gmail.com>
+Date: Wed, 7 Dec 2016 09:36:34 +0200
+Subject: [PATCH] tspi: support libressl
+
+Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
+---
+ src/trspi/crypto/openssl/rsa.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/trspi/crypto/openssl/rsa.c b/src/trspi/crypto/openssl/rsa.c
+index 2b1205f..3e56015 100644
+--- a/src/trspi/crypto/openssl/rsa.c
++++ b/src/trspi/crypto/openssl/rsa.c
+@@ -38,7 +38,7 @@
+ #define DEBUG_print_openssl_errors()
+ #endif
+
+-#if OPENSSL_VERSION_NUMBER < 0x10100001L
++#if OPENSSL_VERSION_NUMBER < 0x10100001L || defined(LIBRESSL_VERSION_NUMBER)
+ static int
+ RSA_set0_key(RSA *r, BIGNUM *n, BIGNUM *e, BIGNUM *d)
+ {
+--
+2.7.3
+