Lines Matching refs:sessionIndex
112 UINT32 sessionIndex in IncrementLockout() argument
115 TPM_HANDLE handle = s_associatedHandles[sessionIndex]; in IncrementLockout()
116 TPM_HANDLE sessionHandle = s_sessionHandles[sessionIndex]; in IncrementLockout()
229 UINT32 sessionIndex // IN: session index in IsPolicySessionRequired() argument
232 AUTH_ROLE role = CommandAuthRole(commandIndex, sessionIndex); in IsPolicySessionRequired()
233 TPM_HT type = HandleGetType(s_associatedHandles[sessionIndex]); in IsPolicySessionRequired()
245 OBJECT *object = HandleToObject(s_associatedHandles[sessionIndex]); in IsPolicySessionRequired()
256 if(PCRPolicyIsAvailable(s_associatedHandles[sessionIndex])) in IsPolicySessionRequired()
260 policyAlg = PCRGetAuthPolicy(s_associatedHandles[sessionIndex], in IsPolicySessionRequired()
288 UINT32 sessionIndex // IN: session index in IsAuthValueAvailable() argument
353 || (CommandAuthRole(commandIndex, sessionIndex) == AUTH_ADMIN in IsAuthValueAvailable()
423 UINT32 sessionIndex // IN: session index in IsAuthPolicyAvailable() argument
490 if(IsPolicySessionRequired(commandIndex, sessionIndex)) in IsAuthPolicyAvailable()
745 UINT32 sessionIndex // IN: index of session to be processed in CheckPWAuthSession() argument
749 TPM_HANDLE associatedHandle = s_associatedHandles[sessionIndex]; in CheckPWAuthSession()
752 MemoryRemoveTrailingZeros(&s_inputAuthValues[sessionIndex]); in CheckPWAuthSession()
758 if(MemoryEqual2B(&s_inputAuthValues[sessionIndex].b, &authValue.b)) in CheckPWAuthSession()
765 return IncrementLockout(sessionIndex); in CheckPWAuthSession()
814 UINT32 sessionIndex, // IN: index of session to be processed in ComputeCommandHMAC() argument
835 if(sessionIndex == 0 in ComputeCommandHMAC()
836 && s_associatedHandles[sessionIndex] != TPM_RH_UNASSIGNED) in ComputeCommandHMAC()
841 && s_decryptSessionIndex != sessionIndex) in ComputeCommandHMAC()
850 && s_encryptSessionIndex != sessionIndex in ComputeCommandHMAC()
861 session = SessionGet(s_sessionHandles[sessionIndex]); in ComputeCommandHMAC()
878 EntityGetAuthValue(s_associatedHandles[sessionIndex], &authValue); in ComputeCommandHMAC()
884 && s_inputAuthValues[sessionIndex].t.size == 0) in ComputeCommandHMAC()
896 CryptDigestUpdate2B(&hmacState.hashState, &s_nonceCaller[sessionIndex].b); in ComputeCommandHMAC()
904 marshalSize = TPMA_SESSION_Marshal(&(s_attributes[sessionIndex]), in ComputeCommandHMAC()
931 UINT32 sessionIndex // IN: index of session to be processed in CheckSessionHMAC() argument
937 ComputeCommandHMAC(command, sessionIndex, &hmac); in CheckSessionHMAC()
940 if(!MemoryEqual2B(&s_inputAuthValues[sessionIndex].b, &hmac.b)) in CheckSessionHMAC()
945 return IncrementLockout(sessionIndex); in CheckSessionHMAC()
977 UINT32 sessionIndex // IN: index of session to be processed in CheckPolicyAuthSession() argument
986 session = SessionGet(s_sessionHandles[sessionIndex]); in CheckPolicyAuthSession()
998 policyAlg = EntityGetAuthPolicy(s_associatedHandles[sessionIndex], in CheckPolicyAuthSession()
1032 AUTH_ROLE role = CommandAuthRole(command->index, sessionIndex); in CheckPolicyAuthSession()
1096 if(HandleGetType(s_associatedHandles[sessionIndex]) != TPM_HT_NV_INDEX) in CheckPolicyAuthSession()
1099 nvIndex = NvGetIndexInfo(s_associatedHandles[sessionIndex], &locator); in CheckPolicyAuthSession()
1129 INT32 sessionIndex; in RetrieveSessionData() local
1136 for(sessionIndex = 0; command->authSize > 0; sessionIndex++) in RetrieveSessionData()
1138 errorIndex = TPM_RC_S + g_rcIndex[sessionIndex]; in RetrieveSessionData()
1143 if(sessionIndex == MAX_SESSION_NUM) in RetrieveSessionData()
1147 s_associatedHandles[sessionIndex] = TPM_RH_UNASSIGNED; in RetrieveSessionData()
1151 &s_sessionHandles[sessionIndex], in RetrieveSessionData()
1155 return result + TPM_RC_S + g_rcIndex[sessionIndex]; in RetrieveSessionData()
1157 result = TPM2B_NONCE_Unmarshal(&s_nonceCaller[sessionIndex], in RetrieveSessionData()
1161 return result + TPM_RC_S + g_rcIndex[sessionIndex]; in RetrieveSessionData()
1163 result = TPMA_SESSION_Unmarshal(&s_attributes[sessionIndex], in RetrieveSessionData()
1167 return result + TPM_RC_S + g_rcIndex[sessionIndex]; in RetrieveSessionData()
1169 result = TPM2B_AUTH_Unmarshal(&s_inputAuthValues[sessionIndex], in RetrieveSessionData()
1175 sessionAttributes = s_attributes[sessionIndex]; in RetrieveSessionData()
1176 if(s_sessionHandles[sessionIndex] == TPM_RS_PW) in RetrieveSessionData()
1187 if(s_nonceCaller[sessionIndex].t.size != 0) in RetrieveSessionData()
1193 if(!SessionIsLoaded(s_sessionHandles[sessionIndex])) in RetrieveSessionData()
1194 return TPM_RC_REFERENCE_S0 + sessionIndex; in RetrieveSessionData()
1195 sessionType = HandleGetType(s_sessionHandles[sessionIndex]); in RetrieveSessionData()
1196 session = SessionGet(s_sessionHandles[sessionIndex]); in RetrieveSessionData()
1205 for(i = 0; i < sessionIndex; i++) in RetrieveSessionData()
1207 if(s_sessionHandles[i] == s_sessionHandles[sessionIndex]) in RetrieveSessionData()
1227 s_decryptSessionIndex = sessionIndex; in RetrieveSessionData()
1243 s_encryptSessionIndex = sessionIndex; in RetrieveSessionData()
1252 if(HandleGetType(s_sessionHandles[sessionIndex]) in RetrieveSessionData()
1264 && g_exclusiveAuditSession != s_sessionHandles[sessionIndex]) in RetrieveSessionData()
1267 s_auditSessionIndex = sessionIndex; in RetrieveSessionData()
1271 s_associatedHandles[sessionIndex] = TPM_RH_UNASSIGNED; in RetrieveSessionData()
1273 command->sessionNum = sessionIndex; in RetrieveSessionData()
1360 UINT32 sessionIndex // IN: index of session to be processed in CheckAuthSession() argument
1365 TPM_HANDLE sessionHandle = s_sessionHandles[sessionIndex]; in CheckAuthSession()
1366 TPM_HANDLE associatedHandle = s_associatedHandles[sessionIndex]; in CheckAuthSession()
1400 !IsSessionBindEntity(s_associatedHandles[sessionIndex], session); in CheckAuthSession()
1424 if(IsPolicySessionRequired(command->index, sessionIndex)) in CheckAuthSession()
1429 if(!IsAuthValueAvailable(associatedHandle, command->index, sessionIndex)) in CheckAuthSession()
1437 if(!IsAuthPolicyAvailable(associatedHandle, command->index, sessionIndex)) in CheckAuthSession()
1440 result = CheckPolicyAuthSession(command, sessionIndex); in CheckAuthSession()
1446 result = CheckPWAuthSession(sessionIndex); in CheckAuthSession()
1448 result = CheckSessionHMAC(command, sessionIndex); in CheckAuthSession()
1538 UINT32 sessionIndex; in ParseSessionBuffer() local
1573 for(sessionIndex = 0; sessionIndex < command->sessionNum; sessionIndex++) in ParseSessionBuffer()
1575 errorIndex = TPM_RC_S + g_rcIndex[sessionIndex]; in ParseSessionBuffer()
1577 if(s_sessionHandles[sessionIndex] == TPM_RS_PW) in ParseSessionBuffer()
1579 if(s_associatedHandles[sessionIndex] == TPM_RH_UNASSIGNED) in ParseSessionBuffer()
1582 if(IS_ATTRIBUTE(s_attributes[sessionIndex], TPMA_SESSION, audit) in ParseSessionBuffer()
1583 || IS_ATTRIBUTE(s_attributes[sessionIndex], TPMA_SESSION, encrypt) in ParseSessionBuffer()
1584 || IS_ATTRIBUTE(s_attributes[sessionIndex], TPMA_SESSION, decrypt)) in ParseSessionBuffer()
1590 session = SessionGet(s_sessionHandles[sessionIndex]); in ParseSessionBuffer()
1608 if(IS_ATTRIBUTE(s_attributes[sessionIndex], TPMA_SESSION, audit)) in ParseSessionBuffer()
1613 if(s_associatedHandles[sessionIndex] != TPM_RH_UNASSIGNED) in ParseSessionBuffer()
1615 result = CheckAuthSession(command, sessionIndex); in ParseSessionBuffer()
1623 if(!IS_ATTRIBUTE(s_attributes[sessionIndex], TPMA_SESSION, audit) in ParseSessionBuffer()
1624 && !IS_ATTRIBUTE(s_attributes[sessionIndex], TPMA_SESSION, encrypt) in ParseSessionBuffer()
1625 && !IS_ATTRIBUTE(s_attributes[sessionIndex], TPMA_SESSION, decrypt)) in ParseSessionBuffer()
1633 result = CheckSessionHMAC(command, sessionIndex); in ParseSessionBuffer()
1963 UINT32 sessionIndex, // IN: session index to be processed in ComputeResponseHMAC() argument
1991 EntityGetAuthValue(s_associatedHandles[sessionIndex], &authValue); in ComputeResponseHMAC()
2000 && s_inputAuthValues[sessionIndex].t.size == 0) in ComputeResponseHMAC()
2011 CryptDigestUpdate2B(&hmacState.hashState, &s_nonceCaller[sessionIndex].b); in ComputeResponseHMAC()
2015 marshalSize = TPMA_SESSION_Marshal(&s_attributes[sessionIndex], &buffer, NULL); in ComputeResponseHMAC()
2052 UINT32 sessionIndex, // IN: session index to be processed in BuildSingleResponseAuth() argument
2057 SESSION *session = SessionGet(s_sessionHandles[sessionIndex]); in BuildSingleResponseAuth()
2061 if(HandleGetType(s_sessionHandles[sessionIndex]) == TPM_HT_POLICY_SESSION in BuildSingleResponseAuth()
2066 ComputeResponseHMAC(command, sessionIndex, session, auth); in BuildSingleResponseAuth()
2068 UpdateInternalSession(session, sessionIndex); in BuildSingleResponseAuth()