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

List:       trousers-cvs
Subject:    [Trousers-cvs] trousers/src/tcs tcs_key_mem_cache.c
From:       Rajiv Andrade <phreakz () users ! sourceforge ! net>
Date:       2009-07-16 13:08:55
Message-ID: E1MRQhj-0004cP-UL () ddv4jf1 ! ch3 ! sourceforge ! com
[Download RAW message or body]

Update of /cvsroot/trousers/trousers/src/tcs
In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv17746/src/tcs

Modified Files:
	tcs_key_mem_cache.c 
Log Message:
The patch below fixes a problem with the owner_evict_init code.  If
the result of the GetCapabilityInternal call is "INVALID_KEYHANDLE",
it can be ignored because it will be automatically evicted later when
when one try to use it. This can be checked in the end of
load_key_init().
Returning an error in that situation instead of moving along to the next
key in the list results in the TPM having too many key handles that are
not being used.

Signed-off-by: Wyllys Ingersoll <wyllys.ingersoll@sun.com>
Signed-off-by: Rajiv Andrade <srajiv@linux.vnet.ibm.com>


Index: tcs_key_mem_cache.c
===================================================================
RCS file: /cvsroot/trousers/trousers/src/tcs/tcs_key_mem_cache.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** tcs_key_mem_cache.c	19 Nov 2007 20:20:39 -0000	1.11
--- tcs_key_mem_cache.c	16 Jul 2009 13:08:53 -0000	1.12
***************
*** 1087,1093 ****
  		LoadBlob_UINT32(&offset, keyList.handle[i], (BYTE *)&keyHandle);
  		/* get the ownerEvict flag for this key handle */
! 		if ((result = TCSP_GetCapability_Internal(InternalContext, TPM_CAP_KEY_STATUS,
  							  sizeof(UINT32), (BYTE *)&keyHandle,
! 							  &respDataSize, &respData))) {
  			free(keyList.handle);
  			return result;
--- 1087,1097 ----
  		LoadBlob_UINT32(&offset, keyList.handle[i], (BYTE *)&keyHandle);
  		/* get the ownerEvict flag for this key handle */
! 		result = TCSP_GetCapability_Internal(InternalContext, TPM_CAP_KEY_STATUS,
  							  sizeof(UINT32), (BYTE *)&keyHandle,
! 							  &respDataSize, &respData);
! 		/* special case, invalid keys are automatically evicted later */
! 		if (result == TPM_E_INVALID_KEYHANDLE)
! 			continue;
! 		if (result != TSS_SUCCESS) {
  			free(keyList.handle);
  			return result;


------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge  
This is your chance to win up to $100,000 in prizes! For a limited time, 
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize  
details at: http://p.sf.net/sfu/Challenge
_______________________________________________
Trousers-cvs mailing list
Trousers-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/trousers-cvs
[prev in list] [next in list] [prev in thread] [next in thread] 

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