summaryrefslogtreecommitdiffstats
path: root/recipes-extended/xen/files/vtpm_TPM_ChangeAuthAsymFinish.patch
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-extended/xen/files/vtpm_TPM_ChangeAuthAsymFinish.patch')
-rw-r--r--recipes-extended/xen/files/vtpm_TPM_ChangeAuthAsymFinish.patch28
1 files changed, 28 insertions, 0 deletions
diff --git a/recipes-extended/xen/files/vtpm_TPM_ChangeAuthAsymFinish.patch b/recipes-extended/xen/files/vtpm_TPM_ChangeAuthAsymFinish.patch
new file mode 100644
index 00000000..aefca284
--- /dev/null
+++ b/recipes-extended/xen/files/vtpm_TPM_ChangeAuthAsymFinish.patch
@@ -0,0 +1,28 @@
1Patch derived from below Xen changeset.
2Signed-off-by: Christopher Clark <christopher.clark6@baesystems.com>
3
4commit 22bf5be3237cb482a2ffd772ffd20ce37285eebf
5Author: Olaf Hering <olaf@aepfle.de>
6Date: Mon Jun 18 14:55:36 2018 +0200
7
8stubdom/vtpm: fix memcmp in TPM_ChangeAuthAsymFinish
9
10gcc8 spotted this error:
11error: 'memcmp' reading 20 bytes from a region of size 8 [-Werror=stringop-overflow=]
12
13Signed-off-by: Olaf Hering <olaf@aepfle.de>
14Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
15
16diff --git a/tpm/tpm_deprecated.c b/tpm/tpm_deprecated.c
17index c362b56..4c49f54 100644
18--- a/tpm/tpm_deprecated.c
19+++ b/tpm/tpm_deprecated.c
20@@ -434,7 +434,7 @@ TPM_RESULT TPM_ChangeAuthAsymFinish(TPM_KEY_HANDLE parentHandle,
21 tpm_hmac_final(&hmac_ctx, b1.digest);
22 /* 6. The TPM SHALL compare b1 with newAuthLink. The TPM SHALL
23 indicate a failure if the values do not match. */
24- if (memcmp(&b1, &newAuthLink, sizeof(TPM_HMAC))) {
25+ if (memcmp(&b1, newAuthLink, sizeof(TPM_HMAC))) {
26 debug("TPM_ChangeAuthAsymFinish(): newAuthLink value does not match.");
27 return TPM_FAIL;
28 }