Skip to content

Commit 175788d

Browse files
committed
Merge remote-tracking branch 'remotes/stefanberger/tags/pull-tpm-2020-07-15-1' into staging
Merge tpm 2020/07/15 v1 # gpg: Signature made Wed 15 Jul 2020 20:16:21 BST # gpg: using RSA key B818B9CADF9089C2D5CEC66B75AD65802A0B4211 # gpg: Good signature from "Stefan Berger <[email protected]>" [unknown] # gpg: WARNING: This key is not certified with a trusted signature! # gpg: There is no indication that the signature belongs to the owner. # Primary key fingerprint: B818 B9CA DF90 89C2 D5CE C66B 75AD 6580 2A0B 4211 * remotes/stefanberger/tags/pull-tpm-2020-07-15-1: tests: tpm: Skip over pcrUpdateCounter byte in result comparison tpm: tpm_spapr: Exit on TPM backend failures Signed-off-by: Peter Maydell <[email protected]>
2 parents ee5128b + df8a756 commit 175788d

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

hw/tpm/tpm_spapr.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,10 @@ static void tpm_spapr_reset(SpaprVioDevice *dev)
306306
TPM_SPAPR_BUFFER_MAX);
307307

308308
tpm_backend_reset(s->be_driver);
309-
tpm_spapr_do_startup_tpm(s, s->be_buffer_size);
309+
310+
if (tpm_spapr_do_startup_tpm(s, s->be_buffer_size) < 0) {
311+
exit(1);
312+
}
310313
}
311314

312315
static enum TPMVersion tpm_spapr_get_version(TPMIf *ti)

tests/qtest/tpm-util.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,11 @@ void tpm_util_pcrread(QTestState *s, tx_func *tx,
139139

140140
tx(s, tpm_pcrread, sizeof(tpm_pcrread), buffer, sizeof(buffer));
141141

142-
g_assert_cmpmem(buffer, exp_resp_size, exp_resp, exp_resp_size);
142+
/* skip pcrUpdateCounter (14th byte) in comparison */
143+
g_assert(exp_resp_size >= 15);
144+
g_assert_cmpmem(buffer, 13, exp_resp, 13);
145+
g_assert_cmpmem(&buffer[14], exp_resp_size - 14,
146+
&exp_resp[14], exp_resp_size - 14);
143147
}
144148

145149
bool tpm_util_swtpm_has_tpm2(void)

0 commit comments

Comments
 (0)