Gentoo Archives: gentoo-commits

From: Alon Bar-Lev <alonbl@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-crypt/tpm-emulator/, app-crypt/tpm-emulator/files/
Date: Sun, 16 Sep 2018 04:40:25
Message-Id: 1537050061.885121cfa0e1704416f3a6490b47a372bb7f2dd0.alonbl@gentoo
1 commit: 885121cfa0e1704416f3a6490b47a372bb7f2dd0
2 Author: Alon Bar-Lev <alonbl <AT> gentoo <DOT> org>
3 AuthorDate: Sat Sep 15 22:18:02 2018 +0000
4 Commit: Alon Bar-Lev <alonbl <AT> gentoo <DOT> org>
5 CommitDate: Sat Sep 15 22:21:01 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=885121cf
7
8 app-crypt/tpm-emulator: cleanup old
9
10 Package-Manager: Portage-2.3.40, Repoman-2.3.9
11
12 app-crypt/tpm-emulator/Manifest | 1 -
13 .../files/tpm-emulator-0.7.4-build.patch | 100 ---------------------
14 .../tpm-emulator/files/tpm-emulator.confd-0.7.4 | 2 -
15 .../tpm-emulator/files/tpm-emulator.initd-0.7.4 | 59 ------------
16 .../tpm-emulator/tpm-emulator-0.7.4-r1.ebuild | 80 -----------------
17 5 files changed, 242 deletions(-)
18
19 diff --git a/app-crypt/tpm-emulator/Manifest b/app-crypt/tpm-emulator/Manifest
20 index ee01c035b31..69569405245 100644
21 --- a/app-crypt/tpm-emulator/Manifest
22 +++ b/app-crypt/tpm-emulator/Manifest
23 @@ -1,2 +1 @@
24 DIST tpm-emulator-0.7.5.tar.gz 222341 BLAKE2B c6dc7494800f4c6d1f5e622c6a47fdd5487e0f2cbc34173d9039d6eb5fd7541dd2c1f514efbf220c605424059844e18650b31ee9934eda6626427b915fd6bc53 SHA512 24c16ec36ca92c484d6e8dfa53c8ca00dbc5b58d78d7166041db1e9ae277d763f0fc0a6b0cbd7e62fcf4671f6ad2d8df1213256be0a4200b79b6ee61ab73b2ef
25 -DIST tpm_emulator-0.7.4.tar.gz 214145 BLAKE2B b8bbd53ecfb90e87f1306c03d2c65a472819d23d10bd63fa966bfadef4776c3876c2f6fc03cc878ece670bdfcd22c9f403ef4bc7f4593a0a6c7f8d17051ac3ba SHA512 4928b5b82f57645be9408362706ff2c4d9baa635b21b0d41b1c82930e8c60a759b1ea4fa74d7e6c7cae1b7692d006aa5cb72df0c3b88bf049779aa2b566f9d35
26
27 diff --git a/app-crypt/tpm-emulator/files/tpm-emulator-0.7.4-build.patch b/app-crypt/tpm-emulator/files/tpm-emulator-0.7.4-build.patch
28 deleted file mode 100644
29 index ada748f7129..00000000000
30 --- a/app-crypt/tpm-emulator/files/tpm-emulator-0.7.4-build.patch
31 +++ /dev/null
32 @@ -1,100 +0,0 @@
33 -From ca99fe81c8aee204c1a8b7f3ca264130e54d9418 Mon Sep 17 00:00:00 2001
34 -From: Alon Bar-Lev <alon.barlev@×××××.com>
35 -Date: Sat, 1 Sep 2018 21:32:07 +0300
36 -Subject: [PATCH] tpm: tpm_deprecated.c fix compare
37 -MIME-Version: 1.0
38 -Content-Type: text/plain; charset=UTF-8
39 -Content-Transfer-Encoding: 8bit
40 -
41 -tpm/tpm_deprecated.c:437:7: error: ‘__builtin_memcmp_eq’ reading 20 bytes from a region of size 8 [-Werror=stringop-overflow=]
42 - if (memcmp(&b1, &newAuthLink, sizeof(TPM_HMAC))) {
43 - ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
44 -cc1: all warnings being treated as errors
45 -
46 -Bug: https://bugs.gentoo.org/show_bug.cgi?id=664198
47 ----
48 - tpm/tpm_deprecated.c | 2 +-
49 - 1 file changed, 1 insertion(+), 1 deletion(-)
50 -
51 -diff --git a/tpm/tpm_deprecated.c b/tpm/tpm_deprecated.c
52 -index c362b56..4c49f54 100644
53 ---- a/tpm/tpm_deprecated.c
54 -+++ b/tpm/tpm_deprecated.c
55 -@@ -434,7 +434,7 @@ TPM_RESULT TPM_ChangeAuthAsymFinish(TPM_KEY_HANDLE parentHandle,
56 - tpm_hmac_final(&hmac_ctx, b1.digest);
57 - /* 6. The TPM SHALL compare b1 with newAuthLink. The TPM SHALL
58 - indicate a failure if the values do not match. */
59 -- if (memcmp(&b1, &newAuthLink, sizeof(TPM_HMAC))) {
60 -+ if (memcmp(&b1, newAuthLink, sizeof(TPM_HMAC))) {
61 - debug("TPM_ChangeAuthAsymFinish(): newAuthLink value does not match.");
62 - return TPM_FAIL;
63 - }
64 -From 035af1df2b18afd695150c6f9e426133b775c0a1 Mon Sep 17 00:00:00 2001
65 -From: Florian Larysch <fl@××××.de>
66 -Date: Tue, 24 Oct 2017 19:33:00 +0200
67 -Subject: [PATCH] tpm_command_handler: fix switch fallthrough
68 -MIME-Version: 1.0
69 -Content-Type: text/plain; charset=UTF-8
70 -Content-Transfer-Encoding: 8bit
71 -
72 -Compiling with a recent GCC fails as follows:
73 -
74 - tpm-emulator/tpm/tpm_cmd_handler.c: In function ‘tpm_setup_rsp_auth’:
75 - tpm-emulator/tpm/tpm_cmd_handler.c:3332:7: error: this statement may fall through [-Werror=implicit-fallthrough=]
76 - tpm_hmac_final(&hmac, rsp->auth2->auth);
77 - ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
78 - tpm-emulator/tpm/tpm_cmd_handler.c:3333:5: note: here
79 - case TPM_TAG_RSP_AUTH1_COMMAND:
80 -
81 -Looking at the code, this does indeed seem unintentional. Add a break
82 -state in the appropriate place.
83 ----
84 - tpm/tpm_cmd_handler.c | 1 +
85 - 1 file changed, 1 insertion(+)
86 -
87 -diff --git a/tpm/tpm_cmd_handler.c b/tpm/tpm_cmd_handler.c
88 -index 288d1ce..5aea4e7 100644
89 ---- a/tpm/tpm_cmd_handler.c
90 -+++ b/tpm/tpm_cmd_handler.c
91 -@@ -3330,6 +3330,7 @@ static void tpm_setup_rsp_auth(TPM_COMMAND_CODE ordinal, TPM_RESPONSE *rsp)
92 - sizeof(rsp->auth2->nonceOdd.nonce));
93 - tpm_hmac_update(&hmac, (BYTE*)&rsp->auth2->continueAuthSession, 1);
94 - tpm_hmac_final(&hmac, rsp->auth2->auth);
95 -+ break;
96 - case TPM_TAG_RSP_AUTH1_COMMAND:
97 - tpm_hmac_init(&hmac, rsp->auth1->secret, sizeof(rsp->auth1->secret));
98 - tpm_hmac_update(&hmac, rsp->auth1->digest, sizeof(rsp->auth1->digest));
99 ---
100 -2.16.4
101 -
102 -From 0f4579e913aeb3a893631a3caee420a0e9803683 Mon Sep 17 00:00:00 2001
103 -From: Peter Huewe <peterhuewe@×××.de>
104 -Date: Mon, 26 Jun 2017 00:25:43 +0200
105 -Subject: [PATCH] Workaround wrong fallthrough case by returning TPM_FAIL
106 -
107 -The spec says that the number of verified PCRs should be returned - which it currently does not and breaks compilation with gcc7
108 -See #26
109 -Since this code is probably unused anyway, we now simply return TPM_FAIL until someone comes up with a solution.
110 -
111 -Spec:
112 -https://www.trustedcomputinggroup.org/wp-content/uploads/Revision_7.02-_29April2010-tcg-mobile-trusted-module-1.0.pdf
113 ----
114 - mtm/mtm_capability.c | 2 ++
115 - 1 file changed, 2 insertions(+)
116 -
117 -diff --git a/mtm/mtm_capability.c b/mtm/mtm_capability.c
118 -index a09b116..4046de5 100644
119 ---- a/mtm/mtm_capability.c
120 -+++ b/mtm/mtm_capability.c
121 -@@ -87,6 +87,8 @@ static TPM_RESULT cap_mtm_permanent_data(UINT32 subCapSize, BYTE *subCap,
122 - tpm_free(*resp);
123 - return TPM_FAIL;
124 - }
125 -+ error("[TPM_CAP_MTM_PERMANENT_DATA] SubCap 2 not Implemented");
126 -+ return TPM_FAIL; // TODO not implemented.
127 -
128 - case 3:
129 - return return_UINT32(respSize, resp,
130 ---
131 -2.16.4
132 -
133
134 diff --git a/app-crypt/tpm-emulator/files/tpm-emulator.confd-0.7.4 b/app-crypt/tpm-emulator/files/tpm-emulator.confd-0.7.4
135 deleted file mode 100644
136 index da24e57840b..00000000000
137 --- a/app-crypt/tpm-emulator/files/tpm-emulator.confd-0.7.4
138 +++ /dev/null
139 @@ -1,2 +0,0 @@
140 -STARTUP_MODE="save"
141 -#DEBUG="true"
142
143 diff --git a/app-crypt/tpm-emulator/files/tpm-emulator.initd-0.7.4 b/app-crypt/tpm-emulator/files/tpm-emulator.initd-0.7.4
144 deleted file mode 100644
145 index 8d5b9be561b..00000000000
146 --- a/app-crypt/tpm-emulator/files/tpm-emulator.initd-0.7.4
147 +++ /dev/null
148 @@ -1,59 +0,0 @@
149 -#!/sbin/openrc-run
150 -# Copyright 1999-2012 Gentoo Foundation
151 -# Distributed under the terms of the GNU General Public License, v2 or later
152 -
153 -STARTUP_MODE='save';
154 -
155 -extra_started_commands="clear save deactivated"
156 -command="/usr/bin/tpmd"
157 -command_args="-o tss -g tss"
158 -
159 -depend() {
160 - use logger
161 - after coldplug
162 -}
163 -
164 -checkconfig() {
165 - lsmod | grep -q "^tpmd_dev\b" \
166 - || modprobe tpmd_dev &>/dev/null \
167 - || eerror "Failed to load module tpmd_dev";
168 -
169 - if [ ! -c /dev/tpm ] && [ ! -c /dev/tpm0 ] ; then
170 - eerror "No TPM device found!"
171 - return 1
172 - fi
173 - return 0
174 -}
175 -
176 -start() {
177 - ebegin "Starting tpm-emulator daemon with mode '$STARTUP_MODE' (tpmd)"
178 - checkconfig || eend $?
179 - checkpath -d -m 0775 -o tss /var/run/tpm
180 - start-stop-daemon --start --exec "${command}" -- ${command_args} $STARTUP_MODE > /dev/null
181 - eend $?
182 -}
183 -
184 -stop() {
185 - ebegin "Stopping tpm-emulator daemon (tpmd)"
186 - start-stop-daemon --stop --exec "${command}" -- ${command_args} > /dev/null
187 - eend $?
188 -}
189 -
190 -clear() {
191 - STARTUP_MODE='clear';
192 - stop
193 - start
194 -}
195 -
196 -save() {
197 - STARTUP_MODE='save';
198 - stop
199 - start
200 -}
201 -
202 -deactivated() {
203 - STARTUP_MODE='deactivated';
204 - stop
205 - start
206 -}
207 -
208
209 diff --git a/app-crypt/tpm-emulator/tpm-emulator-0.7.4-r1.ebuild b/app-crypt/tpm-emulator/tpm-emulator-0.7.4-r1.ebuild
210 deleted file mode 100644
211 index 6fc770390fc..00000000000
212 --- a/app-crypt/tpm-emulator/tpm-emulator-0.7.4-r1.ebuild
213 +++ /dev/null
214 @@ -1,80 +0,0 @@
215 -# Copyright 1999-2018 Gentoo Foundation
216 -# Distributed under the terms of the GNU General Public License v2
217 -
218 -EAPI=6
219 -MODULES_OPTIONAL_USE="modules"
220 -inherit flag-o-matic user linux-mod cmake-utils udev
221 -
222 -MY_P=${P/-/_}
223 -DESCRIPTION="Emulator driver for tpm"
224 -HOMEPAGE="https://sourceforge.net/projects/tpm-emulator.berlios/"
225 -SRC_URI="mirror://sourceforge/tpm-emulator/${MY_P}.tar.gz"
226 -LICENSE="GPL-2"
227 -
228 -SLOT="0"
229 -KEYWORDS="~amd64 ~x86"
230 -
231 -IUSE="libressl ssl"
232 -RDEPEND="ssl? (
233 - !libressl? ( dev-libs/openssl:0= )
234 - libressl? ( dev-libs/libressl:0= )
235 - )"
236 -DEPEND="${RDEPEND}
237 - !ssl? ( dev-libs/gmp )"
238 -
239 -S=${WORKDIR}/${P/-/_}
240 -
241 -PATCHES=(
242 - "${FILESDIR}/${P}-build.patch"
243 -)
244 -
245 -pkg_setup() {
246 - enewgroup tss
247 - enewuser tss -1 -1 /var/lib/tpm tss
248 - if use modules; then
249 - CONFIG_CHECK="MODULES"
250 - linux-mod_pkg_setup
251 - BUILD_TARGETS="all"
252 - BUILD_PARAMS="KERNEL_BUILD=${KERNEL_DIR}"
253 - fi
254 -}
255 -
256 -src_prepare() {
257 - cmake-utils_src_prepare
258 -
259 - # do not build and install the kernel module
260 - sed -i 's/COMMAND ${tpmd_dev_BUILD_CMD}//' tpmd_dev/CMakeLists.txt || die
261 - sed -i 's/install(CODE.*//' tpmd_dev/CMakeLists.txt || die
262 -}
263 -
264 -src_configure() {
265 - local mycmakeargs=(
266 - -DUSE_OPENSSL=$(usex ssl)
267 - )
268 - append-cflags -Wno-implicit-fallthrough
269 - cmake-utils_src_configure
270 -
271 - # only here we have BUILD_DIR
272 - MODULE_NAMES="tpmd_dev(misc:${BUILD_DIR}/tpmd_dev/linux)"
273 -}
274 -
275 -src_compile() {
276 - cmake-utils_src_compile
277 - use modules && linux-mod_src_compile
278 - emake -C "${BUILD_DIR}/tpmd_dev/linux" tpmd_dev.rules
279 -}
280 -
281 -src_install() {
282 - cmake-utils_src_install
283 - use modules && linux-mod_src_install
284 -
285 - dodoc README
286 -
287 - udev_newrules "${BUILD_DIR}/tpmd_dev/linux/tpmd_dev.rules" 60-tpmd_dev.rules
288 -
289 - newinitd "${FILESDIR}"/${PN}.initd-0.7.4 ${PN}
290 - newconfd "${FILESDIR}"/${PN}.confd-0.7.4 ${PN}
291 -
292 - keepdir /var/log/tpm
293 - fowners tss:tss /var/log/tpm
294 -}