Lines Matching refs:hContext

492 set_public_modulus(TSS_HCONTEXT hContext, TSS_HKEY hKey,
518 Tspi_Context_FreeMemory(hContext, blob);
546 token_get_tpm_info(TSS_HCONTEXT hContext, TOKEN_DATA *td)
554 if ((result = Tspi_Context_GetTpmObject(hContext, &hTPM))) {
567 Tspi_Context_FreeMemory(hContext, data);
592 Tspi_Context_FreeMemory(hContext, data);
604 token_rng(TSS_HCONTEXT hContext, CK_BYTE *output, CK_ULONG bytes)
610 if ((rc = Tspi_Context_GetTpmObject(hContext, &hTPM))) {
623 Tspi_Context_FreeMemory(hContext, random_bytes);
652 TSS_HCONTEXT *hContext)
656 result = open_tss_context(hContext);
660 if ((result = Tspi_Context_GetDefaultPolicy(*hContext,
672 result = token_get_tpm_info(*hContext, nv_token_data);
683 TSS_HCONTEXT hContext,
701 result = Tspi_Context_CreateObject(hContext, TSS_OBJECT_TYPE_RSAKEY,
709 result = set_public_modulus(hContext, *phKey, size_n, n);
711 Tspi_Context_CloseObject(hContext, *phKey);
722 Tspi_Context_CloseObject(hContext, *phKey);
727 result = tss_assign_secret_key_policy(hContext, TSS_POLICY_MIGRATION,
736 Tspi_Context_CloseObject(hContext, *phKey);
745 Tspi_Context_CloseObject(hContext, *phKey);
754 Tspi_Context_CloseObject(hContext, *phKey);
767 token_wrap_key_object(TSS_HCONTEXT hContext,
781 if ((rc = object_mgr_find_in_map1(hContext, ckObject, &obj))) {
842 if ((rc = token_wrap_sw_key(hContext,
870 if ((result = Tspi_Context_CreateObject(hContext,
877 if ((result = set_public_modulus(hContext, *phKey,
879 Tspi_Context_CloseObject(hContext, *phKey);
883 result = tss_assign_secret_key_policy(hContext,
886 Tspi_Context_CloseObject(hContext, *phKey);
893 Tspi_Context_CloseObject(hContext, *phKey);
912 Tspi_Context_FreeMemory(hContext, rgbBlob);
916 Tspi_Context_FreeMemory(hContext, rgbBlob);
923 rc = save_token_object(hContext, obj);
930 tss_assign_secret_key_policy(TSS_HCONTEXT hContext, TSS_FLAG policyType,
936 if ((result = Tspi_Context_CreateObject(hContext,
961 Tspi_Context_CloseObject(hContext, hPolicy);
971 TSS_HCONTEXT hContext,
985 if ((rc = token_wrap_key_object(hContext, ckKey,
995 result = tss_assign_secret_key_policy(hContext, TSS_POLICY_USAGE,
1009 token_load_srk(TSS_HCONTEXT hContext, TSS_HKEY *hSRK)
1017 if ((result = Tspi_Context_GetTpmObject(hContext, &hTPM))) {
1024 if ((result = Tspi_Context_LoadKeyByUUID(hContext,
1048 load_mrk(TSS_HCONTEXT hContext, TSS_HKEY hParent, TSS_HKEY *hKey)
1053 ret = Tspi_Context_GetKeyByUUID(hContext, TSS_PS_TYPE_SYSTEM,
1071 Tspi_Context_CloseObject(hContext, *hKey);
1078 tss_find_and_load_key(TSS_HCONTEXT hContext,
1089 result = Tspi_Context_GetKeyByUUID(hContext,
1098 result = tss_assign_secret_key_policy(hContext,
1113 token_load_public_root_key(TSS_HCONTEXT hContext)
1121 if ((result = token_load_srk(hContext, &hSRK))) {
1124 if ((result = load_mrk(hContext, hSRK, &hMRK)))
1127 result = tss_find_and_load_key(hContext,
1163 tss_generate_key(TSS_HCONTEXT hContext, TSS_FLAG initFlags, BYTE *passHash,
1168 if ((result = Tspi_Context_CreateObject(hContext,
1175 result = tss_assign_secret_key_policy(hContext,
1178 Tspi_Context_CloseObject(hContext, *phKey);
1184 result = tss_assign_secret_key_policy(hContext,
1187 Tspi_Context_CloseObject(hContext, *phKey);
1195 Tspi_Context_CloseObject(hContext, *phKey);
1203 Tspi_Context_CloseObject(hContext, *phKey);
1211 TSS_HCONTEXT hContext,
1220 if ((result = Tspi_Context_CreateObject(hContext,
1245 if ((result = Tspi_Context_UnregisterKey(hContext,
1250 if ((result = Tspi_Context_RegisterKey(hContext, hObjectToChange,
1259 token_generate_leaf_key(TSS_HCONTEXT hContext,
1288 if (result = tss_generate_key(hContext, initFlags, passHash,
1295 * - Tspi_Context_RegisterKey(hContext, hPrivateRootKey,
1301 result = Tspi_Context_RegisterKey(hContext, *phKey,
1312 result = Tspi_Context_UnregisterKey(hContext,
1328 token_verify_pin(TSS_HCONTEXT hContext, TSS_HKEY hKey)
1337 if ((result = Tspi_Context_CreateObject(hContext,
1345 rc = token_rng(hContext, rgbData, sizeof (rgbData));
1378 Tspi_Context_FreeMemory(hContext, rgbUnboundData);
1379 Tspi_Context_CloseObject(hContext, hEncData);
1384 token_create_private_tree(TSS_HCONTEXT hContext, CK_BYTE *pinHash)
1396 if (token_load_srk(hContext, &hSRK))
1399 if (load_mrk(hContext, hSRK, &hMRK))
1407 if ((result = tss_generate_key(hContext, initFlags, NULL, hMRK,
1415 result = Tspi_Context_RegisterKey(hContext, hPrivateRootKey,
1428 (void) Tspi_Context_UnregisterKey(hContext,
1439 Tspi_Context_CloseObject(hContext, hPrivateRootKey);
1451 if ((rc = token_generate_leaf_key(hContext,
1461 (void) Tspi_Context_UnregisterKey(hContext,
1467 (void) Tspi_Context_UnregisterKey(hContext,
1473 Tspi_Context_CloseObject(hContext, hPrivateRootKey);
1476 Tspi_Context_CloseObject(hContext, hPrivateLeafKey);
1483 Tspi_Context_CloseObject(hContext, hMRK);
1488 token_create_public_tree(TSS_HCONTEXT hContext, CK_BYTE *pinHash)
1500 if (token_load_srk(hContext, &hSRK))
1503 if (load_mrk(hContext, hSRK, &hMRK))
1511 if ((result = tss_generate_key(hContext, initFlags, NULL, hMRK,
1519 result = Tspi_Context_RegisterKey(hContext, hPublicRootKey,
1532 (void) Tspi_Context_UnregisterKey(hContext,
1543 Tspi_Context_CloseObject(hContext, hPublicRootKey);
1551 if ((rc = token_generate_leaf_key(hContext, TPMTOK_PUBLIC_LEAF_KEY,
1562 (void) Tspi_Context_UnregisterKey(hContext,
1567 (void) Tspi_Context_UnregisterKey(hContext,
1572 Tspi_Context_CloseObject(hContext, hPublicRootKey);
1575 Tspi_Context_CloseObject(hContext, hPublicLeafKey);
1583 Tspi_Context_CloseObject(hContext, hMRK);
1589 TSS_HCONTEXT hContext,
1603 if ((result = token_load_srk(hContext, &hSRK)))
1606 if ((result = load_mrk(hContext, hSRK, &hMRK)))
1614 if ((result = token_load_public_root_key(hContext))) {
1638 if ((rc = verify_user_pin(hContext, hash_sha)))
1644 rc = load_private_token_objects(hContext);
1671 hContext,
1684 hContext,
1694 if ((rc = token_verify_pin(hContext, hPublicLeafKey)))
1702 Tspi_Context_CloseObject(hContext, hMRK);
1707 token_specific_logout(TSS_HCONTEXT hContext)
1725 (void) object_mgr_purge_private_token_objects(hContext);
1732 token_specific_init_pin(TSS_HCONTEXT hContext,
1778 verify_user_pin(TSS_HCONTEXT hContext, CK_BYTE *hash_sha)
1785 if (token_load_srk(hContext, &hSRK))
1788 if ((result = load_mrk(hContext, hSRK, &hMRK)))
1803 hContext,
1814 hContext,
1829 rc = token_verify_pin(hContext, hPrivateLeafKey);
1832 Tspi_Context_CloseObject(hContext, hMRK);
1858 if (token_load_srk(sess->hContext, &hSRK)) {
1881 if ((rc = token_create_private_tree(sess->hContext,
1906 if ((rc = verify_user_pin(sess->hContext,
1917 if (tss_change_auth(sess->hContext,
1933 if ((rc = token_create_public_tree(sess->hContext,
1952 if (tss_change_auth(sess->hContext,
1967 token_specific_verify_so_pin(TSS_HCONTEXT hContext, CK_CHAR_PTR pPin,
1978 if ((rc = token_load_srk(hContext, &hSRK))) {
2002 result = Tspi_Context_GetKeyByUUID(hContext,
2008 if ((rc = load_mrk(hContext, hSRK, &hMRK)))
2023 result = Tspi_Context_GetKeyByUUID(hContext,
2030 result = tss_assign_secret_key_policy(hContext, TSS_POLICY_USAGE,
2044 rc = token_verify_pin(hContext, hPublicLeafKey);
2048 Tspi_Context_CloseObject(hContext, hMRK);
2054 token_specific_final(TSS_HCONTEXT hContext)
2057 Tspi_Context_CloseObject(hContext, hPublicRootKey);
2061 Tspi_Context_CloseObject(hContext, hPublicLeafKey);
2065 Tspi_Context_CloseObject(hContext, hPrivateRootKey);
2069 Tspi_Context_CloseObject(hContext, hPrivateLeafKey);
2080 token_wrap_auth_data(TSS_HCONTEXT hContext,
2102 if ((ret = Tspi_Context_CreateObject(hContext,
2140 token_unwrap_auth_data(TSS_HCONTEXT hContext, CK_BYTE *encAuthData,
2149 if ((result = Tspi_Context_CreateObject(hContext,
2182 TSS_HCONTEXT hContext,
2225 if ((result = token_load_public_root_key(hContext))) {
2236 if ((rc = token_rng(hContext, authHash, SHA1_DIGEST_LENGTH))) {
2248 if ((rc = token_rng(hContext, authHash, SHA1_DIGEST_LENGTH))) {
2256 if ((result = tss_generate_key(hContext, initFlags, authData,
2270 Tspi_Context_FreeMemory(hContext, rgbBlob);
2276 Tspi_Context_FreeMemory(hContext, rgbBlob);
2281 Tspi_Context_FreeMemory(hContext, rgbBlob);
2293 Tspi_Context_FreeMemory(hContext, rgbBlob);
2300 Tspi_Context_FreeMemory(hContext, rgbBlob);
2304 Tspi_Context_FreeMemory(hContext, rgbBlob);
2308 rc = token_wrap_auth_data(hContext, authData, publ_tmpl,
2317 TSS_HCONTEXT hContext,
2333 if ((result = token_load_public_root_key(hContext)))
2355 rc = object_mgr_find_in_map2(hContext, key_obj, &handle);
2359 if ((rc = token_load_key(hContext,
2384 if ((result = Tspi_Context_LoadKeyByBlob(hContext,
2407 if ((result = token_unwrap_auth_data(hContext,
2427 if ((result = Tspi_Context_CreateObject(hContext,
2459 Tspi_Context_FreeMemory(hContext, authData);
2467 TSS_HCONTEXT hContext,
2481 if ((result = Tspi_Context_CreateObject(hContext,
2499 Tspi_Context_FreeMemory(hContext, modulus);
2524 Tspi_Context_FreeMemory(hContext, buf);
2534 Tspi_Context_FreeMemory(hContext, buf);
2544 TSS_HCONTEXT hContext,
2554 if ((rc = token_rsa_load_key(hContext, key_obj, &hKey))) {
2558 rc = tpm_decrypt_data(hContext, hKey, in_data, in_data_len,
2566 TSS_HCONTEXT hContext,
2578 if ((rc = token_rsa_load_key(hContext, key_obj, &hKey))) {
2583 if ((result = Tspi_Context_CreateObject(hContext,
2617 TSS_HCONTEXT hContext,
2631 if ((rc = token_rsa_load_key(hContext, key_obj, &hKey))) {
2636 if ((result = Tspi_Context_CreateObject(hContext,
2659 Tspi_Context_FreeMemory(hContext, sig);
2665 Tspi_Context_FreeMemory(hContext, sig);
2672 TSS_HCONTEXT hContext,
2687 if ((result = Tspi_Context_CreateObject(hContext,
2704 Tspi_Context_FreeMemory(hContext, modulus);
2760 Tspi_Context_FreeMemory(hContext, dataBlob);
2774 Tspi_Context_FreeMemory(hContext, dataBlob);
2783 TSS_HCONTEXT hContext,
2793 if ((rc = token_rsa_load_key(hContext, key_obj, &hKey))) {
2797 rc = tpm_encrypt_data(hContext, hKey, in_data, in_data_len,
2814 TSS_HCONTEXT hContext,
2833 if ((rc = token_rsa_load_key(hContext, key_obj, &hKey))) {
2898 Tspi_Context_FreeMemory(hContext, modulus);