ia64/xen-unstable

changeset 16675:688e9186eed4

vtpm: Fix GetCapabilityOwner function

GetCapabilityOwner function's behavior is different from that of a
real tpm device. By the difference, a TPM Manager in an HVM domain
could not detect whether TPM device has an owner or not.

Signed-off-by: Kouichi YASAKI <yasaki.kouichi@jp.fujitsu.com>
author Keir Fraser <keir.fraser@citrix.com>
date Sat Dec 29 17:52:34 2007 +0000 (2007-12-29)
parents ad0f20f5590a
children 43aab98aef60
files tools/vtpm/tpm_emulator.patch
line diff
     1.1 --- a/tools/vtpm/tpm_emulator.patch	Fri Dec 28 15:44:51 2007 +0000
     1.2 +++ b/tools/vtpm/tpm_emulator.patch	Sat Dec 29 17:52:34 2007 +0000
     1.3 @@ -547,6 +547,21 @@ diff -uprN orig/tpm_emulator-0.4/README 
     1.4   Installation
     1.5   --------------------------------------------------------------------------
     1.6   The compilation and installation process uses the build environment for 
     1.7 +diff -uprN orig/tpm_emulator-0.4/tpm/tpm_capability.c tpm_emulator/tpm/tpm_capability.c
     1.8 +--- orig/tpm_emulator-0.4/tpm/tpm_capability.c	2006-06-23 19:37:07.000000000 +0900
     1.9 ++++ tpm_emulator/tpm/tpm_capability.c	2007-12-28 22:50:19.000000000 +0900
    1.10 +@@ -701,7 +701,10 @@ TPM_RESULT TPM_GetCapabilityOwner(TPM_VE
    1.11 +   TPM_RESULT res;
    1.12 +   
    1.13 +   info("TPM_GetCapabilityOwner()");
    1.14 +-  
    1.15 ++ 
    1.16 ++  if (!tpmData.permanent.flags.owned) {
    1.17 ++    return TPM_NOSRK;
    1.18 ++  } 
    1.19 +   /* Verify owner authorization */
    1.20 +   res = tpm_verify_auth(auth1, tpmData.permanent.data.ownerAuth, TPM_KH_OWNER);
    1.21 +   if (res != TPM_SUCCESS) return res;
    1.22  diff -uprN orig/tpm_emulator-0.4/tpm/tpm_cmd_handler.c tpm_emulator/tpm/tpm_cmd_handler.c
    1.23  --- orig/tpm_emulator-0.4/tpm/tpm_cmd_handler.c	2006-06-23 19:37:07.000000000 +0900
    1.24  +++ tpm_emulator/tpm/tpm_cmd_handler.c	2007-09-12 20:23:00.000000000 +0900