Lines Matching refs:rc

22 	enum pkcs11_rc rc = PKCS11_CKR_GENERAL_ERROR;  in pkcs2tee_proc_params_rsa_pss()  local
30 rc = serialargs_get_u32(&args, &hash); in pkcs2tee_proc_params_rsa_pss()
31 if (rc) in pkcs2tee_proc_params_rsa_pss()
32 return rc; in pkcs2tee_proc_params_rsa_pss()
34 rc = serialargs_get_u32(&args, &mgf); in pkcs2tee_proc_params_rsa_pss()
35 if (rc) in pkcs2tee_proc_params_rsa_pss()
36 return rc; in pkcs2tee_proc_params_rsa_pss()
38 rc = serialargs_get_u32(&args, &salt_len); in pkcs2tee_proc_params_rsa_pss()
39 if (rc) in pkcs2tee_proc_params_rsa_pss()
40 return rc; in pkcs2tee_proc_params_rsa_pss()
121 enum pkcs11_rc rc = PKCS11_CKR_GENERAL_ERROR; in pkcs2tee_algo_rsa_pss() local
128 rc = serialargs_get_u32(&args, &hash); in pkcs2tee_algo_rsa_pss()
129 if (rc) in pkcs2tee_algo_rsa_pss()
130 return rc; in pkcs2tee_algo_rsa_pss()
132 rc = serialargs_get_u32(&args, &mgf); in pkcs2tee_algo_rsa_pss()
133 if (rc) in pkcs2tee_algo_rsa_pss()
134 return rc; in pkcs2tee_algo_rsa_pss()
136 rc = serialargs_get_u32(&args, &salt_len); in pkcs2tee_algo_rsa_pss()
137 if (rc) in pkcs2tee_algo_rsa_pss()
138 return rc; in pkcs2tee_algo_rsa_pss()
204 enum pkcs11_rc rc = PKCS11_CKR_GENERAL_ERROR; in pkcs2tee_proc_params_rsa_oaep() local
214 rc = serialargs_get_u32(&args, &hash); in pkcs2tee_proc_params_rsa_oaep()
215 if (rc) in pkcs2tee_proc_params_rsa_oaep()
216 return rc; in pkcs2tee_proc_params_rsa_oaep()
218 rc = serialargs_get_u32(&args, &mgf); in pkcs2tee_proc_params_rsa_oaep()
219 if (rc) in pkcs2tee_proc_params_rsa_oaep()
220 return rc; in pkcs2tee_proc_params_rsa_oaep()
222 rc = serialargs_get_u32(&args, &source_type); in pkcs2tee_proc_params_rsa_oaep()
223 if (rc) in pkcs2tee_proc_params_rsa_oaep()
224 return rc; in pkcs2tee_proc_params_rsa_oaep()
226 rc = serialargs_get_u32(&args, &source_size); in pkcs2tee_proc_params_rsa_oaep()
227 if (rc) in pkcs2tee_proc_params_rsa_oaep()
228 return rc; in pkcs2tee_proc_params_rsa_oaep()
230 rc = serialargs_get_ptr(&args, &source_data, source_size); in pkcs2tee_proc_params_rsa_oaep()
231 if (rc) in pkcs2tee_proc_params_rsa_oaep()
232 return rc; in pkcs2tee_proc_params_rsa_oaep()
265 enum pkcs11_rc rc = PKCS11_CKR_GENERAL_ERROR; in pkcs2tee_algo_rsa_oaep() local
274 rc = serialargs_get_u32(&args, &hash); in pkcs2tee_algo_rsa_oaep()
275 if (rc) in pkcs2tee_algo_rsa_oaep()
276 return rc; in pkcs2tee_algo_rsa_oaep()
278 rc = serialargs_get_u32(&args, &mgf); in pkcs2tee_algo_rsa_oaep()
279 if (rc) in pkcs2tee_algo_rsa_oaep()
280 return rc; in pkcs2tee_algo_rsa_oaep()
282 rc = serialargs_get_u32(&args, &source_type); in pkcs2tee_algo_rsa_oaep()
283 if (rc) in pkcs2tee_algo_rsa_oaep()
284 return rc; in pkcs2tee_algo_rsa_oaep()
286 rc = serialargs_get_u32(&args, &source_size); in pkcs2tee_algo_rsa_oaep()
287 if (rc) in pkcs2tee_algo_rsa_oaep()
288 return rc; in pkcs2tee_algo_rsa_oaep()
290 rc = serialargs_get_ptr(&args, &source_data, source_size); in pkcs2tee_algo_rsa_oaep()
291 if (rc) in pkcs2tee_algo_rsa_oaep()
292 return rc; in pkcs2tee_algo_rsa_oaep()
356 enum pkcs11_rc rc = PKCS11_CKR_GENERAL_ERROR; in load_tee_rsa_key_attrs() local
378 rc = PKCS11_CKR_OK; in load_tee_rsa_key_attrs()
406 rc = get_attribute_ptr(obj->attributes, PKCS11_CKA_PRIME_1, in load_tee_rsa_key_attrs()
408 if (rc != PKCS11_CKR_OK && rc != PKCS11_RV_NOT_FOUND) in load_tee_rsa_key_attrs()
410 if (rc == PKCS11_RV_NOT_FOUND || !a_ptr) { in load_tee_rsa_key_attrs()
411 rc = PKCS11_CKR_OK; in load_tee_rsa_key_attrs()
436 rc = PKCS11_CKR_OK; in load_tee_rsa_key_attrs()
445 if (rc == PKCS11_CKR_OK) { in load_tee_rsa_key_attrs()
452 return rc; in load_tee_rsa_key_attrs()
459 enum pkcs11_rc rc = PKCS11_CKR_GENERAL_ERROR; in tee2pkcs_rsa_attributes() local
462 rc = tee2pkcs_add_attribute(pub_head, PKCS11_CKA_MODULUS, tee_obj, in tee2pkcs_rsa_attributes()
464 if (rc) in tee2pkcs_rsa_attributes()
467 rc = get_attribute_ptr(*pub_head, PKCS11_CKA_PUBLIC_EXPONENT, &a_ptr, in tee2pkcs_rsa_attributes()
469 if (rc != PKCS11_CKR_OK && rc != PKCS11_RV_NOT_FOUND) in tee2pkcs_rsa_attributes()
472 if (rc == PKCS11_CKR_OK && !a_ptr) { in tee2pkcs_rsa_attributes()
473 rc = remove_empty_attribute(pub_head, in tee2pkcs_rsa_attributes()
475 if (rc) in tee2pkcs_rsa_attributes()
477 rc = PKCS11_RV_NOT_FOUND; in tee2pkcs_rsa_attributes()
480 if (rc == PKCS11_RV_NOT_FOUND) { in tee2pkcs_rsa_attributes()
481 rc = tee2pkcs_add_attribute(pub_head, in tee2pkcs_rsa_attributes()
485 if (rc) in tee2pkcs_rsa_attributes()
489 rc = tee2pkcs_add_attribute(priv_head, PKCS11_CKA_MODULUS, tee_obj, in tee2pkcs_rsa_attributes()
491 if (rc) in tee2pkcs_rsa_attributes()
494 rc = tee2pkcs_add_attribute(priv_head, PKCS11_CKA_PUBLIC_EXPONENT, in tee2pkcs_rsa_attributes()
496 if (rc) in tee2pkcs_rsa_attributes()
499 rc = tee2pkcs_add_attribute(priv_head, PKCS11_CKA_PRIVATE_EXPONENT, in tee2pkcs_rsa_attributes()
501 if (rc) in tee2pkcs_rsa_attributes()
504 rc = tee2pkcs_add_attribute(priv_head, PKCS11_CKA_PRIME_1, tee_obj, in tee2pkcs_rsa_attributes()
506 if (rc) in tee2pkcs_rsa_attributes()
509 rc = tee2pkcs_add_attribute(priv_head, PKCS11_CKA_PRIME_2, tee_obj, in tee2pkcs_rsa_attributes()
511 if (rc) in tee2pkcs_rsa_attributes()
514 rc = tee2pkcs_add_attribute(priv_head, PKCS11_CKA_EXPONENT_1, tee_obj, in tee2pkcs_rsa_attributes()
516 if (rc) in tee2pkcs_rsa_attributes()
519 rc = tee2pkcs_add_attribute(priv_head, PKCS11_CKA_EXPONENT_2, tee_obj, in tee2pkcs_rsa_attributes()
521 if (rc) in tee2pkcs_rsa_attributes()
524 rc = tee2pkcs_add_attribute(priv_head, PKCS11_CKA_COEFFICIENT, tee_obj, in tee2pkcs_rsa_attributes()
527 return rc; in tee2pkcs_rsa_attributes()
534 enum pkcs11_rc rc = PKCS11_CKR_GENERAL_ERROR; in generate_rsa_keys() local
546 rc = get_attribute_ptr(*pub_head, PKCS11_CKA_MODULUS_BITS, &a_ptr, in generate_rsa_keys()
548 if (rc != PKCS11_CKR_OK || a_size != sizeof(uint32_t)) in generate_rsa_keys()
553 rc = get_attribute_ptr(*pub_head, PKCS11_CKA_PUBLIC_EXPONENT, &a_ptr, in generate_rsa_keys()
555 if (rc != PKCS11_CKR_OK && rc != PKCS11_RV_NOT_FOUND) in generate_rsa_keys()
556 return rc; in generate_rsa_keys()
558 if (rc == PKCS11_CKR_OK && a_ptr) { in generate_rsa_keys()
574 rc = PKCS11_CKR_TEMPLATE_INCONSISTENT; in generate_rsa_keys()
584 rc = tee2pkcs_error(res); in generate_rsa_keys()
592 rc = tee2pkcs_error(res); in generate_rsa_keys()
600 rc = tee2pkcs_error(res); in generate_rsa_keys()
604 rc = tee2pkcs_rsa_attributes(pub_head, priv_head, tee_obj); in generate_rsa_keys()
610 return rc; in generate_rsa_keys()