summaryrefslogtreecommitdiff
path: root/app-crypt/trousers
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
reinit the tree, so we can have metadata
Diffstat (limited to 'app-crypt/trousers')
-rw-r--r--app-crypt/trousers/Manifest11
-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
-rw-r--r--app-crypt/trousers/metadata.xml12
-rw-r--r--app-crypt/trousers/trousers-0.3.14-r1.ebuild105
9 files changed, 225 insertions, 0 deletions
diff --git a/app-crypt/trousers/Manifest b/app-crypt/trousers/Manifest
new file mode 100644
index 000000000000..65e6e7fe0ef3
--- /dev/null
+++ b/app-crypt/trousers/Manifest
@@ -0,0 +1,11 @@
+AUX 61-trousers.rules 96 SHA256 8f25b51dca45b75caa85a00ef476fb40c09d6cc82e2351cb7af24ebc805dd949 SHA512 83fa5b8666bcb0111f69456e6b9ea73eca2e1933e44bf7b705ff4d3c7b63a63ae4d0a1c30b0a00ebe6a8b4206ed7df80abca8503ace1c795119213f3546e9307 WHIRLPOOL a6ff89249a9ea7d5a7d308f0446e304b4429992bd51953e4dbe1a87731c7b8c824b1d158fc1f734965c082508b1ed334ff4303bf610228228c858e29cfe71664
+AUX tcsd.confd 372 SHA256 5a1f9150ce0d8cc3e9e80971e073ee0b1db018ec3af6809087a7c626b9ffa327 SHA512 1e33f521156d55ff450907e01a7c60750e2880520700de1e8fb42ed03d5a16a20332f6f437f2cc7ed155f65b9306bf2d670f46c4b7055d4c9248beaeb06f8a75 WHIRLPOOL d94c3719b438c2758d97f00dab463b9b76b0fc2d9329dcc9cd8867150a7f5351379254868165df8e19ef33ae0e9d6ab333706952dcabaf0da18833750c35f42e
+AUX tcsd.initd 843 SHA256 9d3051516dad5ac176455f9d7f1d5414466c1a0859166b2e3c2f23e1c19aedb1 SHA512 7bbf7e7bb8829d8aea8d8cae060bb8cb4bf6d2ca9396970e95d082792597cec0babb26913ff28afb1bdbfc781286f7795161e074c1da97a95a1e33d8814af480 WHIRLPOOL 3e56e305bcb81c90f2008a32e94dc8d9b2f719183794400937d3a6b20e45629f6151b3d7613623823984d70f99e9a4e6a3de82c1b1a5818aa565b7e3996f20d0
+AUX tcsd.service 131 SHA256 704dbb2b06a3e357fe2363d2cc88632ccd18dcdf14dc7640cd67272df5a52ade SHA512 e516bde8ce45fe4ad687aaaabae475da9c20a9fbd8ebee736d09ceb6efa597efb6f3bb99840a4c0d2c9eb77c2824df6ee45985b46dc8cf924b4eed67eeec1468 WHIRLPOOL 851f6ef31d93a7fd119cc4bc70c28410539fb572158e8238b72ea177e5a75e2a48382807ac14203eb48a21e5432c5c0c35cf25619557d9ba741328f3f79ebfc0
+AUX trousers-0.3.13-nouseradd.patch 606 SHA256 af43a38991c10db8a817faaa4ff244f3600c90a10e26a0232e7668f15f84e911 SHA512 a6c9074e535429f09ce5e850d943378348b54bed479b7fef0fff7bb18ab2547421407900aa35533749a764275a241ddbd083c4e2f3d6a9ad6f9b1d40d090f783 WHIRLPOOL 2ca8c22aa11aee2f06ce0dfc7c2d035b10724999302818461e72ed9fc29d813112dd52ac80ac7c1027b301f7bdcffe085537dfbf05affebf3ca96992026ae11b
+AUX trousers-0.3.14-libressl.patch 783 SHA256 6e42e93195470626718859b960bbdeebc311dd6ce45b23265307cd25a07f013d SHA512 5d813efbe5cb5568ef084c32d5c049f73943b3c08645fb1b8ba31b188c5c332bc39713bc6895573f472cff94124823c9f545498d7b774027c2724733be910f42 WHIRLPOOL 99a9e0bb4120cc1f65419792079e57cc9f1ff9371cfb931c14167432cb0adb2671c3738346117b2e93316e80410e8328920ac60081490ac221d15cca4a39e856
+DIST trousers-0.3.14.tar.gz 1378438 SHA256 ce50713a261d14b735ec9ccd97609f0ad5ce69540af560e8c3ce9eb5f2d28f47 SHA512 bf87f00329cf1d76a12cf6b6181fa22f90e76af3c5786e6e2db98438d2d3f0c0e05364374664173f45e3a2f6c0e2364948d0b958a7845cb23fcb340150cd9b21 WHIRLPOOL 1e1c51774fa796c706858d008651182673f7a88532cac35d010f4bd713fe50c1151e0a5a7ffb6975e8a050a1aab6edeb09d1672407025a776625c9b4f2912c88
+EBUILD trousers-0.3.14-r1.ebuild 3010 SHA256 1f98a829c6496e87afccf64a4617e77aea712706edf1b102915295d6688f7b42 SHA512 8eba2e532b2c55f035f8d25cfeec1367db9406c686cad8ccdfb644e065284169471a97dcfce07b6af90817398bc351f4251b176c70ab3d8b0f548b17e1169d37 WHIRLPOOL a9fc9d398b31f1b7e11e7d447c1806424d89741f0b8a8a43a910e5a5933f03e1ab21772e3ef4e875eda4612481f02c5f81f8fbb8ee507408ebef521573f0f967
+MISC ChangeLog 3539 SHA256 a6f2d415bc7d45dc1a599887e542c156a85f34ecf6ee5ebf4b6042ce9e6b52d7 SHA512 9e0a201fda0a70f6d0c0358b96e442175fc92f56e7bc202afb85dd50108b4097d4284d572dfa7a8822bf864169d5f108655413d596603d568ea1d4d271b18e18 WHIRLPOOL 11a1bd41ccb635c915e6def78b4d4952453410a4ed806905399f67a2c4ae2941afb9d8a7df5efd2661cd6be9391f57a4dda5b114810765ad62475a4bbc70df0c
+MISC ChangeLog-2015 9637 SHA256 08e62c19dc835915e45e8fa120f7945bbaa3dbeb464ef8dba9b106cc3a9d2e15 SHA512 415e7e6bb7d24c1da939867b751187f96eec3fe10d47c8003d2160644815dd72f07cc278dba6807f7403c2edff166f8db5e6e3c4b5d23153f060210063fa07d8 WHIRLPOOL c5f9422ed04064397d28ac87fe9eb93cc3f669a6384170d95015492b07614e61222e03f064acc36aae0fa4f63741107743f942277fb9743ed9a4dfcd49d54daf
+MISC metadata.xml 389 SHA256 7dbbd869e69acde7899a058507a0db99147052c68f4e630a1f1cdf3d111044f7 SHA512 82ef49bce01041185282168653e951f7fc2b68e6e00a2e604765640b7a5ab3f3f73244ee6837004415612358d89c7347cc7c19df333539b534d04308d8f1b4dd WHIRLPOOL cecca9475a84039019495b6111dfd91e2ea2eb0e835997d15c4b9e15027e5610bbe72db7751d466c93d3450d043ca93a8ff901b2f1664a08c9a8d3ebe2f4b8b2
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
+
diff --git a/app-crypt/trousers/metadata.xml b/app-crypt/trousers/metadata.xml
new file mode 100644
index 000000000000..090e56fab7c0
--- /dev/null
+++ b/app-crypt/trousers/metadata.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>crypto@gentoo.org</email>
+ <name>Crypto</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="cpe">cpe:/a:debian:trousers</remote-id>
+ <remote-id type="sourceforge">trousers</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/app-crypt/trousers/trousers-0.3.14-r1.ebuild b/app-crypt/trousers/trousers-0.3.14-r1.ebuild
new file mode 100644
index 000000000000..0709846429a1
--- /dev/null
+++ b/app-crypt/trousers/trousers-0.3.14-r1.ebuild
@@ -0,0 +1,105 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit autotools linux-info ltprune readme.gentoo-r1 systemd user udev
+
+DESCRIPTION="An open-source TCG Software Stack (TSS) v1.1 implementation"
+HOMEPAGE="http://trousers.sf.net"
+SRC_URI="mirror://sourceforge/trousers/${PN}/${P}.tar.gz"
+
+LICENSE="CPL-1.0 GPL-2"
+SLOT="0"
+KEYWORDS="amd64 arm arm64 ~m68k ~ppc ~ppc64 ~s390 ~sh x86"
+IUSE="doc libressl selinux" # gtk
+
+# gtk support presently does NOT compile.
+# gtk? ( >=x11-libs/gtk+-2 )
+
+CDEPEND=">=dev-libs/glib-2
+ !libressl? ( >=dev-libs/openssl-0.9.7:0 )
+ libressl? ( dev-libs/libressl )
+"
+DEPEND="${CDEPEND}
+ virtual/pkgconfig"
+RDEPEND="${CDEPEND}
+ selinux? ( sec-policy/selinux-tcsd )"
+
+PATCHES=(
+ "${FILESDIR}/${PN}-0.3.13-nouseradd.patch"
+ "${FILESDIR}/${P}-libressl.patch"
+)
+
+DOCS="AUTHORS ChangeLog NICETOHAVES README TODO"
+
+DOC_CONTENTS="
+ If you have problems starting tcsd, please check permissions and
+ ownership on /dev/tpm* and ~tss/system.data
+"
+
+S="${WORKDIR}"
+
+pkg_setup() {
+ # Check for driver (not sure it can be an rdep, because ot depends on the
+ # version of virtual/linux-sources... Is that supported by portage?)
+ linux-info_pkg_setup
+ local tpm_kernel_version tpm_kernel_present tpm_module
+ kernel_is ge 2 6 12 && tpm_kernel_version="yes"
+ if linux_config_exists; then
+ linux_chkconfig_present TCG_TPM && tpm_kernel_present="yes"
+ else
+ ewarn "No kernel configuration could be found."
+ fi
+ has_version app-crypt/tpm-emulator && tpm_module="yes"
+ if [[ -n "${tpm_kernel_present}" ]]; then
+ einfo "Good, you seem to have in-kernel TPM support."
+ elif [[ -n "${tpm_module}" ]]; then
+ einfo "Good, you seem to have TPM support with the external module."
+ if [[ -n "${tpm_kernel_version}" ]]; then
+ elog
+ elog "Note that since you have a >=2.6.12 kernel, you could use"
+ elog "the in-kernel driver instead of (CONFIG_TCG_TPM)."
+ fi
+ elif [[ -n "${tpm_kernel_version}" ]]; then
+ eerror
+ eerror "To use this package, you will have to activate TPM support"
+ eerror "in your kernel configuration. That's at least CONFIG_TCG_TPM,"
+ eerror "plus probably a chip specific driver (like CONFIG_TCG_ATMEL)."
+ eerror
+ else
+ eerror
+ eerror "To use this package, you should install a TPM driver."
+ eerror "You can have the following options:"
+ eerror " - install app-crypt/tpm-emulator"
+ eerror " - switch to a >=2.6.12 kernel and compile the kernel module"
+ eerror
+ fi
+
+ # New user/group for the daemon
+ enewgroup tss
+ enewuser tss -1 -1 /var/lib/tpm tss
+}
+
+src_prepare() {
+ default
+ eautoreconf
+}
+
+src_configure() {
+ # econf --with-gui=$(usex gtk gtk openssl)
+ econf --with-gui=openssl
+}
+
+src_install() {
+ default
+ keepdir /var/lib/tpm
+ use doc && dodoc doc/*
+ newinitd "${FILESDIR}"/tcsd.initd tcsd
+ newconfd "${FILESDIR}"/tcsd.confd tcsd
+ systemd_dounit "${FILESDIR}"/tcsd.service
+ udev_dorules "${FILESDIR}"/61-trousers.rules
+ fowners tss:tss /var/lib/tpm
+ prune_libtool_files
+ readme.gentoo_create_doc
+}