1 |
commit: b220ce5e246cfee6691af027c86045a9d1fffe21 |
2 |
Author: Alon Bar-Lev <alonbl <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sun Sep 9 08:14:32 2018 +0000 |
4 |
Commit: Alon Bar-Lev <alonbl <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun Sep 9 08:15:58 2018 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b220ce5e |
7 |
|
8 |
app-crypt/tpm-emulator: fix incorrect memcpy |
9 |
|
10 |
Closes: https://bugs.gentoo.org/show_bug.cgi?id=664198 |
11 |
Package-Manager: Portage-2.3.40, Repoman-2.3.9 |
12 |
|
13 |
.../files/tpm-emulator-0.7.4-build.patch | 31 ++++++++++++++++++++++ |
14 |
.../tpm-emulator/tpm-emulator-0.7.4-r1.ebuild | 4 +++ |
15 |
2 files changed, 35 insertions(+) |
16 |
|
17 |
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 |
18 |
new file mode 100644 |
19 |
index 00000000000..7a299a15fbf |
20 |
--- /dev/null |
21 |
+++ b/app-crypt/tpm-emulator/files/tpm-emulator-0.7.4-build.patch |
22 |
@@ -0,0 +1,31 @@ |
23 |
+From ca99fe81c8aee204c1a8b7f3ca264130e54d9418 Mon Sep 17 00:00:00 2001 |
24 |
+From: Alon Bar-Lev <alon.barlev@×××××.com> |
25 |
+Date: Sat, 1 Sep 2018 21:32:07 +0300 |
26 |
+Subject: [PATCH] tpm: tpm_deprecated.c fix compare |
27 |
+MIME-Version: 1.0 |
28 |
+Content-Type: text/plain; charset=UTF-8 |
29 |
+Content-Transfer-Encoding: 8bit |
30 |
+ |
31 |
+tpm/tpm_deprecated.c:437:7: error: ‘__builtin_memcmp_eq’ reading 20 bytes from a region of size 8 [-Werror=stringop-overflow=] |
32 |
+ if (memcmp(&b1, &newAuthLink, sizeof(TPM_HMAC))) { |
33 |
+ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
34 |
+cc1: all warnings being treated as errors |
35 |
+ |
36 |
+Bug: https://bugs.gentoo.org/show_bug.cgi?id=664198 |
37 |
+--- |
38 |
+ tpm/tpm_deprecated.c | 2 +- |
39 |
+ 1 file changed, 1 insertion(+), 1 deletion(-) |
40 |
+ |
41 |
+diff --git a/tpm/tpm_deprecated.c b/tpm/tpm_deprecated.c |
42 |
+index c362b56..4c49f54 100644 |
43 |
+--- a/tpm/tpm_deprecated.c |
44 |
++++ b/tpm/tpm_deprecated.c |
45 |
+@@ -434,7 +434,7 @@ TPM_RESULT TPM_ChangeAuthAsymFinish(TPM_KEY_HANDLE parentHandle, |
46 |
+ tpm_hmac_final(&hmac_ctx, b1.digest); |
47 |
+ /* 6. The TPM SHALL compare b1 with newAuthLink. The TPM SHALL |
48 |
+ indicate a failure if the values do not match. */ |
49 |
+- if (memcmp(&b1, &newAuthLink, sizeof(TPM_HMAC))) { |
50 |
++ if (memcmp(&b1, newAuthLink, sizeof(TPM_HMAC))) { |
51 |
+ debug("TPM_ChangeAuthAsymFinish(): newAuthLink value does not match."); |
52 |
+ return TPM_FAIL; |
53 |
+ } |
54 |
|
55 |
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 |
56 |
index 0192de92e2f..6fc770390fc 100644 |
57 |
--- a/app-crypt/tpm-emulator/tpm-emulator-0.7.4-r1.ebuild |
58 |
+++ b/app-crypt/tpm-emulator/tpm-emulator-0.7.4-r1.ebuild |
59 |
@@ -24,6 +24,10 @@ DEPEND="${RDEPEND} |
60 |
|
61 |
S=${WORKDIR}/${P/-/_} |
62 |
|
63 |
+PATCHES=( |
64 |
+ "${FILESDIR}/${P}-build.patch" |
65 |
+) |
66 |
+ |
67 |
pkg_setup() { |
68 |
enewgroup tss |
69 |
enewuser tss -1 -1 /var/lib/tpm tss |