Lines Matching refs:ret
45 int ret; in tpm_loadkey2() local
50 ret = oiap(tb, &authhandle, enonce); in tpm_loadkey2()
51 if (ret < 0) { in tpm_loadkey2()
52 pr_info("oiap failed (%d)\n", ret); in tpm_loadkey2()
53 return ret; in tpm_loadkey2()
57 ret = tpm_get_random(NULL, nonceodd, TPM_NONCE_SIZE); in tpm_loadkey2()
58 if (ret < 0) { in tpm_loadkey2()
59 pr_info("tpm_get_random failed (%d)\n", ret); in tpm_loadkey2()
60 return ret; in tpm_loadkey2()
64 ret = TSS_authhmac(authdata, keyauth, SHA1_DIGEST_SIZE, enonce, in tpm_loadkey2()
67 if (ret < 0) in tpm_loadkey2()
68 return ret; in tpm_loadkey2()
82 ret = trusted_tpm_send(tb->data, MAX_BUF_SIZE); in tpm_loadkey2()
83 if (ret < 0) { in tpm_loadkey2()
84 pr_info("authhmac failed (%d)\n", ret); in tpm_loadkey2()
85 return ret; in tpm_loadkey2()
88 ret = TSS_checkhmac1(tb->data, ordinal, nonceodd, keyauth, in tpm_loadkey2()
90 if (ret < 0) { in tpm_loadkey2()
91 pr_info("TSS_checkhmac1 failed (%d)\n", ret); in tpm_loadkey2()
92 return ret; in tpm_loadkey2()
130 int ret; in tpm_unbind() local
136 ret = oiap(tb, &authhandle, enonce); in tpm_unbind()
137 if (ret < 0) { in tpm_unbind()
138 pr_info("oiap failed (%d)\n", ret); in tpm_unbind()
139 return ret; in tpm_unbind()
143 ret = tpm_get_random(NULL, nonceodd, TPM_NONCE_SIZE); in tpm_unbind()
144 if (ret < 0) { in tpm_unbind()
145 pr_info("tpm_get_random failed (%d)\n", ret); in tpm_unbind()
146 return ret; in tpm_unbind()
150 ret = TSS_authhmac(authdata, keyauth, SHA1_DIGEST_SIZE, enonce, in tpm_unbind()
154 if (ret < 0) in tpm_unbind()
155 return ret; in tpm_unbind()
170 ret = trusted_tpm_send(tb->data, MAX_BUF_SIZE); in tpm_unbind()
171 if (ret < 0) { in tpm_unbind()
172 pr_info("authhmac failed (%d)\n", ret); in tpm_unbind()
173 return ret; in tpm_unbind()
178 ret = TSS_checkhmac1(tb->data, ordinal, nonceodd, in tpm_unbind()
183 if (ret < 0) { in tpm_unbind()
184 pr_info("TSS_checkhmac1 failed (%d)\n", ret); in tpm_unbind()
185 return ret; in tpm_unbind()
216 int ret; in tpm_sign() local
222 ret = oiap(tb, &authhandle, enonce); in tpm_sign()
223 if (ret < 0) { in tpm_sign()
224 pr_info("oiap failed (%d)\n", ret); in tpm_sign()
225 return ret; in tpm_sign()
229 ret = tpm_get_random(NULL, nonceodd, TPM_NONCE_SIZE); in tpm_sign()
230 if (ret < 0) { in tpm_sign()
231 pr_info("tpm_get_random failed (%d)\n", ret); in tpm_sign()
232 return ret; in tpm_sign()
236 ret = TSS_authhmac(authdata, keyauth, SHA1_DIGEST_SIZE, enonce, in tpm_sign()
240 if (ret < 0) in tpm_sign()
241 return ret; in tpm_sign()
256 ret = trusted_tpm_send(tb->data, MAX_BUF_SIZE); in tpm_sign()
257 if (ret < 0) { in tpm_sign()
258 pr_info("authhmac failed (%d)\n", ret); in tpm_sign()
259 return ret; in tpm_sign()
264 ret = TSS_checkhmac1(tb->data, ordinal, nonceodd, in tpm_sign()
269 if (ret < 0) { in tpm_sign()
270 pr_info("TSS_checkhmac1 failed (%d)\n", ret); in tpm_sign()
271 return ret; in tpm_sign()
412 int ret; in tpm_key_query() local
420 ret = determine_akcipher(params->encoding, params->hash_algo, alg_name); in tpm_key_query()
421 if (ret < 0) in tpm_key_query()
422 return ret; in tpm_key_query()
431 ret = crypto_akcipher_set_pub_key(tfm, der_pub_key, der_pub_key_len); in tpm_key_query()
432 if (ret < 0) in tpm_key_query()
448 ret = 0; in tpm_key_query()
451 pr_devel("<==%s() = %d\n", __func__, ret); in tpm_key_query()
452 return ret; in tpm_key_query()
470 int ret; in tpm_key_encrypt() local
474 ret = determine_akcipher(params->encoding, params->hash_algo, alg_name); in tpm_key_encrypt()
475 if (ret < 0) in tpm_key_encrypt()
476 return ret; in tpm_key_encrypt()
485 ret = crypto_akcipher_set_pub_key(tfm, der_pub_key, der_pub_key_len); in tpm_key_encrypt()
486 if (ret < 0) in tpm_key_encrypt()
489 ret = -ENOMEM; in tpm_key_encrypt()
503 ret = crypto_akcipher_encrypt(req); in tpm_key_encrypt()
504 ret = crypto_wait_req(ret, &cwait); in tpm_key_encrypt()
506 if (ret == 0) in tpm_key_encrypt()
507 ret = req->dst_len; in tpm_key_encrypt()
512 pr_devel("<==%s() = %d\n", __func__, ret); in tpm_key_encrypt()
513 return ret; in tpm_key_encrypt()
725 int ret = -EOPNOTSUPP; in tpm_key_eds_op() local
730 ret = tpm_key_encrypt(tk, params, in, out); in tpm_key_eds_op()
733 ret = tpm_key_decrypt(tk, params, in, out); in tpm_key_eds_op()
736 ret = tpm_key_sign(tk, params, in, out); in tpm_key_eds_op()
742 return ret; in tpm_key_eds_op()
759 int ret; in tpm_key_verify_signature() local
770 ret = determine_akcipher(sig->encoding, sig->hash_algo, alg_name); in tpm_key_verify_signature()
771 if (ret < 0) in tpm_key_verify_signature()
772 return ret; in tpm_key_verify_signature()
781 ret = crypto_akcipher_set_pub_key(tfm, der_pub_key, der_pub_key_len); in tpm_key_verify_signature()
782 if (ret < 0) in tpm_key_verify_signature()
785 ret = -ENOMEM; in tpm_key_verify_signature()
799 ret = crypto_wait_req(crypto_akcipher_verify(req), &cwait); in tpm_key_verify_signature()
804 pr_devel("<==%s() = %d\n", __func__, ret); in tpm_key_verify_signature()
805 if (WARN_ON_ONCE(ret > 0)) in tpm_key_verify_signature()
806 ret = -EINVAL; in tpm_key_verify_signature()
807 return ret; in tpm_key_verify_signature()