[prev in list] [next in list] [prev in thread] [next in thread] 

List:       trousers-tech
Subject:    [TrouSerS-tech] [PATCH 2/2] trousers: fixed
From:       Roberto Sassu <roberto.sassu () polito ! it>
Date:       2011-12-07 15:01:18
Message-ID: 1323270080-9590-2-git-send-email-roberto.sassu () polito ! it
[Download RAW message or body]

This is an S/MIME signed message

[Attachment #2 (multipart/signed)]
This is an S/MIME signed message

This patch adds the necessary code in Tspi_Context_LoadKeyByUUID() for
determining the correct loadkey ordinal (it depends on the TPM version).
This information is used later in the function secret_PerformAuth_OIAP()
to set the authentication data in the TCS_LOADKEY_INFO structure, needed
to load the parent key.

Signed-off-by: Roberto Sassu <roberto.sassu@polito.it>
---
 src/tspi/tspi_ps.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/src/tspi/tspi_ps.c b/src/tspi/tspi_ps.c
index 5aa6ea8..b6df78c 100644
--- a/src/tspi/tspi_ps.c
+++ b/src/tspi/tspi_ps.c
@@ -44,6 +44,7 @@ Tspi_Context_LoadKeyByUUID(TSS_HCONTEXT tspContext,		/* in */
 	TCS_LOADKEY_INFO info;
 	UINT32		ulPubKeyLength;
 	BYTE		*rgbPubKey;
+	TPM_COMMAND_CODE ordinal;
 
 	if (phKey == NULL)
 		return TSPERR(TSS_E_BAD_PARAMETER);
@@ -51,6 +52,9 @@ Tspi_Context_LoadKeyByUUID(TSS_HCONTEXT tspContext,		/* in */
 	if ((!obj_is_context(tspContext)))
 		return TSPERR(TSS_E_INVALID_HANDLE);
 
+	if ((result = obj_context_get_loadkey_ordinal(tspContext, &ordinal)))
+		return result;
+
 	/* This key is in the System Persistant storage */
 	if (persistentStorageType == TSS_PS_TYPE_SYSTEM) {
 #if 1
@@ -78,7 +82,7 @@ Tspi_Context_LoadKeyByUUID(TSS_HCONTEXT tspContext,		/* in */
 						  &hPolicy, NULL))
 				return result;
 
-			if (secret_PerformAuth_OIAP(keyHandle, TPM_ORD_LoadKey, hPolicy, FALSE,
+			if (secret_PerformAuth_OIAP(keyHandle, ordinal, hPolicy, FALSE,
 						    &info.paramDigest, &info.authData))
 				return result;
 
-- 
1.7.6.4


["smime.p7s" (application/x-pkcs7-signature)]

------------------------------------------------------------------------------
Cloud Services Checklist: Pricing and Packaging Optimization
This white paper is intended to serve as a reference, checklist and point of 
discussion for anyone considering optimizing the pricing and packaging model 
of a cloud services business. Read Now!
http://www.accelacomm.com/jaw/sfnl/114/51491232/

_______________________________________________
TrouSerS-tech mailing list
TrouSerS-tech@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/trousers-tech


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic