Lines Matching refs:result

499 	TSS_RESULT result;  in set_public_modulus()  local
502 result = Tspi_GetAttribData(hKey, TSS_TSPATTRIB_KEY_BLOB, in set_public_modulus()
504 if (result != TSS_SUCCESS) { in set_public_modulus()
506 result, Trspi_Error_String(result)); in set_public_modulus()
507 return (result); in set_public_modulus()
511 result = Trspi_UnloadBlob_PUBKEY(&offset, blob, &pub_key); in set_public_modulus()
512 if (result != TSS_SUCCESS) { in set_public_modulus()
514 result, Trspi_Error_String(result)); in set_public_modulus()
515 return (result); in set_public_modulus()
531 result = Tspi_SetAttribData(hKey, TSS_TSPATTRIB_KEY_BLOB, in set_public_modulus()
533 if (result != TSS_SUCCESS) { in set_public_modulus()
535 result, Trspi_Error_String(result)); in set_public_modulus()
536 return (result); in set_public_modulus()
539 return (result); in set_public_modulus()
548 TSS_RESULT result; in token_get_tpm_info() local
554 if ((result = Tspi_Context_GetTpmObject(hContext, &hTPM))) { in token_get_tpm_info()
556 result, Trspi_Error_String(result)); in token_get_tpm_info()
559 if ((result = Tspi_TPM_GetCapability(hTPM, in token_get_tpm_info()
563 result, Trspi_Error_String(result)); in token_get_tpm_info()
631 TSS_RESULT result; in open_tss_context() local
633 if ((result = Tspi_Context_Create(pContext))) { in open_tss_context()
635 result, Trspi_Error_String(result)); in open_tss_context()
639 if ((result = Tspi_Context_Connect(*pContext, NULL))) { in open_tss_context()
641 result, Trspi_Error_String(result)); in open_tss_context()
646 return (result); in open_tss_context()
654 TSS_RESULT result; in token_specific_init() local
656 result = open_tss_context(hContext); in token_specific_init()
657 if (result) in token_specific_init()
660 if ((result = Tspi_Context_GetDefaultPolicy(*hContext, in token_specific_init()
663 result, Trspi_Error_String(result)); in token_specific_init()
672 result = token_get_tpm_info(*hContext, nv_token_data); in token_specific_init()
673 return (result); in token_specific_init()
692 TSS_RESULT result; in token_wrap_sw_key() local
701 result = Tspi_Context_CreateObject(hContext, TSS_OBJECT_TYPE_RSAKEY, in token_wrap_sw_key()
703 if (result != TSS_SUCCESS) { in token_wrap_sw_key()
705 result, Trspi_Error_String(result)); in token_wrap_sw_key()
709 result = set_public_modulus(hContext, *phKey, size_n, n); in token_wrap_sw_key()
710 if (result != TSS_SUCCESS) { in token_wrap_sw_key()
717 result = Tspi_SetAttribData(*phKey, TSS_TSPATTRIB_KEY_BLOB, in token_wrap_sw_key()
719 if (result != TSS_SUCCESS) { in token_wrap_sw_key()
721 result, Trspi_Error_String(result)); in token_wrap_sw_key()
727 result = tss_assign_secret_key_policy(hContext, TSS_POLICY_MIGRATION, in token_wrap_sw_key()
731 if ((result = Tspi_SetAttribUint32(*phKey, in token_wrap_sw_key()
735 result, Trspi_Error_String(result)); in token_wrap_sw_key()
740 if ((result = Tspi_SetAttribUint32(*phKey, in token_wrap_sw_key()
744 result, Trspi_Error_String(result)); in token_wrap_sw_key()
750 result = Tspi_Key_WrapKey(*phKey, hParentKey, NULL_HPCRS); in token_wrap_sw_key()
751 if (result != TSS_SUCCESS) { in token_wrap_sw_key()
753 result, Trspi_Error_String(result)); in token_wrap_sw_key()
776 TSS_RESULT result; in token_wrap_key_object() local
870 if ((result = Tspi_Context_CreateObject(hContext, in token_wrap_key_object()
873 result, Trspi_Error_String(result)); in token_wrap_key_object()
874 return (result); in token_wrap_key_object()
877 if ((result = set_public_modulus(hContext, *phKey, in token_wrap_key_object()
883 result = tss_assign_secret_key_policy(hContext, in token_wrap_key_object()
885 if (result) { in token_wrap_key_object()
891 result = set_legacy_key_params(*phKey); in token_wrap_key_object()
892 if (result) { in token_wrap_key_object()
902 if ((result = Tspi_GetAttribData(*phKey, TSS_TSPATTRIB_KEY_BLOB, in token_wrap_key_object()
905 result, Trspi_Error_String(result)); in token_wrap_key_object()
933 TSS_RESULT result; in tss_assign_secret_key_policy() local
936 if ((result = Tspi_Context_CreateObject(hContext, in tss_assign_secret_key_policy()
939 result, Trspi_Error_String(result)); in tss_assign_secret_key_policy()
940 return (result); in tss_assign_secret_key_policy()
942 if ((result = Tspi_Policy_AssignToObject(hPolicy, hKey))) { in tss_assign_secret_key_policy()
944 result, Trspi_Error_String(result)); in tss_assign_secret_key_policy()
948 result = Tspi_Policy_SetSecret(hPolicy, TSS_SECRET_MODE_NONE, in tss_assign_secret_key_policy()
951 result = Tspi_Policy_SetSecret(hPolicy, TSS_SECRET_MODE_SHA1, in tss_assign_secret_key_policy()
954 if (result != TSS_SUCCESS) { in tss_assign_secret_key_policy()
956 result, Trspi_Error_String(result)); in tss_assign_secret_key_policy()
960 if (result != TSS_SUCCESS) in tss_assign_secret_key_policy()
962 return (result); in tss_assign_secret_key_policy()
977 TSS_RESULT result; in token_load_key() local
995 result = tss_assign_secret_key_policy(hContext, TSS_POLICY_USAGE, in token_load_key()
998 return (result); in token_load_key()
1012 TSS_RESULT result; in token_load_srk() local
1017 if ((result = Tspi_Context_GetTpmObject(hContext, &hTPM))) { in token_load_srk()
1019 result, Trspi_Error_String(result)); in token_load_srk()
1024 if ((result = Tspi_Context_LoadKeyByUUID(hContext, in token_load_srk()
1027 result, Trspi_Error_String(result)); in token_load_srk()
1030 if ((result = Tspi_GetPolicyObject(*hSRK, TSS_POLICY_USAGE, in token_load_srk()
1033 result, Trspi_Error_String(result)); in token_load_srk()
1036 if ((result = Tspi_Policy_SetSecret(hPolicy, TSS_SECRET_MODE_SHA1, in token_load_srk()
1039 result, Trspi_Error_String(result)); in token_load_srk()
1044 return (result); in token_load_srk()
1052 TSS_RESULT result; in tss_find_and_load_key() local
1059 result = Tspi_Context_GetKeyByUUID(hContext, in tss_find_and_load_key()
1061 if (result) { in tss_find_and_load_key()
1063 result, Trspi_Error_String(result)); in tss_find_and_load_key()
1064 return (result); in tss_find_and_load_key()
1068 result = tss_assign_secret_key_policy(hContext, in tss_find_and_load_key()
1070 if (result) in tss_find_and_load_key()
1071 return (result); in tss_find_and_load_key()
1074 result = Tspi_Key_LoadKey(*hKey, hParent); in tss_find_and_load_key()
1075 if (result) in tss_find_and_load_key()
1077 result, Trspi_Error_String(result)); in tss_find_and_load_key()
1079 return (result); in tss_find_and_load_key()
1085 TSS_RESULT result; in token_load_public_root_key() local
1091 if ((result = token_load_srk(hContext, &hSRK))) { in token_load_public_root_key()
1092 return (result); in token_load_public_root_key()
1095 result = tss_find_and_load_key(hContext, in token_load_public_root_key()
1098 if (result) in token_load_public_root_key()
1099 return (result); in token_load_public_root_key()
1101 return (result); in token_load_public_root_key()
1107 TSS_RESULT result; in set_legacy_key_params() local
1109 if ((result = Tspi_SetAttribUint32(hKey, in set_legacy_key_params()
1114 result, Trspi_Error_String(result)); in set_legacy_key_params()
1115 return (result); in set_legacy_key_params()
1118 if ((result = Tspi_SetAttribUint32(hKey, in set_legacy_key_params()
1123 result, Trspi_Error_String(result)); in set_legacy_key_params()
1124 return (result); in set_legacy_key_params()
1127 return (result); in set_legacy_key_params()
1134 TSS_RESULT result; in tss_generate_key() local
1137 if ((result = Tspi_Context_CreateObject(hContext, in tss_generate_key()
1140 result, Trspi_Error_String(result)); in tss_generate_key()
1141 return (result); in tss_generate_key()
1143 result = tss_assign_secret_key_policy(hContext, TSS_POLICY_USAGE, in tss_generate_key()
1146 if (result) { in tss_generate_key()
1148 return (result); in tss_generate_key()
1152 if ((result = Tspi_Context_CreateObject(hContext, in tss_generate_key()
1156 result, Trspi_Error_String(result)); in tss_generate_key()
1158 return (result); in tss_generate_key()
1162 result = Tspi_Policy_SetSecret(hMigPolicy, in tss_generate_key()
1165 result = Tspi_Policy_SetSecret(hMigPolicy, in tss_generate_key()
1169 if (result != TSS_SUCCESS) { in tss_generate_key()
1171 result, Trspi_Error_String(result)); in tss_generate_key()
1174 return (result); in tss_generate_key()
1177 if ((result = Tspi_Policy_AssignToObject(hMigPolicy, *phKey))) { in tss_generate_key()
1179 result, Trspi_Error_String(result)); in tss_generate_key()
1182 return (result); in tss_generate_key()
1187 result = set_legacy_key_params(*phKey); in tss_generate_key()
1188 if (result) { in tss_generate_key()
1191 return (result); in tss_generate_key()
1195 if ((result = Tspi_Key_CreateKey(*phKey, hParentKey, 0))) { in tss_generate_key()
1197 result, Trspi_Error_String(result)); in tss_generate_key()
1202 return (result); in tss_generate_key()
1212 TSS_RESULT result; in tss_change_auth() local
1216 if ((result = Tspi_Context_CreateObject(hContext, in tss_change_auth()
1219 result, Trspi_Error_String(result)); in tss_change_auth()
1220 return (result); in tss_change_auth()
1223 if ((result = Tspi_Policy_SetSecret(hPolicy, TSS_SECRET_MODE_SHA1, in tss_change_auth()
1226 result, Trspi_Error_String(result)); in tss_change_auth()
1227 return (result); in tss_change_auth()
1230 if ((result = Tspi_ChangeAuth(hObjectToChange, hParentObject, in tss_change_auth()
1233 result, Trspi_Error_String(result)); in tss_change_auth()
1241 if ((result = Tspi_Context_UnregisterKey(hContext, in tss_change_auth()
1244 result, Trspi_Error_String(result)); in tss_change_auth()
1246 if ((result = Tspi_Context_RegisterKey(hContext, hObjectToChange, in tss_change_auth()
1249 result, Trspi_Error_String(result)); in tss_change_auth()
1251 return (result); in tss_change_auth()
1259 TSS_RESULT result; in token_generate_leaf_key() local
1282 if (result = tss_generate_key(hContext, initFlags, passHash, in token_generate_leaf_key()
1295 result = Tspi_Context_RegisterKey(hContext, *phKey, in token_generate_leaf_key()
1298 if (result == TSS_SUCCESS) { in token_generate_leaf_key()
1306 result = Tspi_Context_UnregisterKey(hContext, in token_generate_leaf_key()
1328 TSS_RESULT result; in token_verify_pin() local
1331 if ((result = Tspi_Context_CreateObject(hContext, in token_verify_pin()
1334 result, Trspi_Error_String(result)); in token_verify_pin()
1343 if ((result = Tspi_Data_Bind(hEncData, hKey, in token_verify_pin()
1346 result, Trspi_Error_String(result)); in token_verify_pin()
1351 result = Tspi_Data_Unbind(hEncData, hKey, &ulUnboundDataLen, in token_verify_pin()
1353 if (result == TPM_E_AUTHFAIL) { in token_verify_pin()
1356 result, Trspi_Error_String(result)); in token_verify_pin()
1358 } else if (result != TSS_SUCCESS) { in token_verify_pin()
1360 result, Trspi_Error_String(result)); in token_verify_pin()
1381 TSS_RESULT result; in token_create_private_tree() local
1397 if ((result = tss_generate_key(hContext, initFlags, NULL, hSRK, in token_create_private_tree()
1399 return (result); in token_create_private_tree()
1404 result = Tspi_Context_RegisterKey(hContext, hPrivateRootKey, in token_create_private_tree()
1408 if (result) { in token_create_private_tree()
1410 return (result); in token_create_private_tree()
1415 result = Tspi_Context_UnregisterKey(hContext, in token_create_private_tree()
1421 if ((result = Tspi_Key_LoadKey(hPrivateRootKey, hSRK))) { in token_create_private_tree()
1423 result, Trspi_Error_String(result)); in token_create_private_tree()
1441 if ((result = Tspi_Key_LoadKey(hPrivateLeafKey, hPrivateRootKey))) { in token_create_private_tree()
1443 result, Trspi_Error_String(result)); in token_create_private_tree()
1472 TSS_RESULT result; in token_create_public_tree() local
1488 if ((result = tss_generate_key(hContext, initFlags, NULL, hSRK, in token_create_public_tree()
1495 result = Tspi_Context_RegisterKey(hContext, hPublicRootKey, in token_create_public_tree()
1499 if (result) { in token_create_public_tree()
1506 result = Tspi_Context_UnregisterKey(hContext, in token_create_public_tree()
1514 if ((result = Tspi_Key_LoadKey(hPublicRootKey, hSRK))) { in token_create_public_tree()
1515 stlogit("Tspi_Key_LoadKey: 0x%x - %s", result, in token_create_public_tree()
1516 Trspi_Error_String(result)); in token_create_public_tree()
1528 if ((result = Tspi_Key_LoadKey(hPublicLeafKey, hPublicRootKey))) { in token_create_public_tree()
1530 result, Trspi_Error_String(result)); in token_create_public_tree()
1564 TSS_RESULT result; in token_specific_login() local
1568 if ((result = token_load_srk(hContext, &hSRK))) { in token_specific_login()
1581 if ((result = token_load_public_root_key(hContext))) { in token_specific_login()
1582 if (result == TPM_E_DECRYPT_ERROR) { in token_specific_login()
1636 result = tss_find_and_load_key( in token_specific_login()
1642 if (result) in token_specific_login()
1648 result = tss_find_and_load_key( in token_specific_login()
1653 if (result) in token_specific_login()
1742 TSS_RESULT result; in verify_user_pin() local
1759 result = tss_find_and_load_key( in verify_user_pin()
1763 if (result) in verify_user_pin()
1768 result = tss_find_and_load_key( in verify_user_pin()
1774 if (result) in verify_user_pin()
1925 TSS_RESULT result; in token_specific_verify_so_pin() local
1956 result = Tspi_Context_GetKeyByUUID(hContext, in token_specific_verify_so_pin()
1959 if (result) in token_specific_verify_so_pin()
1962 result = Tspi_Key_LoadKey(hPublicRootKey, hSRK); in token_specific_verify_so_pin()
1963 if (result) in token_specific_verify_so_pin()
1970 result = Tspi_Context_GetKeyByUUID(hContext, in token_specific_verify_so_pin()
1972 if (result) in token_specific_verify_so_pin()
1975 result = tss_assign_secret_key_policy(hContext, TSS_POLICY_USAGE, in token_specific_verify_so_pin()
1977 if (result) in token_specific_verify_so_pin()
1980 result = Tspi_Key_LoadKey(hPublicLeafKey, hPublicRootKey); in token_specific_verify_so_pin()
1981 if (result) in token_specific_verify_so_pin()
2083 TSS_RESULT result; in token_unwrap_auth_data() local
2088 if ((result = Tspi_Context_CreateObject(hContext, in token_unwrap_auth_data()
2091 result, Trspi_Error_String(result)); in token_unwrap_auth_data()
2095 if ((result = Tspi_SetAttribData(hEncData, in token_unwrap_auth_data()
2099 result, Trspi_Error_String(result)); in token_unwrap_auth_data()
2104 if ((result = Tspi_Data_Unbind(hEncData, hKey, &buf_size, &buf))) { in token_unwrap_auth_data()
2106 result, Trspi_Error_String(result)); in token_unwrap_auth_data()
2135 TSS_RESULT result; in token_specific_rsa_generate_keypair() local
2164 if ((result = token_load_public_root_key(hContext))) { in token_specific_rsa_generate_keypair()
2195 if ((result = tss_generate_key(hContext, initFlags, authData, in token_specific_rsa_generate_keypair()
2197 return (result); in token_specific_rsa_generate_keypair()
2200 if ((result = Tspi_GetAttribData(hKey, TSS_TSPATTRIB_KEY_BLOB, in token_specific_rsa_generate_keypair()
2203 result, Trspi_Error_String(result)); in token_specific_rsa_generate_keypair()
2223 if ((result = Tspi_GetAttribData(hKey, TSS_TSPATTRIB_RSAKEY_INFO, in token_specific_rsa_generate_keypair()
2226 result, Trspi_Error_String(result)); in token_specific_rsa_generate_keypair()
2227 return (result); in token_specific_rsa_generate_keypair()
2260 TSS_RESULT result; in token_rsa_load_key() local
2272 if ((result = token_load_public_root_key(hContext))) in token_rsa_load_key()
2310 result = Tspi_Key_LoadKey(*phKey, hParentKey); in token_rsa_load_key()
2311 if (result) { in token_rsa_load_key()
2314 result, Trspi_Error_String(result)); in token_rsa_load_key()
2323 if ((result = Tspi_Context_LoadKeyByBlob(hContext, in token_rsa_load_key()
2328 result, Trspi_Error_String(result)); in token_rsa_load_key()
2346 if ((result = token_unwrap_auth_data(hContext, in token_rsa_load_key()
2352 if ((result = Tspi_GetPolicyObject(*phKey, in token_rsa_load_key()
2355 result, Trspi_Error_String(result)); in token_rsa_load_key()
2366 if ((result = Tspi_Context_CreateObject(hContext, in token_rsa_load_key()
2371 result, Trspi_Error_String(result)); in token_rsa_load_key()
2375 if ((result = Tspi_Policy_SetSecret(hPolicy, in token_rsa_load_key()
2380 result, Trspi_Error_String(result)); in token_rsa_load_key()
2384 if ((result = Tspi_Policy_AssignToObject(hPolicy, in token_rsa_load_key()
2388 result, Trspi_Error_String(result)); in token_rsa_load_key()
2391 } else if ((result = Tspi_Policy_SetSecret(hPolicy, in token_rsa_load_key()
2394 result, Trspi_Error_String(result)); in token_rsa_load_key()
2413 TSS_RESULT result; in tpm_decrypt_data() local
2420 if ((result = Tspi_Context_CreateObject(hContext, in tpm_decrypt_data()
2423 result, Trspi_Error_String(result)); in tpm_decrypt_data()
2431 if ((result = Tspi_GetAttribData(hKey, TSS_TSPATTRIB_RSAKEY_INFO, in tpm_decrypt_data()
2434 result, Trspi_Error_String(result)); in tpm_decrypt_data()
2435 return (result); in tpm_decrypt_data()
2445 if ((result = Tspi_SetAttribData(hEncData, in tpm_decrypt_data()
2450 result, Trspi_Error_String(result)); in tpm_decrypt_data()
2455 if ((result = Tspi_Data_Unbind(hEncData, hKey, in tpm_decrypt_data()
2458 result, Trspi_Error_String(result)); in tpm_decrypt_data()
2512 TSS_RESULT result; in token_specific_rsa_verify() local
2522 if ((result = Tspi_Context_CreateObject(hContext, in token_specific_rsa_verify()
2525 result, Trspi_Error_String(result)); in token_specific_rsa_verify()
2530 if ((result = Tspi_Hash_SetHashValue(hHash, in_data_len, in token_specific_rsa_verify()
2533 result, Trspi_Error_String(result)); in token_specific_rsa_verify()
2538 result = Tspi_Hash_VerifySignature(hHash, hKey, sig_len, sig); in token_specific_rsa_verify()
2539 if (result != TSS_SUCCESS && in token_specific_rsa_verify()
2540 TPMTOK_TSS_ERROR_CODE(result) != TSS_E_FAIL) { in token_specific_rsa_verify()
2542 result, Trspi_Error_String(result)); in token_specific_rsa_verify()
2545 if (TPMTOK_TSS_ERROR_CODE(result) == TSS_E_FAIL) { in token_specific_rsa_verify()
2563 TSS_RESULT result; in token_specific_rsa_sign() local
2575 if ((result = Tspi_Context_CreateObject(hContext, in token_specific_rsa_sign()
2578 result, Trspi_Error_String(result)); in token_specific_rsa_sign()
2583 if ((result = Tspi_Hash_SetHashValue(hHash, in_data_len, in token_specific_rsa_sign()
2586 result, Trspi_Error_String(result)); in token_specific_rsa_sign()
2591 if ((result = Tspi_Hash_Sign(hHash, hKey, &sig_len, &sig))) { in token_specific_rsa_sign()
2593 result, Trspi_Error_String(result)); in token_specific_rsa_sign()
2618 TSS_RESULT result; in tpm_encrypt_data() local
2626 if ((result = Tspi_Context_CreateObject(hContext, in tpm_encrypt_data()
2629 result, Trspi_Error_String(result)); in tpm_encrypt_data()
2636 if ((result = Tspi_GetAttribData(hKey, TSS_TSPATTRIB_RSAKEY_INFO, in tpm_encrypt_data()
2639 result, Trspi_Error_String(result)); in tpm_encrypt_data()
2640 return (result); in tpm_encrypt_data()
2650 if ((result = Tspi_GetAttribUint32(hKey, TSS_TSPATTRIB_KEY_INFO, in tpm_encrypt_data()
2653 Trspi_Error_String(result)); in tpm_encrypt_data()
2654 return (result); in tpm_encrypt_data()
2656 if ((result = Tspi_GetAttribUint32(hKey, TSS_TSPATTRIB_KEY_INFO, in tpm_encrypt_data()
2659 Trspi_Error_String(result)); in tpm_encrypt_data()
2660 return (result); in tpm_encrypt_data()
2682 if ((result = Tspi_Data_Bind(hEncData, hKey, in tpm_encrypt_data()
2685 result, Trspi_Error_String(result)); in tpm_encrypt_data()
2689 if ((result = Tspi_GetAttribData(hEncData, in tpm_encrypt_data()
2694 result, Trspi_Error_String(result)); in tpm_encrypt_data()
2759 TSS_RESULT result; in token_specific_rsa_verify_recover() local
2772 if ((result = Tspi_GetAttribData(hKey, TSS_TSPATTRIB_RSAKEY_INFO, in token_specific_rsa_verify_recover()
2775 result, Trspi_Error_String(result)); in token_specific_rsa_verify_recover()