]> xenbits.xensource.com Git - people/liuw/stubdom.git/commitdiff
vtpmmgr: Store hardware TPM Locality
authorJason Andryuk <andryuk@aero.org>
Mon, 21 Apr 2014 17:22:59 +0000 (13:22 -0400)
committerIan Campbell <ian.campbell@citrix.com>
Wed, 23 Apr 2014 10:57:53 +0000 (11:57 +0100)
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>
vtpmmgr/init.c
vtpmmgr/vtpmmgr.h

index 89643e7bab017477b20bf54d60f10a53078a6613..c35ab8fe7b12f2517fa733d85b141f02d8e3ebbd 100644 (file)
@@ -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:
index cf2b9629a0789f9198e92c0000084aecdc9a6981..68edd4cf613ea3f879a7ea56ad07954ef2d2a406 100644 (file)
@@ -57,6 +57,8 @@ struct vtpm_globals {
 
    entropy_context     entropy;
    ctr_drbg_context    ctr_drbg;
+
+   int hw_locality;
 };
 
 struct tpm_opaque {