Lines Matching refs:sessionIndex
82 UINT32 sessionIndex in IncrementLockout() argument
85 TPM_HANDLE handle = s_associatedHandles[sessionIndex]; in IncrementLockout()
86 TPM_HANDLE sessionHandle = s_sessionHandles[sessionIndex]; in IncrementLockout()
211 UINT32 sessionIndex // IN: session index in IsPolicySessionRequired() argument
214 AUTH_ROLE role = CommandAuthRole(commandCode, sessionIndex); in IsPolicySessionRequired()
215 TPM_HT type = HandleGetType(s_associatedHandles[sessionIndex]); in IsPolicySessionRequired()
222 OBJECT *object = ObjectGet(s_associatedHandles[sessionIndex]); in IsPolicySessionRequired()
231 if(PCRPolicyIsAvailable(s_associatedHandles[sessionIndex])) in IsPolicySessionRequired()
235 policyAlg = PCRGetAuthPolicy(s_associatedHandles[sessionIndex], in IsPolicySessionRequired()
262 UINT32 sessionIndex // IN: session index in IsAuthValueAvailable() argument
269 pAssert(!IsPolicySessionRequired(commandCode, sessionIndex)); in IsAuthValueAvailable()
316 || (CommandAuthRole(commandCode, sessionIndex) == AUTH_ADMIN in IsAuthValueAvailable()
368 UINT32 sessionIndex // IN: session index in IsAuthPolicyAvailable() argument
425 if(IsPolicySessionRequired(commandCode, sessionIndex)) in IsAuthPolicyAvailable()
529 UINT32 sessionIndex // IN: index of session to be processed in CheckPWAuthSession() argument
533 TPM_HANDLE associatedHandle = s_associatedHandles[sessionIndex]; in CheckPWAuthSession()
535 MemoryRemoveTrailingZeros(&s_inputAuthValues[sessionIndex]); in CheckPWAuthSession()
539 if(Memory2BEqual(&s_inputAuthValues[sessionIndex].b, &authValue.b)) in CheckPWAuthSession()
546 return IncrementLockout(sessionIndex); in CheckPWAuthSession()
557 UINT32 sessionIndex, // IN: index of session to be processed in ComputeCommandHMAC() argument
573 HandleGetType(s_sessionHandles[sessionIndex]); in ComputeCommandHMAC()
580 if( sessionIndex == 0 in ComputeCommandHMAC()
581 && s_associatedHandles[sessionIndex] != TPM_RH_UNASSIGNED) in ComputeCommandHMAC()
586 && s_decryptSessionIndex != sessionIndex) in ComputeCommandHMAC()
595 && s_encryptSessionIndex != sessionIndex in ComputeCommandHMAC()
606 session = SessionGet(s_sessionHandles[sessionIndex]); in ComputeCommandHMAC()
617 if(s_associatedHandles[sessionIndex] != TPM_RH_UNASSIGNED) in ComputeCommandHMAC()
624 && !IsSessionBindEntity(s_associatedHandles[sessionIndex], session)) in ComputeCommandHMAC()
630 + EntityGetAuthValue(s_associatedHandles[sessionIndex], in ComputeCommandHMAC()
636 && s_inputAuthValues[sessionIndex].t.size == 0) in ComputeCommandHMAC()
646 CryptUpdateDigest2B(&hmacState, &s_nonceCaller[sessionIndex].b); in ComputeCommandHMAC()
658 marshalSize = TPMA_SESSION_Marshal(&(s_attributes[sessionIndex]), in ComputeCommandHMAC()
682 UINT32 sessionIndex, // IN: index of session to be processed in CheckSessionHMAC() argument
688 ComputeCommandHMAC(sessionIndex, cpHash, &hmac); in CheckSessionHMAC()
690 if(!Memory2BEqual(&s_inputAuthValues[sessionIndex].b, &hmac.b)) in CheckSessionHMAC()
695 return IncrementLockout(sessionIndex); in CheckSessionHMAC()
727 UINT32 sessionIndex, // IN: index of session to be processed in CheckPolicyAuthSession() argument
740 session = SessionGet(s_sessionHandles[sessionIndex]); in CheckPolicyAuthSession()
748 if( !SessionPCRValueIsCurrent(s_sessionHandles[sessionIndex]) ) in CheckPolicyAuthSession()
751 policyAlg = EntityGetAuthPolicy(s_associatedHandles[sessionIndex], in CheckPolicyAuthSession()
781 AUTH_ROLE role = CommandAuthRole(commandCode, sessionIndex); in CheckPolicyAuthSession()
843 if(HandleGetType(s_associatedHandles[sessionIndex])!= TPM_HT_NV_INDEX) in CheckPolicyAuthSession()
846 NvGetIndexInfo(s_associatedHandles[sessionIndex], &nvIndex); in CheckPolicyAuthSession()
875 int sessionIndex; in RetrieveSessionData() local
883 for(sessionIndex = 0; bufferSize > 0; sessionIndex++) in RetrieveSessionData()
888 if(sessionIndex == MAX_SESSION_NUM) in RetrieveSessionData()
889 return TPM_RC_SIZE + TPM_RC_S + g_rcIndex[sessionIndex+1]; in RetrieveSessionData()
892 s_associatedHandles[sessionIndex] = TPM_RH_UNASSIGNED; in RetrieveSessionData()
894 result = TPMI_SH_AUTH_SESSION_Unmarshal(&s_sessionHandles[sessionIndex], in RetrieveSessionData()
897 return result + TPM_RC_S + g_rcIndex[sessionIndex]; in RetrieveSessionData()
899 result = TPM2B_NONCE_Unmarshal(&s_nonceCaller[sessionIndex], in RetrieveSessionData()
902 return result + TPM_RC_S + g_rcIndex[sessionIndex]; in RetrieveSessionData()
904 result = TPMA_SESSION_Unmarshal(&s_attributes[sessionIndex], in RetrieveSessionData()
907 return result + TPM_RC_S + g_rcIndex[sessionIndex]; in RetrieveSessionData()
909 result = TPM2B_AUTH_Unmarshal(&s_inputAuthValues[sessionIndex], in RetrieveSessionData()
912 return result + TPM_RC_S + g_rcIndex[sessionIndex]; in RetrieveSessionData()
913 if(s_sessionHandles[sessionIndex] == TPM_RS_PW) in RetrieveSessionData()
917 if( s_attributes[sessionIndex].encrypt in RetrieveSessionData()
918 || s_attributes[sessionIndex].decrypt in RetrieveSessionData()
919 || s_attributes[sessionIndex].audit in RetrieveSessionData()
920 || s_attributes[sessionIndex].auditExclusive in RetrieveSessionData()
921 || s_attributes[sessionIndex].auditReset in RetrieveSessionData()
923 return TPM_RC_ATTRIBUTES + TPM_RC_S + g_rcIndex[sessionIndex]; in RetrieveSessionData()
925 if(s_nonceCaller[sessionIndex].t.size != 0) in RetrieveSessionData()
926 return TPM_RC_NONCE + TPM_RC_S + g_rcIndex[sessionIndex]; in RetrieveSessionData()
931 if(!SessionIsLoaded(s_sessionHandles[sessionIndex])) in RetrieveSessionData()
932 return TPM_RC_REFERENCE_S0 + sessionIndex; in RetrieveSessionData()
933 sessionType = HandleGetType(s_sessionHandles[sessionIndex]); in RetrieveSessionData()
934 session = SessionGet(s_sessionHandles[sessionIndex]); in RetrieveSessionData()
943 return TPM_RC_HANDLE + TPM_RC_S + g_rcIndex[sessionIndex]; in RetrieveSessionData()
945 for(i = 0; i < sessionIndex; i++) in RetrieveSessionData()
947 if(s_sessionHandles[i] == s_sessionHandles[sessionIndex]) in RetrieveSessionData()
948 return TPM_RC_HANDLE + TPM_RC_S + g_rcIndex[sessionIndex]; in RetrieveSessionData()
953 if(s_attributes[sessionIndex].decrypt) in RetrieveSessionData()
957 return TPM_RC_ATTRIBUTES + TPM_RC_S + g_rcIndex[sessionIndex]; in RetrieveSessionData()
960 return TPM_RC_ATTRIBUTES + TPM_RC_S + g_rcIndex[sessionIndex]; in RetrieveSessionData()
963 return TPM_RC_SYMMETRIC + TPM_RC_S + g_rcIndex[sessionIndex]; in RetrieveSessionData()
966 s_decryptSessionIndex = sessionIndex; in RetrieveSessionData()
969 if(s_attributes[sessionIndex].encrypt) in RetrieveSessionData()
973 return TPM_RC_ATTRIBUTES + TPM_RC_S + g_rcIndex[sessionIndex]; in RetrieveSessionData()
976 return TPM_RC_ATTRIBUTES + TPM_RC_S + g_rcIndex[sessionIndex]; in RetrieveSessionData()
979 return TPM_RC_SYMMETRIC + TPM_RC_S + g_rcIndex[sessionIndex]; in RetrieveSessionData()
982 s_encryptSessionIndex = sessionIndex; in RetrieveSessionData()
985 if(s_attributes[sessionIndex].audit) in RetrieveSessionData()
989 return TPM_RC_ATTRIBUTES + TPM_RC_S + g_rcIndex[sessionIndex]; in RetrieveSessionData()
991 if( HandleGetType(s_sessionHandles[sessionIndex]) in RetrieveSessionData()
993 return TPM_RC_ATTRIBUTES + TPM_RC_S + g_rcIndex[sessionIndex]; in RetrieveSessionData()
997 if( s_attributes[sessionIndex].auditReset == CLEAR in RetrieveSessionData()
1002 if( s_attributes[sessionIndex].auditExclusive == SET in RetrieveSessionData()
1003 && g_exclusiveAuditSession != s_sessionHandles[sessionIndex]) in RetrieveSessionData()
1006 s_auditSessionIndex = sessionIndex; in RetrieveSessionData()
1010 s_associatedHandles[sessionIndex] = TPM_RH_UNASSIGNED; in RetrieveSessionData()
1013 *sessionCount = sessionIndex; in RetrieveSessionData()
1101 UINT32 sessionIndex, // IN: index of session to be processed in CheckAuthSession() argument
1109 TPM_HANDLE sessionHandle = s_sessionHandles[sessionIndex]; in CheckAuthSession()
1110 TPM_HANDLE associatedHandle = s_associatedHandles[sessionIndex]; in CheckAuthSession()
1143 if( IsPolicySessionRequired(commandCode, sessionIndex) in CheckAuthSession()
1149 if(IsAuthValueAvailable(associatedHandle, commandCode, sessionIndex)) in CheckAuthSession()
1150 return CheckPWAuthSession(sessionIndex); in CheckAuthSession()
1158 if( !IsAuthPolicyAvailable(associatedHandle, commandCode, sessionIndex)) in CheckAuthSession()
1161 result = CheckPolicyAuthSession(sessionIndex, commandCode, in CheckAuthSession()
1171 if(!IsAuthValueAvailable(associatedHandle, commandCode, sessionIndex)) in CheckAuthSession()
1175 session = SessionGet(s_sessionHandles[sessionIndex]); in CheckAuthSession()
1180 return CheckPWAuthSession(sessionIndex); in CheckAuthSession()
1185 return CheckSessionHMAC(sessionIndex, cpHash); in CheckAuthSession()
1260 UINT32 sessionIndex; in ParseSessionBuffer() local
1296 for(sessionIndex = 0; sessionIndex < s_sessionNum; sessionIndex++) in ParseSessionBuffer()
1299 if(s_sessionHandles[sessionIndex] == TPM_RS_PW ) in ParseSessionBuffer()
1301 if(s_associatedHandles[sessionIndex] == TPM_RH_UNASSIGNED) in ParseSessionBuffer()
1302 return TPM_RC_HANDLE + g_rcIndex[sessionIndex]; in ParseSessionBuffer()
1306 session = SessionGet(s_sessionHandles[sessionIndex]); in ParseSessionBuffer()
1310 return TPM_RC_ATTRIBUTES + TPM_RC_S + g_rcIndex[sessionIndex]; in ParseSessionBuffer()
1330 if(s_attributes[sessionIndex].audit) in ParseSessionBuffer()
1334 if(s_associatedHandles[sessionIndex] != TPM_RH_UNASSIGNED) in ParseSessionBuffer()
1336 result = CheckAuthSession(commandCode, sessionIndex, in ParseSessionBuffer()
1340 TPM_RC_S + g_rcIndex[sessionIndex]); in ParseSessionBuffer()
1346 if( s_attributes[sessionIndex].audit == CLEAR in ParseSessionBuffer()
1347 && s_attributes[sessionIndex].encrypt == CLEAR in ParseSessionBuffer()
1348 && s_attributes[sessionIndex].decrypt == CLEAR) in ParseSessionBuffer()
1349 return TPM_RC_ATTRIBUTES + TPM_RC_S + g_rcIndex[sessionIndex]; in ParseSessionBuffer()
1351 result = CheckSessionHMAC(sessionIndex, &cpHash); in ParseSessionBuffer()
1354 TPM_RC_S + g_rcIndex[sessionIndex]); in ParseSessionBuffer()
1674 UINT32 sessionIndex, // IN: session index to be processed in ComputeResponseHMAC() argument
1700 if( s_associatedHandles[sessionIndex] != TPM_RH_UNASSIGNED in ComputeResponseHMAC()
1701 && !( HandleGetType(s_sessionHandles[sessionIndex]) in ComputeResponseHMAC()
1708 EntityGetAuthValue(s_associatedHandles[sessionIndex], in ComputeResponseHMAC()
1713 if(HandleGetType(s_sessionHandles[sessionIndex]) == TPM_HT_POLICY_SESSION in ComputeResponseHMAC()
1715 && s_inputAuthValues[sessionIndex].t.size == 0) in ComputeResponseHMAC()
1725 CryptUpdateDigest2B(&hmacState, &s_nonceCaller[sessionIndex].b); in ComputeResponseHMAC()
1729 marshalSize = TPMA_SESSION_Marshal(&s_attributes[sessionIndex], &buffer, &bufferSize); in ComputeResponseHMAC()
1743 UINT32 sessionIndex, // IN: session index to be processed in BuildSingleResponseAuth() argument
1752 if(s_sessionHandles[sessionIndex] == TPM_RS_PW) in BuildSingleResponseAuth()
1759 SESSION *session = SessionGet(s_sessionHandles[sessionIndex]); in BuildSingleResponseAuth()
1762 if(HandleGetType(s_sessionHandles[sessionIndex]) == TPM_HT_POLICY_SESSION in BuildSingleResponseAuth()
1767 ComputeResponseHMAC(sessionIndex, in BuildSingleResponseAuth()