• Home
  • Raw
  • Download

Lines Matching refs:rc

36     TSS2_RC rc;  in create_policy()  local
45 rc = Tss2_Sys_GetTctiContext (sys_ctx, &tcti_ctx); in create_policy()
46 if (rc != TSS2_RC_SUCCESS || tcti_ctx == NULL) { in create_policy()
48 return rc; in create_policy()
51 rc = create_auth_session (&trialPolicySession, in create_policy()
62 if (rc != TSS2_RC_SUCCESS) { in create_policy()
63 LOG_ERROR ("create_auth_session failed with rc: 0x%x", rc); in create_policy()
64 return rc; in create_policy()
66 rc = Tss2_Sys_PolicyAuthValue (sys_ctx, in create_policy()
70 if (rc != TSS2_RC_SUCCESS) { in create_policy()
71 LOG_ERROR ("Tss2_Sys_PolicyAuthValue failed with rc: 0x%x", rc); in create_policy()
72 return rc; in create_policy()
74 rc = Tss2_Sys_PolicyGetDigest (sys_ctx, in create_policy()
79 if (rc != TSS2_RC_SUCCESS) { in create_policy()
80 LOG_ERROR ("Tss2_Sys_PolicyGetDigest failed with rc: 0x%x", rc); in create_policy()
81 return rc; in create_policy()
84 rc = Tss2_Sys_FlushContext (sys_ctx, in create_policy()
86 if (rc != TSS2_RC_SUCCESS) { in create_policy()
87 LOG_ERROR ("Tss2_Sys_FlushContext failed with rc: 0x%x", rc); in create_policy()
88 return rc; in create_policy()
92 return rc; in create_policy()
102 TSS2_RC rc; in nv_rw_with_session() local
144 rc = Tss2_Sys_GetTctiContext (sys_ctx, &tcti_ctx); in nv_rw_with_session()
145 if (rc != TSS2_RC_SUCCESS || tcti_ctx == NULL) { in nv_rw_with_session()
146 LOG_ERROR ("Failed to get TCTI from Sys context, got RC: 0x%x", rc); in nv_rw_with_session()
150 rc = DefineNvIndex (sys_ctx, in nv_rw_with_session()
158 if (rc != TSS2_RC_SUCCESS) { in nv_rw_with_session()
159 LOG_ERROR ("DefineNvIndex failed with RC: 0x%x", rc); in nv_rw_with_session()
160 return rc; in nv_rw_with_session()
168 rc = AddEntity(TPM20_INDEX_PASSWORD_TEST, &nvAuth); in nv_rw_with_session()
169 if (rc != TSS2_RC_SUCCESS) { in nv_rw_with_session()
170 LOG_ERROR ("AddEntity failed with RC: 0x%x", rc); in nv_rw_with_session()
171 return rc; in nv_rw_with_session()
175 rc = tpm_handle_to_name (tcti_ctx, in nv_rw_with_session()
178 if (rc != TSS2_RC_SUCCESS) { in nv_rw_with_session()
179 LOG_ERROR ("tpm_handle_to_name failed with RC: 0x%x", rc); in nv_rw_with_session()
180 return rc; in nv_rw_with_session()
189 rc = create_auth_session (&nvSession, in nv_rw_with_session()
200 if (rc != TSS2_RC_SUCCESS) { in nv_rw_with_session()
201 LOG_ERROR ("create_auth_session failed with RC: 0x%x", rc); in nv_rw_with_session()
202 return rc; in nv_rw_with_session()
212 rc = tpm_handle_to_name (tcti_ctx, in nv_rw_with_session()
215 if (rc != TSS2_RC_SUCCESS) { in nv_rw_with_session()
216 LOG_ERROR ("tpm_handle_to_name failed with RC: 0x%x", rc); in nv_rw_with_session()
217 return rc; in nv_rw_with_session()
224 rc = Tss2_Sys_PolicyAuthValue (sys_ctx, in nv_rw_with_session()
228 if (rc != TSS2_RC_SUCCESS) { in nv_rw_with_session()
229 LOG_ERROR ("Tss2_Sys_PolicyAuthValue failed with RC: 0x%x", rc); in nv_rw_with_session()
230 return rc; in nv_rw_with_session()
234 rc = Tss2_Sys_NV_Write_Prepare (sys_ctx, in nv_rw_with_session()
239 if (rc != TSS2_RC_SUCCESS) { in nv_rw_with_session()
240 LOG_ERROR ("Tss2_Sys_NV_Write_Prepare failed with RC: 0x%x", rc); in nv_rw_with_session()
241 return rc; in nv_rw_with_session()
251 rc = compute_command_hmac(sys_ctx, in nv_rw_with_session()
256 if (rc != TSS2_RC_SUCCESS) { in nv_rw_with_session()
257 LOG_ERROR ("compute_command_hmac failed with RC: 0x%x", rc); in nv_rw_with_session()
258 return rc; in nv_rw_with_session()
266 rc = TSS2_RETRY_EXP (Tss2_Sys_NV_Write (sys_ctx, in nv_rw_with_session()
273 if (rc != TSS2_RC_SUCCESS) { in nv_rw_with_session()
274 LOG_ERROR ("Tss2_Sys_NV_Write failed with RC: 0x%x", rc); in nv_rw_with_session()
275 return rc; in nv_rw_with_session()
287 rc = check_response_hmac (sys_ctx, in nv_rw_with_session()
293 if (rc != TSS2_RC_SUCCESS) { in nv_rw_with_session()
294 LOG_ERROR ("check_response_hmac failed with RC: 0x%x", rc); in nv_rw_with_session()
295 return rc; in nv_rw_with_session()
299 rc = Tss2_Sys_PolicyAuthValue (sys_ctx, in nv_rw_with_session()
303 if (rc != TSS2_RC_SUCCESS) { in nv_rw_with_session()
304 LOG_ERROR ("Tss2_Sys_PolicyAuthValue failed with RC: 0x%x", rc); in nv_rw_with_session()
305 return rc; in nv_rw_with_session()
309 rc = Tss2_Sys_NV_Read_Prepare (sys_ctx, in nv_rw_with_session()
314 if (rc != TSS2_RC_SUCCESS) { in nv_rw_with_session()
315 LOG_ERROR ("Tss2_Sys_NV_Read_Prepare failed with RC: 0x%x", rc); in nv_rw_with_session()
316 return rc; in nv_rw_with_session()
327 rc = compute_command_hmac (sys_ctx, in nv_rw_with_session()
332 if (rc != TSS2_RC_SUCCESS) { in nv_rw_with_session()
333 LOG_ERROR ("compute_command_hmac failed with RC: 0x%x", rc); in nv_rw_with_session()
334 return rc; in nv_rw_with_session()
342 rc = Tss2_Sys_NV_Read (sys_ctx, in nv_rw_with_session()
350 if (rc != TSS2_RC_SUCCESS) { in nv_rw_with_session()
351 LOG_ERROR ("Tss2_Sys_NV_Read failed with RC: 0x%x", rc); in nv_rw_with_session()
352 return rc; in nv_rw_with_session()
363 rc = check_response_hmac (sys_ctx, in nv_rw_with_session()
369 if (rc != TSS2_RC_SUCCESS) { in nv_rw_with_session()
370 LOG_ERROR ("check_response_hmac failed with RC: 0x%x", rc); in nv_rw_with_session()
371 return rc; in nv_rw_with_session()
389 rc = Tss2_Sys_NV_UndefineSpace (sys_ctx, in nv_rw_with_session()
394 if (rc != TSS2_RC_SUCCESS) { in nv_rw_with_session()
395 LOG_ERROR ("Tss2_Sys_NV_UndefineSpace failed with RC: 0x%x", rc); in nv_rw_with_session()
396 return rc; in nv_rw_with_session()
404 return rc; in nv_rw_with_session()
410 TSS2_RC rc; in test_invoke() local
416 rc = nv_rw_with_session (sys_ctx, &authPolicy, nvAttributes, TPM2_SE_HMAC); in test_invoke()
417 if (rc != TSS2_RC_SUCCESS) in test_invoke()
418 return rc; in test_invoke()
422 rc = create_policy (sys_ctx, &authPolicy); in test_invoke()
423 if (rc != TSS2_RC_SUCCESS) in test_invoke()
424 return rc; in test_invoke()
426 rc = nv_rw_with_session (sys_ctx, &authPolicy, nvAttributes, TPM2_SE_POLICY); in test_invoke()
427 if (rc != TSS2_RC_SUCCESS) in test_invoke()
428 return rc; in test_invoke()