Lines Matching refs:ret
41 int ret; in tpm_loadkey2() local
46 ret = oiap(tb, &authhandle, enonce); in tpm_loadkey2()
47 if (ret < 0) { in tpm_loadkey2()
48 pr_info("oiap failed (%d)\n", ret); in tpm_loadkey2()
49 return ret; in tpm_loadkey2()
53 ret = tpm_get_random(NULL, nonceodd, TPM_NONCE_SIZE); in tpm_loadkey2()
54 if (ret < 0) { in tpm_loadkey2()
55 pr_info("tpm_get_random failed (%d)\n", ret); in tpm_loadkey2()
56 return ret; in tpm_loadkey2()
60 ret = TSS_authhmac(authdata, keyauth, SHA1_DIGEST_SIZE, enonce, in tpm_loadkey2()
63 if (ret < 0) in tpm_loadkey2()
64 return ret; in tpm_loadkey2()
75 ret = trusted_tpm_send(tb->data, MAX_BUF_SIZE); in tpm_loadkey2()
76 if (ret < 0) { in tpm_loadkey2()
77 pr_info("authhmac failed (%d)\n", ret); in tpm_loadkey2()
78 return ret; in tpm_loadkey2()
81 ret = TSS_checkhmac1(tb->data, ordinal, nonceodd, keyauth, in tpm_loadkey2()
83 if (ret < 0) { in tpm_loadkey2()
84 pr_info("TSS_checkhmac1 failed (%d)\n", ret); in tpm_loadkey2()
85 return ret; in tpm_loadkey2()
120 int ret; in tpm_unbind() local
126 ret = oiap(tb, &authhandle, enonce); in tpm_unbind()
127 if (ret < 0) { in tpm_unbind()
128 pr_info("oiap failed (%d)\n", ret); in tpm_unbind()
129 return ret; in tpm_unbind()
133 ret = tpm_get_random(NULL, nonceodd, TPM_NONCE_SIZE); in tpm_unbind()
134 if (ret < 0) { in tpm_unbind()
135 pr_info("tpm_get_random failed (%d)\n", ret); in tpm_unbind()
136 return ret; in tpm_unbind()
140 ret = TSS_authhmac(authdata, keyauth, SHA1_DIGEST_SIZE, enonce, in tpm_unbind()
144 if (ret < 0) in tpm_unbind()
145 return ret; in tpm_unbind()
157 ret = trusted_tpm_send(tb->data, MAX_BUF_SIZE); in tpm_unbind()
158 if (ret < 0) { in tpm_unbind()
159 pr_info("authhmac failed (%d)\n", ret); in tpm_unbind()
160 return ret; in tpm_unbind()
165 ret = TSS_checkhmac1(tb->data, ordinal, nonceodd, in tpm_unbind()
170 if (ret < 0) { in tpm_unbind()
171 pr_info("TSS_checkhmac1 failed (%d)\n", ret); in tpm_unbind()
172 return ret; in tpm_unbind()
203 int ret; in tpm_sign() local
209 ret = oiap(tb, &authhandle, enonce); in tpm_sign()
210 if (ret < 0) { in tpm_sign()
211 pr_info("oiap failed (%d)\n", ret); in tpm_sign()
212 return ret; in tpm_sign()
216 ret = tpm_get_random(NULL, nonceodd, TPM_NONCE_SIZE); in tpm_sign()
217 if (ret < 0) { in tpm_sign()
218 pr_info("tpm_get_random failed (%d)\n", ret); in tpm_sign()
219 return ret; in tpm_sign()
223 ret = TSS_authhmac(authdata, keyauth, SHA1_DIGEST_SIZE, enonce, in tpm_sign()
227 if (ret < 0) in tpm_sign()
228 return ret; in tpm_sign()
240 ret = trusted_tpm_send(tb->data, MAX_BUF_SIZE); in tpm_sign()
241 if (ret < 0) { in tpm_sign()
242 pr_info("authhmac failed (%d)\n", ret); in tpm_sign()
243 return ret; in tpm_sign()
248 ret = TSS_checkhmac1(tb->data, ordinal, nonceodd, in tpm_sign()
253 if (ret < 0) { in tpm_sign()
254 pr_info("TSS_checkhmac1 failed (%d)\n", ret); in tpm_sign()
255 return ret; in tpm_sign()
396 int ret; in tpm_key_query() local
404 ret = determine_akcipher(params->encoding, params->hash_algo, alg_name); in tpm_key_query()
405 if (ret < 0) in tpm_key_query()
406 return ret; in tpm_key_query()
415 ret = crypto_akcipher_set_pub_key(tfm, der_pub_key, der_pub_key_len); in tpm_key_query()
416 if (ret < 0) in tpm_key_query()
432 ret = 0; in tpm_key_query()
435 pr_devel("<==%s() = %d\n", __func__, ret); in tpm_key_query()
436 return ret; in tpm_key_query()
454 int ret; in tpm_key_encrypt() local
458 ret = determine_akcipher(params->encoding, params->hash_algo, alg_name); in tpm_key_encrypt()
459 if (ret < 0) in tpm_key_encrypt()
460 return ret; in tpm_key_encrypt()
469 ret = crypto_akcipher_set_pub_key(tfm, der_pub_key, der_pub_key_len); in tpm_key_encrypt()
470 if (ret < 0) in tpm_key_encrypt()
473 ret = -ENOMEM; in tpm_key_encrypt()
487 ret = crypto_akcipher_encrypt(req); in tpm_key_encrypt()
488 ret = crypto_wait_req(ret, &cwait); in tpm_key_encrypt()
490 if (ret == 0) in tpm_key_encrypt()
491 ret = req->dst_len; in tpm_key_encrypt()
496 pr_devel("<==%s() = %d\n", __func__, ret); in tpm_key_encrypt()
497 return ret; in tpm_key_encrypt()
708 int ret = -EOPNOTSUPP; in tpm_key_eds_op() local
713 ret = tpm_key_encrypt(tk, params, in, out); in tpm_key_eds_op()
716 ret = tpm_key_decrypt(tk, params, in, out); in tpm_key_eds_op()
719 ret = tpm_key_sign(tk, params, in, out); in tpm_key_eds_op()
725 return ret; in tpm_key_eds_op()
742 int ret; in tpm_key_verify_signature() local
753 ret = determine_akcipher(sig->encoding, sig->hash_algo, alg_name); in tpm_key_verify_signature()
754 if (ret < 0) in tpm_key_verify_signature()
755 return ret; in tpm_key_verify_signature()
764 ret = crypto_akcipher_set_pub_key(tfm, der_pub_key, der_pub_key_len); in tpm_key_verify_signature()
765 if (ret < 0) in tpm_key_verify_signature()
768 ret = -ENOMEM; in tpm_key_verify_signature()
782 ret = crypto_wait_req(crypto_akcipher_verify(req), &cwait); in tpm_key_verify_signature()
787 pr_devel("<==%s() = %d\n", __func__, ret); in tpm_key_verify_signature()
788 if (WARN_ON_ONCE(ret > 0)) in tpm_key_verify_signature()
789 ret = -EINVAL; in tpm_key_verify_signature()
790 return ret; in tpm_key_verify_signature()