summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlon Bar-Lev <alonbl@gentoo.org>2018-09-09 11:14:32 +0300
committerAlon Bar-Lev <alonbl@gentoo.org>2018-09-09 11:15:58 +0300
commitb220ce5e246cfee6691af027c86045a9d1fffe21 (patch)
tree2b3265916c3ea49ed732bde0da6c07da02d99fae /app-crypt/tpm-emulator
parentapp-arch/innoextract: amd64 stable wrt bug #665486 (diff)
downloadgentoo-b220ce5e246cfee6691af027c86045a9d1fffe21.tar.gz
gentoo-b220ce5e246cfee6691af027c86045a9d1fffe21.tar.bz2
gentoo-b220ce5e246cfee6691af027c86045a9d1fffe21.zip
app-crypt/tpm-emulator: fix incorrect memcpy
Closes: https://bugs.gentoo.org/show_bug.cgi?id=664198 Package-Manager: Portage-2.3.40, Repoman-2.3.9
Diffstat (limited to 'app-crypt/tpm-emulator')
-rw-r--r--app-crypt/tpm-emulator/files/tpm-emulator-0.7.4-build.patch31
-rw-r--r--app-crypt/tpm-emulator/tpm-emulator-0.7.4-r1.ebuild4
2 files changed, 35 insertions, 0 deletions
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
new file mode 100644
index 000000000000..7a299a15fbf5
--- /dev/null
+++ b/app-crypt/tpm-emulator/files/tpm-emulator-0.7.4-build.patch
@@ -0,0 +1,31 @@
+From ca99fe81c8aee204c1a8b7f3ca264130e54d9418 Mon Sep 17 00:00:00 2001
+From: Alon Bar-Lev <alon.barlev@gmail.com>
+Date: Sat, 1 Sep 2018 21:32:07 +0300
+Subject: [PATCH] tpm: tpm_deprecated.c fix compare
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+tpm/tpm_deprecated.c:437:7: error: ‘__builtin_memcmp_eq’ reading 20 bytes from a region of size 8 [-Werror=stringop-overflow=]
+ if (memcmp(&b1, &newAuthLink, sizeof(TPM_HMAC))) {
+ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+cc1: all warnings being treated as errors
+
+Bug: https://bugs.gentoo.org/show_bug.cgi?id=664198
+---
+ tpm/tpm_deprecated.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/tpm/tpm_deprecated.c b/tpm/tpm_deprecated.c
+index c362b56..4c49f54 100644
+--- a/tpm/tpm_deprecated.c
++++ b/tpm/tpm_deprecated.c
+@@ -434,7 +434,7 @@ TPM_RESULT TPM_ChangeAuthAsymFinish(TPM_KEY_HANDLE parentHandle,
+ tpm_hmac_final(&hmac_ctx, b1.digest);
+ /* 6. The TPM SHALL compare b1 with newAuthLink. The TPM SHALL
+ indicate a failure if the values do not match. */
+- if (memcmp(&b1, &newAuthLink, sizeof(TPM_HMAC))) {
++ if (memcmp(&b1, newAuthLink, sizeof(TPM_HMAC))) {
+ debug("TPM_ChangeAuthAsymFinish(): newAuthLink value does not match.");
+ return TPM_FAIL;
+ }
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
index 0192de92e2f6..6fc770390fcf 100644
--- a/app-crypt/tpm-emulator/tpm-emulator-0.7.4-r1.ebuild
+++ b/app-crypt/tpm-emulator/tpm-emulator-0.7.4-r1.ebuild
@@ -24,6 +24,10 @@ DEPEND="${RDEPEND}
S=${WORKDIR}/${P/-/_}
+PATCHES=(
+ "${FILESDIR}/${P}-build.patch"
+)
+
pkg_setup() {
enewgroup tss
enewuser tss -1 -1 /var/lib/tpm tss