Lines Matching refs:result

495 	TSS_RESULT result;
498 result = Tspi_GetAttribData(hKey, TSS_TSPATTRIB_KEY_BLOB,
500 if (result != TSS_SUCCESS) {
502 result, Trspi_Error_String(result));
503 return (result);
507 result = Trspi_UnloadBlob_PUBKEY(&offset, blob, &pub_key);
508 if (result != TSS_SUCCESS) {
510 result, Trspi_Error_String(result));
511 return (result);
527 result = Tspi_SetAttribData(hKey, TSS_TSPATTRIB_KEY_BLOB,
529 if (result != TSS_SUCCESS) {
531 result, Trspi_Error_String(result));
532 return (result);
535 return (result);
544 TSS_RESULT result;
550 if ((result = Tspi_Context_GetTpmObject(hContext, &hTPM))) {
552 result, Trspi_Error_String(result));
555 if ((result = Tspi_TPM_GetCapability(hTPM,
559 result, Trspi_Error_String(result));
627 TSS_RESULT result;
629 if ((result = Tspi_Context_Create(pContext))) {
631 result, Trspi_Error_String(result));
635 if ((result = Tspi_Context_Connect(*pContext, NULL))) {
637 result, Trspi_Error_String(result));
642 return (result);
650 TSS_RESULT result;
652 result = open_tss_context(hContext);
653 if (result)
656 if ((result = Tspi_Context_GetDefaultPolicy(*hContext,
659 result, Trspi_Error_String(result));
668 result = token_get_tpm_info(*hContext, nv_token_data);
669 return (result);
688 TSS_RESULT result;
697 result = Tspi_Context_CreateObject(hContext, TSS_OBJECT_TYPE_RSAKEY,
699 if (result != TSS_SUCCESS) {
701 result, Trspi_Error_String(result));
705 result = set_public_modulus(hContext, *phKey, size_n, n);
706 if (result != TSS_SUCCESS) {
713 result = Tspi_SetAttribData(*phKey, TSS_TSPATTRIB_KEY_BLOB,
715 if (result != TSS_SUCCESS) {
717 result, Trspi_Error_String(result));
723 result = tss_assign_secret_key_policy(hContext, TSS_POLICY_MIGRATION,
727 if ((result = Tspi_SetAttribUint32(*phKey,
731 result, Trspi_Error_String(result));
736 if ((result = Tspi_SetAttribUint32(*phKey,
740 result, Trspi_Error_String(result));
746 result = Tspi_Key_WrapKey(*phKey, hParentKey, NULL_HPCRS);
747 if (result != TSS_SUCCESS) {
749 result, Trspi_Error_String(result));
772 TSS_RESULT result;
866 if ((result = Tspi_Context_CreateObject(hContext,
869 result, Trspi_Error_String(result));
870 return (result);
873 if ((result = set_public_modulus(hContext, *phKey,
879 result = tss_assign_secret_key_policy(hContext,
881 if (result) {
887 result = set_legacy_key_params(*phKey);
888 if (result) {
898 if ((result = Tspi_GetAttribData(*phKey, TSS_TSPATTRIB_KEY_BLOB,
901 result, Trspi_Error_String(result));
929 TSS_RESULT result;
932 if ((result = Tspi_Context_CreateObject(hContext,
935 result, Trspi_Error_String(result));
936 return (result);
938 if ((result = Tspi_Policy_AssignToObject(hPolicy, hKey))) {
940 result, Trspi_Error_String(result));
944 result = Tspi_Policy_SetSecret(hPolicy, TSS_SECRET_MODE_NONE,
947 result = Tspi_Policy_SetSecret(hPolicy, TSS_SECRET_MODE_SHA1,
950 if (result != TSS_SUCCESS) {
952 result, Trspi_Error_String(result));
956 if (result != TSS_SUCCESS)
958 return (result);
973 TSS_RESULT result;
991 result = tss_assign_secret_key_policy(hContext, TSS_POLICY_USAGE,
994 return (result);
1008 TSS_RESULT result;
1013 if ((result = Tspi_Context_GetTpmObject(hContext, &hTPM))) {
1015 result, Trspi_Error_String(result));
1020 if ((result = Tspi_Context_LoadKeyByUUID(hContext,
1023 result, Trspi_Error_String(result));
1026 if ((result = Tspi_GetPolicyObject(*hSRK, TSS_POLICY_USAGE,
1029 result, Trspi_Error_String(result));
1032 if ((result = Tspi_Policy_SetSecret(hPolicy, TSS_SECRET_MODE_SHA1,
1035 result, Trspi_Error_String(result));
1040 return (result);
1048 TSS_RESULT result;
1055 result = Tspi_Context_GetKeyByUUID(hContext,
1057 if (result) {
1059 result, Trspi_Error_String(result));
1060 return (result);
1064 result = tss_assign_secret_key_policy(hContext,
1066 if (result)
1067 return (result);
1070 result = Tspi_Key_LoadKey(*hKey, hParent);
1071 if (result)
1073 result, Trspi_Error_String(result));
1075 return (result);
1081 TSS_RESULT result;
1087 if ((result = token_load_srk(hContext, &hSRK))) {
1088 return (result);
1091 result = tss_find_and_load_key(hContext,
1094 if (result)
1095 return (result);
1097 return (result);
1103 TSS_RESULT result;
1105 if ((result = Tspi_SetAttribUint32(hKey,
1110 result, Trspi_Error_String(result));
1111 return (result);
1114 if ((result = Tspi_SetAttribUint32(hKey,
1119 result, Trspi_Error_String(result));
1120 return (result);
1123 return (result);
1130 TSS_RESULT result;
1133 if ((result = Tspi_Context_CreateObject(hContext,
1136 result, Trspi_Error_String(result));
1137 return (result);
1139 result = tss_assign_secret_key_policy(hContext, TSS_POLICY_USAGE,
1142 if (result) {
1144 return (result);
1148 if ((result = Tspi_Context_CreateObject(hContext,
1152 result, Trspi_Error_String(result));
1154 return (result);
1158 result = Tspi_Policy_SetSecret(hMigPolicy,
1161 result = Tspi_Policy_SetSecret(hMigPolicy,
1165 if (result != TSS_SUCCESS) {
1167 result, Trspi_Error_String(result));
1170 return (result);
1173 if ((result = Tspi_Policy_AssignToObject(hMigPolicy, *phKey))) {
1175 result, Trspi_Error_String(result));
1178 return (result);
1183 result = set_legacy_key_params(*phKey);
1184 if (result) {
1187 return (result);
1191 if ((result = Tspi_Key_CreateKey(*phKey, hParentKey, 0))) {
1193 result, Trspi_Error_String(result));
1198 return (result);
1208 TSS_RESULT result;
1212 if ((result = Tspi_Context_CreateObject(hContext,
1215 result, Trspi_Error_String(result));
1216 return (result);
1219 if ((result = Tspi_Policy_SetSecret(hPolicy, TSS_SECRET_MODE_SHA1,
1222 result, Trspi_Error_String(result));
1223 return (result);
1226 if ((result = Tspi_ChangeAuth(hObjectToChange, hParentObject,
1229 result, Trspi_Error_String(result));
1237 if ((result = Tspi_Context_UnregisterKey(hContext,
1240 result, Trspi_Error_String(result));
1242 if ((result = Tspi_Context_RegisterKey(hContext, hObjectToChange,
1245 result, Trspi_Error_String(result));
1247 return (result);
1255 TSS_RESULT result;
1278 if (result = tss_generate_key(hContext, initFlags, passHash,
1291 result = Tspi_Context_RegisterKey(hContext, *phKey,
1294 if (result == TSS_SUCCESS) {
1302 result = Tspi_Context_UnregisterKey(hContext,
1324 TSS_RESULT result;
1327 if ((result = Tspi_Context_CreateObject(hContext,
1330 result, Trspi_Error_String(result));
1339 if ((result = Tspi_Data_Bind(hEncData, hKey,
1342 result, Trspi_Error_String(result));
1347 result = Tspi_Data_Unbind(hEncData, hKey, &ulUnboundDataLen,
1349 if (result == TPM_E_AUTHFAIL) {
1352 result, Trspi_Error_String(result));
1354 } else if (result != TSS_SUCCESS) {
1356 result, Trspi_Error_String(result));
1377 TSS_RESULT result;
1393 if ((result = tss_generate_key(hContext, initFlags, NULL, hSRK,
1395 return (result);
1400 result = Tspi_Context_RegisterKey(hContext, hPrivateRootKey,
1404 if (result) {
1406 return (result);
1411 result = Tspi_Context_UnregisterKey(hContext,
1417 if ((result = Tspi_Key_LoadKey(hPrivateRootKey, hSRK))) {
1419 result, Trspi_Error_String(result));
1437 if ((result = Tspi_Key_LoadKey(hPrivateLeafKey, hPrivateRootKey))) {
1439 result, Trspi_Error_String(result));
1468 TSS_RESULT result;
1484 if ((result = tss_generate_key(hContext, initFlags, NULL, hSRK,
1491 result = Tspi_Context_RegisterKey(hContext, hPublicRootKey,
1495 if (result) {
1502 result = Tspi_Context_UnregisterKey(hContext,
1505 /* does result matter here? */
1510 if ((result = Tspi_Key_LoadKey(hPublicRootKey, hSRK))) {
1511 stlogit("Tspi_Key_LoadKey: 0x%x - %s", result,
1512 Trspi_Error_String(result));
1524 if ((result = Tspi_Key_LoadKey(hPublicLeafKey, hPublicRootKey))) {
1526 result, Trspi_Error_String(result));
1560 TSS_RESULT result;
1564 if ((result = token_load_srk(hContext, &hSRK))) {
1577 if ((result = token_load_public_root_key(hContext))) {
1578 if (result == TPM_E_DECRYPT_ERROR) {
1632 result = tss_find_and_load_key(
1638 if (result)
1644 result = tss_find_and_load_key(
1649 if (result)
1738 TSS_RESULT result;
1755 result = tss_find_and_load_key(
1759 if (result)
1764 result = tss_find_and_load_key(
1770 if (result)
1921 TSS_RESULT result;
1952 result = Tspi_Context_GetKeyByUUID(hContext,
1955 if (result)
1958 result = Tspi_Key_LoadKey(hPublicRootKey, hSRK);
1959 if (result)
1966 result = Tspi_Context_GetKeyByUUID(hContext,
1968 if (result)
1971 result = tss_assign_secret_key_policy(hContext, TSS_POLICY_USAGE,
1973 if (result)
1976 result = Tspi_Key_LoadKey(hPublicLeafKey, hPublicRootKey);
1977 if (result)
2079 TSS_RESULT result;
2084 if ((result = Tspi_Context_CreateObject(hContext,
2087 result, Trspi_Error_String(result));
2091 if ((result = Tspi_SetAttribData(hEncData,
2095 result, Trspi_Error_String(result));
2100 if ((result = Tspi_Data_Unbind(hEncData, hKey, &buf_size, &buf))) {
2102 result, Trspi_Error_String(result));
2131 TSS_RESULT result;
2160 if ((result = token_load_public_root_key(hContext))) {
2191 if ((result = tss_generate_key(hContext, initFlags, authData,
2193 return (result);
2196 if ((result = Tspi_GetAttribData(hKey, TSS_TSPATTRIB_KEY_BLOB,
2199 result, Trspi_Error_String(result));
2219 if ((result = Tspi_GetAttribData(hKey, TSS_TSPATTRIB_RSAKEY_INFO,
2222 result, Trspi_Error_String(result));
2223 return (result);
2256 TSS_RESULT result;
2268 if ((result = token_load_public_root_key(hContext)))
2306 result = Tspi_Key_LoadKey(*phKey, hParentKey);
2307 if (result) {
2310 result, Trspi_Error_String(result));
2319 if ((result = Tspi_Context_LoadKeyByBlob(hContext,
2324 result, Trspi_Error_String(result));
2342 if ((result = token_unwrap_auth_data(hContext,
2348 if ((result = Tspi_GetPolicyObject(*phKey,
2351 result, Trspi_Error_String(result));
2362 if ((result = Tspi_Context_CreateObject(hContext,
2367 result, Trspi_Error_String(result));
2371 if ((result = Tspi_Policy_SetSecret(hPolicy,
2376 result, Trspi_Error_String(result));
2380 if ((result = Tspi_Policy_AssignToObject(hPolicy,
2384 result, Trspi_Error_String(result));
2387 } else if ((result = Tspi_Policy_SetSecret(hPolicy,
2390 result, Trspi_Error_String(result));
2409 TSS_RESULT result;
2416 if ((result = Tspi_Context_CreateObject(hContext,
2419 result, Trspi_Error_String(result));
2427 if ((result = Tspi_GetAttribData(hKey, TSS_TSPATTRIB_RSAKEY_INFO,
2430 result, Trspi_Error_String(result));
2431 return (result);
2441 if ((result = Tspi_SetAttribData(hEncData,
2446 result, Trspi_Error_String(result));
2451 if ((result = Tspi_Data_Unbind(hEncData, hKey,
2454 result, Trspi_Error_String(result));
2508 TSS_RESULT result;
2518 if ((result = Tspi_Context_CreateObject(hContext,
2521 result, Trspi_Error_String(result));
2526 if ((result = Tspi_Hash_SetHashValue(hHash, in_data_len,
2529 result, Trspi_Error_String(result));
2534 result = Tspi_Hash_VerifySignature(hHash, hKey, sig_len, sig);
2535 if (result != TSS_SUCCESS &&
2536 TPMTOK_TSS_ERROR_CODE(result) != TSS_E_FAIL) {
2538 result, Trspi_Error_String(result));
2541 if (TPMTOK_TSS_ERROR_CODE(result) == TSS_E_FAIL) {
2559 TSS_RESULT result;
2571 if ((result = Tspi_Context_CreateObject(hContext,
2574 result, Trspi_Error_String(result));
2579 if ((result = Tspi_Hash_SetHashValue(hHash, in_data_len,
2582 result, Trspi_Error_String(result));
2587 if ((result = Tspi_Hash_Sign(hHash, hKey, &sig_len, &sig))) {
2589 result, Trspi_Error_String(result));
2614 TSS_RESULT result;
2622 if ((result = Tspi_Context_CreateObject(hContext,
2625 result, Trspi_Error_String(result));
2632 if ((result = Tspi_GetAttribData(hKey, TSS_TSPATTRIB_RSAKEY_INFO,
2635 result, Trspi_Error_String(result));
2636 return (result);
2646 if ((result = Tspi_GetAttribUint32(hKey, TSS_TSPATTRIB_KEY_INFO,
2649 Trspi_Error_String(result));
2650 return (result);
2652 if ((result = Tspi_GetAttribUint32(hKey, TSS_TSPATTRIB_KEY_INFO,
2655 Trspi_Error_String(result));
2656 return (result);
2678 if ((result = Tspi_Data_Bind(hEncData, hKey,
2681 result, Trspi_Error_String(result));
2685 if ((result = Tspi_GetAttribData(hEncData,
2690 result, Trspi_Error_String(result));
2757 TSS_RESULT result;
2772 if ((result = Tspi_GetAttribData(hKey, TSS_TSPATTRIB_RSAKEY_INFO,
2775 result, Trspi_Error_String(result));