mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 02:01:24 +01:00
vtpmmgr: Store hardware TPM Locality
The TPM locality must be specified when using TPM_PCR_INFO_LONG for TPM_Seal. Store the locality so it can be provided later. Signed-off-by: Jason Andryuk <andryuk@aero.org> Acked-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
This commit is contained in:
1 parent
ffa11862aa
commit
d426026701
2 files changed
+5
-1
No files matched your search
@@ -69,7 +69,8 @@ const TPM_AUTHDATA WELLKNOWN_AUTH = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0
|
||||
|
||||
struct vtpm_globals vtpm_globals = {
|
||||
.tpm_fd = -1,
|
||||
.oiap = { .AuthHandle = 0 }
|
||||
.oiap = { .AuthHandle = 0 },
|
||||
.hw_locality = 0
|
||||
};
|
||||
|
||||
static int tpm_entropy_source(void* dummy, unsigned char* data, size_t len, size_t* olen) {
|
||||
@@ -436,6 +437,7 @@ TPM_RESULT vtpmmgr_init(int argc, char** argv) {
|
||||
}
|
||||
vtpm_globals.tpm_fd = tpm_tis_open(tpm);
|
||||
tpm_tis_request_locality(tpm, opts.tpmlocality);
|
||||
vtpm_globals.hw_locality = opts.tpmlocality;
|
||||
}
|
||||
break;
|
||||
case TPMDRV_TPMFRONT:
|
||||
|
||||
@@ -57,6 +57,8 @@ struct vtpm_globals {
|
||||
|
||||
entropy_context entropy;
|
||||
ctr_drbg_context ctr_drbg;
|
||||
|
||||
int hw_locality;
|
||||
};
|
||||
|
||||
struct tpm_opaque {
|
||||
|
||||