ia64/xen-unstable
changeset 15922:3ce70f7312d9
[VTPM] Fix vTPM function in HVM domain
In Windows on HVM domain, GetPubkey function and Seal function become
an error.
Signed-off-by: Kouichi YASAKI <yasaki.kouichi@jp.fujitsu.com>
In Windows on HVM domain, GetPubkey function and Seal function become
an error.
Signed-off-by: Kouichi YASAKI <yasaki.kouichi@jp.fujitsu.com>
author | kfraser@localhost.localdomain |
---|---|
date | Tue Sep 18 15:05:38 2007 +0100 (2007-09-18) |
parents | 15babb02bc75 |
children | da8b8fbe26c2 |
files | tools/vtpm/tpm_emulator.patch |
line diff
1.1 --- a/tools/vtpm/tpm_emulator.patch Tue Sep 18 14:59:25 2007 +0100 1.2 +++ b/tools/vtpm/tpm_emulator.patch Tue Sep 18 15:05:38 2007 +0100 1.3 @@ -547,10 +547,31 @@ 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_cmd_handler.c tpm_emulator/tpm/tpm_cmd_handler.c 1.8 +--- orig/tpm_emulator-0.4/tpm/tpm_cmd_handler.c 2006-06-23 19:37:07.000000000 +0900 1.9 ++++ tpm_emulator/tpm/tpm_cmd_handler.c 2007-09-12 20:23:00.000000000 +0900 1.10 +@@ -565,7 +565,7 @@ static TPM_RESULT execute_TPM_Seal(TPM_R 1.11 + if (tpm_unmarshal_TPM_KEY_HANDLE(&ptr, &len, &keyHandle) 1.12 + || tpm_unmarshal_TPM_ENCAUTH(&ptr, &len, &encAuth) 1.13 + || tpm_unmarshal_UINT32(&ptr, &len, &pcrInfoSize) 1.14 +- || tpm_unmarshal_TPM_PCR_INFO(&ptr, &len, &pcrInfo) 1.15 ++ || (pcrInfoSize >0 && tpm_unmarshal_TPM_PCR_INFO(&ptr, &len, &pcrInfo)) 1.16 + || tpm_unmarshal_UINT32(&ptr, &len, &inDataSize) 1.17 + || tpm_unmarshal_BLOB(&ptr, &len, &inData, inDataSize) 1.18 + || len != 0) return TPM_BAD_PARAMETER; 1.19 +@@ -798,7 +798,7 @@ static TPM_RESULT execute_TPM_Sealx(TPM_ 1.20 + if (tpm_unmarshal_TPM_KEY_HANDLE(&ptr, &len, &keyHandle) 1.21 + || tpm_unmarshal_TPM_ENCAUTH(&ptr, &len, &encAuth) 1.22 + || tpm_unmarshal_UINT32(&ptr, &len, &pcrInfoSize) 1.23 +- || tpm_unmarshal_TPM_PCR_INFO(&ptr, &len, &pcrInfo) 1.24 ++ || (pcrInfoSize > 0 && tpm_unmarshal_TPM_PCR_INFO(&ptr, &len, &pcrInfo)) 1.25 + || tpm_unmarshal_UINT32(&ptr, &len, &inDataSize) 1.26 + || tpm_unmarshal_BLOB(&ptr, &len, &inData, inDataSize) 1.27 + || len != 0) return TPM_BAD_PARAMETER; 1.28 diff -uprN orig/tpm_emulator-0.4/tpm/tpm_credentials.c tpm_emulator/tpm/tpm_credentials.c 1.29 ---- orig/tpm_emulator-0.4/tpm/tpm_credentials.c 2006-06-23 03:37:07.000000000 -0700 1.30 -+++ tpm_emulator/tpm/tpm_credentials.c 2006-07-24 14:35:35.000000000 -0700 1.31 -@@ -47,16 +47,16 @@ int tpm_compute_pubkey_checksum(TPM_NONC 1.32 +--- orig/tpm_emulator-0.4/tpm/tpm_credentials.c 2006-06-23 19:37:07.000000000 +0900 1.33 ++++ tpm_emulator/tpm/tpm_credentials.c 2007-09-12 20:23:30.000000000 +0900 1.34 +@@ -47,20 +47,20 @@ int tpm_compute_pubkey_checksum(TPM_NONC 1.35 1.36 TPM_RESULT tpm_get_pubek(TPM_PUBKEY *pubEndorsementKey) 1.37 { 1.38 @@ -572,6 +593,11 @@ diff -uprN orig/tpm_emulator-0.4/tpm/tpm 1.39 pubEndorsementKey->algorithmParms.algorithmID = TPM_ALG_RSA; 1.40 pubEndorsementKey->algorithmParms.encScheme = TPM_ES_RSAESOAEP_SHA1_MGF1; 1.41 pubEndorsementKey->algorithmParms.sigScheme = TPM_SS_NONE; 1.42 +- pubEndorsementKey->algorithmParms.parms.rsa.keyLength = key_length; 1.43 ++ pubEndorsementKey->algorithmParms.parms.rsa.keyLength = key_length << 3; 1.44 + pubEndorsementKey->algorithmParms.parms.rsa.numPrimes = 2; 1.45 + pubEndorsementKey->algorithmParms.parms.rsa.exponentSize = 0; 1.46 + pubEndorsementKey->algorithmParms.parms.rsa.exponent = NULL; 1.47 @@ -175,6 +175,7 @@ TPM_RESULT TPM_OwnerReadInternalPub(TPM_ 1.48 { 1.49 TPM_RESULT res;