Lines Matching refs:rc

201 	enum pkcs11_rc rc = PKCS11_CKR_OK;  in pkcs11_import_object_boolprop()  local
206 rc = get_attribute(templ, attribute, &bbool, &size); in pkcs11_import_object_boolprop()
207 if (rc) { in pkcs11_import_object_boolprop()
208 if (rc != PKCS11_RV_NOT_FOUND) in pkcs11_import_object_boolprop()
209 return rc; in pkcs11_import_object_boolprop()
226 enum pkcs11_rc rc = PKCS11_CKR_OK; in set_mandatory_boolprops() local
230 rc = pkcs11_import_object_boolprop(out, temp, bp[n]); in set_mandatory_boolprops()
231 if (rc) in set_mandatory_boolprops()
232 return rc; in set_mandatory_boolprops()
235 return rc; in set_mandatory_boolprops()
243 enum pkcs11_rc rc = PKCS11_CKR_OK; in set_mandatory_attributes() local
253 rc = add_attribute(out, attrs[n], value, size); in set_mandatory_attributes()
254 if (rc) in set_mandatory_attributes()
255 return rc; in set_mandatory_attributes()
258 return rc; in set_mandatory_attributes()
279 enum pkcs11_rc rc = PKCS11_CKR_OK; in set_optional_attributes_with_def() local
286 rc = get_attribute_ptr(temp, attrs[n], &value, &size); in set_optional_attributes_with_def()
287 if (rc == PKCS11_RV_NOT_FOUND) { in set_optional_attributes_with_def()
289 rc = get_default_value(attrs[n], &value, &size); in set_optional_attributes_with_def()
291 rc = PKCS11_CKR_OK; in set_optional_attributes_with_def()
295 if (rc) in set_optional_attributes_with_def()
296 return rc; in set_optional_attributes_with_def()
298 rc = add_attribute(out, attrs[n], value, size); in set_optional_attributes_with_def()
299 if (rc) in set_optional_attributes_with_def()
300 return rc; in set_optional_attributes_with_def()
303 return rc; in set_optional_attributes_with_def()
495 enum pkcs11_rc rc = PKCS11_CKR_OK; in create_storage_attributes() local
497 rc = init_attributes_head(out); in create_storage_attributes()
498 if (rc) in create_storage_attributes()
499 return rc; in create_storage_attributes()
508 rc = add_attribute(out, PKCS11_CKA_CLASS, &class, sizeof(uint32_t)); in create_storage_attributes()
509 if (rc) in create_storage_attributes()
510 return rc; in create_storage_attributes()
512 rc = set_mandatory_boolprops(out, temp, any_object_boolprops, in create_storage_attributes()
514 if (rc) in create_storage_attributes()
515 return rc; in create_storage_attributes()
525 enum pkcs11_rc rc = PKCS11_CKR_OK; in create_genkey_attributes() local
527 rc = create_storage_attributes(out, temp); in create_genkey_attributes()
528 if (rc) in create_genkey_attributes()
529 return rc; in create_genkey_attributes()
537 rc = add_attribute(out, PKCS11_CKA_KEY_TYPE, &type, sizeof(uint32_t)); in create_genkey_attributes()
538 if (rc) in create_genkey_attributes()
539 return rc; in create_genkey_attributes()
541 rc = set_mandatory_boolprops(out, temp, any_key_boolprops, in create_genkey_attributes()
543 if (rc) in create_genkey_attributes()
544 return rc; in create_genkey_attributes()
546 rc = set_attributes_opt_or_null(out, temp, any_key_opt_or_null, in create_genkey_attributes()
548 if (rc) in create_genkey_attributes()
549 return rc; in create_genkey_attributes()
559 enum pkcs11_rc rc = PKCS11_CKR_OK; in create_symm_key_attributes() local
563 rc = create_genkey_attributes(out, temp); in create_symm_key_attributes()
564 if (rc) in create_symm_key_attributes()
565 return rc; in create_symm_key_attributes()
586 rc = set_mandatory_boolprops(out, temp, symm_key_boolprops, in create_symm_key_attributes()
588 if (rc) in create_symm_key_attributes()
589 return rc; in create_symm_key_attributes()
591 rc = set_attributes_opt_or_null(out, temp, symm_key_opt_or_null, in create_symm_key_attributes()
593 if (rc) in create_symm_key_attributes()
594 return rc; in create_symm_key_attributes()
603 enum pkcs11_rc rc = PKCS11_CKR_OK; in create_data_attributes() local
607 rc = create_storage_attributes(out, temp); in create_data_attributes()
608 if (rc) in create_data_attributes()
609 return rc; in create_data_attributes()
630 enum pkcs11_rc rc = PKCS11_CKR_OK; in create_certificate_attributes() local
634 rc = create_storage_attributes(out, temp); in create_certificate_attributes()
635 if (rc) in create_certificate_attributes()
636 return rc; in create_certificate_attributes()
640 rc = set_mandatory_boolprops(out, temp, pkcs11_certificate_boolprops, in create_certificate_attributes()
642 if (rc) in create_certificate_attributes()
643 return rc; in create_certificate_attributes()
645 rc = set_mandatory_attributes(out, temp, pkcs11_certificate_mandated, in create_certificate_attributes()
647 if (rc) in create_certificate_attributes()
648 return rc; in create_certificate_attributes()
650 rc = set_optional_attributes(out, temp, pkcs11_certificate_optional, in create_certificate_attributes()
652 if (rc) in create_certificate_attributes()
653 return rc; in create_certificate_attributes()
670 rc = set_mandatory_attributes(out, temp, mandated, mandated_count); in create_certificate_attributes()
671 if (rc) in create_certificate_attributes()
672 return rc; in create_certificate_attributes()
674 rc = set_optional_attributes(out, temp, optional, optional_count); in create_certificate_attributes()
675 if (rc) in create_certificate_attributes()
676 return rc; in create_certificate_attributes()
679 rc = get_attribute_ptr(*out, PKCS11_CKA_CERTIFICATE_CATEGORY, in create_certificate_attributes()
681 if (rc == PKCS11_CKR_OK && attr_size == sizeof(cert_category)) { in create_certificate_attributes()
697 } else if (rc == PKCS11_RV_NOT_FOUND) { in create_certificate_attributes()
699 rc = set_attribute(out, PKCS11_CKA_CERTIFICATE_CATEGORY, in create_certificate_attributes()
702 if (rc) in create_certificate_attributes()
703 return rc; in create_certificate_attributes()
712 rc = get_attribute_ptr(*out, PKCS11_CKA_NAME_HASH_ALGORITHM, NULL, in create_certificate_attributes()
714 if (rc == PKCS11_CKR_OK && attr_size == sizeof(uint32_t)) { in create_certificate_attributes()
716 } else if (rc == PKCS11_RV_NOT_FOUND) { in create_certificate_attributes()
718 rc = set_attribute(out, PKCS11_CKA_NAME_HASH_ALGORITHM, in create_certificate_attributes()
721 if (rc) in create_certificate_attributes()
722 return rc; in create_certificate_attributes()
730 return rc; in create_certificate_attributes()
741 enum pkcs11_rc rc = PKCS11_CKR_OK; in create_pub_key_attributes() local
745 rc = create_genkey_attributes(out, temp); in create_pub_key_attributes()
746 if (rc) in create_pub_key_attributes()
747 return rc; in create_pub_key_attributes()
751 rc = set_mandatory_boolprops(out, temp, public_key_boolprops, in create_pub_key_attributes()
753 if (rc) in create_pub_key_attributes()
754 return rc; in create_pub_key_attributes()
756 rc = set_mandatory_attributes(out, temp, public_key_mandated, in create_pub_key_attributes()
758 if (rc) in create_pub_key_attributes()
759 return rc; in create_pub_key_attributes()
761 rc = set_attributes_opt_or_null(out, temp, in create_pub_key_attributes()
764 if (rc) in create_pub_key_attributes()
765 return rc; in create_pub_key_attributes()
801 rc = set_mandatory_attributes(out, temp, mandated, mandated_count); in create_pub_key_attributes()
802 if (rc) in create_pub_key_attributes()
803 return rc; in create_pub_key_attributes()
839 enum pkcs11_rc rc = PKCS11_CKR_OK; in create_pub_key_generated_attributes() local
843 rc = create_pub_key_rsa_generated_attributes(out, temp, in create_pub_key_generated_attributes()
851 return rc; in create_pub_key_generated_attributes()
861 enum pkcs11_rc rc = PKCS11_CKR_OK; in create_priv_key_attributes() local
865 rc = create_genkey_attributes(out, temp); in create_priv_key_attributes()
866 if (rc) in create_priv_key_attributes()
867 return rc; in create_priv_key_attributes()
871 rc = set_mandatory_boolprops(out, temp, private_key_boolprops, in create_priv_key_attributes()
873 if (rc) in create_priv_key_attributes()
874 return rc; in create_priv_key_attributes()
876 rc = set_mandatory_attributes(out, temp, private_key_mandated, in create_priv_key_attributes()
878 if (rc) in create_priv_key_attributes()
879 return rc; in create_priv_key_attributes()
881 rc = set_attributes_opt_or_null(out, temp, private_key_opt_or_null, in create_priv_key_attributes()
883 if (rc) in create_priv_key_attributes()
884 return rc; in create_priv_key_attributes()
910 rc = set_mandatory_attributes(out, temp, mandated, mandated_count); in create_priv_key_attributes()
911 if (rc) in create_priv_key_attributes()
912 return rc; in create_priv_key_attributes()
938 enum pkcs11_rc rc = PKCS11_CKR_GENERAL_ERROR; in create_ec_priv_key_hidden_attributes() local
1005 rc = PKCS11_CKR_ATTRIBUTE_TYPE_INVALID; in create_ec_priv_key_hidden_attributes()
1046 rc = PKCS11_CKR_DEVICE_MEMORY; in create_ec_priv_key_hidden_attributes()
1055 rc = PKCS11_CKR_DEVICE_MEMORY; in create_ec_priv_key_hidden_attributes()
1076 rc = add_attribute(out, PKCS11_CKA_OPTEE_HIDDEN_EC_POINT, ptr, in create_ec_priv_key_hidden_attributes()
1087 return rc; in create_ec_priv_key_hidden_attributes()
1095 enum pkcs11_rc rc = PKCS11_CKR_OK; in create_priv_key_hidden_attributes() local
1099 rc = create_ec_priv_key_hidden_attributes(out, temp, function); in create_priv_key_hidden_attributes()
1106 return rc; in create_priv_key_hidden_attributes()
1113 enum pkcs11_rc rc = PKCS11_CKR_OK; in sanitize_symm_key_attributes() local
1118 rc = get_attribute_ptr(*temp, PKCS11_CKA_VALUE, NULL, &a_size); in sanitize_symm_key_attributes()
1132 if (rc || a_size == 0) in sanitize_symm_key_attributes()
1142 if (rc != PKCS11_RV_NOT_FOUND) in sanitize_symm_key_attributes()
1187 enum pkcs11_rc rc = PKCS11_CKR_OK; in create_attributes_from_template() local
1265 rc = sanitize_client_object(&temp, template, template_size, class, in create_attributes_from_template()
1267 if (rc) in create_attributes_from_template()
1279 return rc; in create_attributes_from_template()
1287 rc = get_attribute_ptr(parent, indirect_template, in create_attributes_from_template()
1289 if (rc == PKCS11_CKR_OK && size != 0) { in create_attributes_from_template()
1290 rc = attributes_match_add_reference(&temp, req_attrs); in create_attributes_from_template()
1291 if (rc) in create_attributes_from_template()
1306 rc = PKCS11_CKR_TEMPLATE_INCONSISTENT; in create_attributes_from_template()
1313 rc = PKCS11_CKR_TEMPLATE_INCONSISTENT; in create_attributes_from_template()
1321 rc = PKCS11_CKR_TEMPLATE_INCONSISTENT; in create_attributes_from_template()
1329 rc = PKCS11_CKR_TEMPLATE_INCONSISTENT; in create_attributes_from_template()
1337 rc = PKCS11_CKR_TEMPLATE_INCONSISTENT; in create_attributes_from_template()
1347 rc = PKCS11_CKR_TEMPLATE_INCONSISTENT; in create_attributes_from_template()
1361 rc = create_data_attributes(&attrs, temp); in create_attributes_from_template()
1364 rc = create_certificate_attributes(&attrs, temp); in create_attributes_from_template()
1367 rc = sanitize_symm_key_attributes(&temp, function); in create_attributes_from_template()
1368 if (rc) in create_attributes_from_template()
1370 rc = create_symm_key_attributes(&attrs, temp); in create_attributes_from_template()
1373 rc = create_pub_key_attributes(&attrs, temp, function); in create_attributes_from_template()
1374 if (rc) in create_attributes_from_template()
1376 rc = create_pub_key_generated_attributes(&attrs, temp, in create_attributes_from_template()
1380 rc = create_priv_key_attributes(&attrs, temp); in create_attributes_from_template()
1381 if (rc) in create_attributes_from_template()
1383 rc = create_priv_key_hidden_attributes(&attrs, temp, function); in create_attributes_from_template()
1389 rc = PKCS11_CKR_TEMPLATE_INCONSISTENT; in create_attributes_from_template()
1392 if (rc) in create_attributes_from_template()
1397 rc = PKCS11_CKR_TEMPLATE_INCONSISTENT; in create_attributes_from_template()
1403 rc = PKCS11_CKR_TEMPLATE_INCONSISTENT; in create_attributes_from_template()
1419 rc = add_attribute(&attrs, PKCS11_CKA_LOCAL, &local, sizeof(local)); in create_attributes_from_template()
1420 if (rc) in create_attributes_from_template()
1452 rc = set_attribute(&attrs, in create_attributes_from_template()
1456 if (rc) in create_attributes_from_template()
1471 rc = add_attribute(&attrs, PKCS11_CKA_ALWAYS_SENSITIVE, in create_attributes_from_template()
1473 if (rc) in create_attributes_from_template()
1476 rc = add_attribute(&attrs, PKCS11_CKA_NEVER_EXTRACTABLE, in create_attributes_from_template()
1478 if (rc) in create_attributes_from_template()
1487 rc = add_attribute(&attrs, PKCS11_CKA_KEY_GEN_MECHANISM, in create_attributes_from_template()
1489 if (rc) in create_attributes_from_template()
1505 if (rc) in create_attributes_from_template()
1508 return rc; in create_attributes_from_template()
1590 enum pkcs11_rc rc = PKCS11_CKR_OK; in check_created_attrs_against_token() local
1592 rc = check_attrs_misc_integrity(head); in check_created_attrs_against_token()
1593 if (rc) in check_created_attrs_against_token()
1594 return rc; in check_created_attrs_against_token()
1754 enum pkcs11_rc rc = PKCS11_CKR_OK; in check_created_attrs() local
1814 rc = get_u32_attribute(secret, PKCS11_CKA_VALUE_LEN, in check_created_attrs()
1816 if (rc) in check_created_attrs()
1823 rc = get_u32_attribute(public, PKCS11_CKA_MODULUS_BITS, in check_created_attrs()
1825 if (rc) in check_created_attrs()
1883 enum pkcs11_rc rc = PKCS11_CKR_GENERAL_ERROR; in parent_key_complies_allowed_processings() local
1885 rc = get_attribute_ptr(head, PKCS11_CKA_ALLOWED_MECHANISMS, in parent_key_complies_allowed_processings()
1887 if (rc == PKCS11_RV_NOT_FOUND) in parent_key_complies_allowed_processings()
1889 if (rc) { in parent_key_complies_allowed_processings()
2126 enum pkcs11_rc rc = PKCS11_CKR_GENERAL_ERROR; in attribute_is_exportable() local
2145 rc = get_attribute(obj->attributes, PKCS11_CKA_EXTRACTABLE, in attribute_is_exportable()
2147 if (rc || boolval == PKCS11_FALSE) in attribute_is_exportable()
2151 rc = get_attribute(obj->attributes, PKCS11_CKA_SENSITIVE, in attribute_is_exportable()
2153 if (rc || boolval == PKCS11_TRUE) in attribute_is_exportable()
2268 enum pkcs11_rc rc = PKCS11_CKR_GENERAL_ERROR; in attr_is_modifiable_certificate() local
2271 rc = get_attribute(obj->attributes, PKCS11_CKA_TRUSTED, in attr_is_modifiable_certificate()
2273 if (rc || boolval == PKCS11_TRUE) in attr_is_modifiable_certificate()
2465 enum pkcs11_rc rc = PKCS11_CKR_GENERAL_ERROR; in set_secret_key_data() local
2468 rc = get_attribute(*head, PKCS11_CKA_VALUE_LEN, &key_length, &size); in set_secret_key_data()
2469 if (rc && rc != PKCS11_RV_NOT_FOUND) in set_secret_key_data()
2470 return rc; in set_secret_key_data()
2477 rc = set_attribute(head, PKCS11_CKA_VALUE_LEN, &key_length, in set_secret_key_data()
2479 if (rc) in set_secret_key_data()
2480 return rc; in set_secret_key_data()
2484 rc = check_created_attrs(*head, NULL); in set_secret_key_data()
2485 if (rc) in set_secret_key_data()
2486 return rc; in set_secret_key_data()
2489 rc = remove_empty_attribute(head, PKCS11_CKA_VALUE); in set_secret_key_data()
2490 if (rc != PKCS11_CKR_OK && rc != PKCS11_RV_NOT_FOUND) in set_secret_key_data()
2493 rc = add_attribute(head, PKCS11_CKA_VALUE, data, key_length); in set_secret_key_data()
2494 if (rc) in set_secret_key_data()
2495 return rc; in set_secret_key_data()
2504 enum pkcs11_rc rc = PKCS11_CKR_GENERAL_ERROR; in set_private_key_data_rsa() local
2518 rc = get_u32_attribute(*head, PKCS11_CKA_MODULUS_BITS, &key_bits); in set_private_key_data_rsa()
2519 if (rc && rc != PKCS11_RV_NOT_FOUND) in set_private_key_data_rsa()
2520 return rc; in set_private_key_data_rsa()
2539 rc = PKCS11_CKR_ARGUMENTS_BAD; in set_private_key_data_rsa()
2545 rc = PKCS11_CKR_GENERAL_ERROR; in set_private_key_data_rsa()
2551 rc = PKCS11_CKR_ARGUMENTS_BAD; in set_private_key_data_rsa()
2556 rc = PKCS11_CKR_WRAPPED_KEY_LEN_RANGE; in set_private_key_data_rsa()
2564 rc = PKCS11_CKR_DEVICE_MEMORY; in set_private_key_data_rsa()
2570 rc = PKCS11_CKR_WRAPPED_KEY_INVALID; in set_private_key_data_rsa()
2574 rc = add_attribute(head, PKCS11_CKA_MODULUS, buffer, size); in set_private_key_data_rsa()
2575 if (rc) in set_private_key_data_rsa()
2580 rc = PKCS11_CKR_WRAPPED_KEY_LEN_RANGE; in set_private_key_data_rsa()
2586 rc = PKCS11_CKR_WRAPPED_KEY_INVALID; in set_private_key_data_rsa()
2590 rc = add_attribute(head, PKCS11_CKA_PUBLIC_EXPONENT, buffer, size); in set_private_key_data_rsa()
2591 if (rc) in set_private_key_data_rsa()
2596 rc = PKCS11_CKR_WRAPPED_KEY_LEN_RANGE; in set_private_key_data_rsa()
2602 rc = PKCS11_CKR_WRAPPED_KEY_INVALID; in set_private_key_data_rsa()
2606 rc = add_attribute(head, PKCS11_CKA_PRIVATE_EXPONENT, buffer, size); in set_private_key_data_rsa()
2607 if (rc) in set_private_key_data_rsa()
2612 rc = PKCS11_CKR_WRAPPED_KEY_LEN_RANGE; in set_private_key_data_rsa()
2618 rc = PKCS11_CKR_WRAPPED_KEY_INVALID; in set_private_key_data_rsa()
2622 rc = add_attribute(head, PKCS11_CKA_PRIME_1, buffer, size); in set_private_key_data_rsa()
2623 if (rc) in set_private_key_data_rsa()
2628 rc = PKCS11_CKR_WRAPPED_KEY_LEN_RANGE; in set_private_key_data_rsa()
2634 rc = PKCS11_CKR_WRAPPED_KEY_INVALID; in set_private_key_data_rsa()
2638 rc = add_attribute(head, PKCS11_CKA_PRIME_2, buffer, size); in set_private_key_data_rsa()
2648 return rc; in set_private_key_data_rsa()
2671 enum pkcs11_rc rc = PKCS11_CKR_GENERAL_ERROR; in alloc_copy_attribute_value() local
2675 rc = get_attribute_ptr(head, PKCS11_CKA_VALUE, &value, sz); in alloc_copy_attribute_value()
2676 if (rc) in alloc_copy_attribute_value()
2692 enum pkcs11_rc rc = PKCS11_CKR_GENERAL_ERROR; in encode_rsa_private_key_der() local
2715 rc = PKCS11_CKR_GENERAL_ERROR; in encode_rsa_private_key_der()
2719 rc = get_attribute_ptr(head, PKCS11_CKA_MODULUS, &n, &n_len); in encode_rsa_private_key_der()
2720 if (rc) in encode_rsa_private_key_der()
2723 rc = get_attribute_ptr(head, PKCS11_CKA_PRIME_1, &p, &p_len); in encode_rsa_private_key_der()
2724 if (rc) in encode_rsa_private_key_der()
2727 rc = get_attribute_ptr(head, PKCS11_CKA_PRIME_2, &q, &q_len); in encode_rsa_private_key_der()
2728 if (rc) in encode_rsa_private_key_der()
2731 rc = get_attribute_ptr(head, PKCS11_CKA_PRIVATE_EXPONENT, &d, &d_len); in encode_rsa_private_key_der()
2732 if (rc) in encode_rsa_private_key_der()
2735 rc = get_attribute_ptr(head, PKCS11_CKA_PUBLIC_EXPONENT, &e, &e_len); in encode_rsa_private_key_der()
2736 if (rc) in encode_rsa_private_key_der()
2741 rc = PKCS11_CKR_GENERAL_ERROR; in encode_rsa_private_key_der()
2748 rc = PKCS11_CKR_ARGUMENTS_BAD; in encode_rsa_private_key_der()
2753 rc = PKCS11_CKR_ARGUMENTS_BAD; in encode_rsa_private_key_der()
2758 rc = PKCS11_CKR_ARGUMENTS_BAD; in encode_rsa_private_key_der()
2765 rc = PKCS11_CKR_DEVICE_MEMORY; in encode_rsa_private_key_der()
2771 rc = PKCS11_CKR_ARGUMENTS_BAD; in encode_rsa_private_key_der()
2786 if (rc) in encode_rsa_private_key_der()
2789 return rc; in encode_rsa_private_key_der()
2795 enum pkcs11_rc rc = PKCS11_CKR_GENERAL_ERROR; in alloc_key_data_to_wrap() local
2799 rc = alloc_copy_attribute_value(head, data, sz); in alloc_key_data_to_wrap()
2803 rc = encode_rsa_private_key_der(head, data, sz); in alloc_key_data_to_wrap()
2809 return rc; in alloc_key_data_to_wrap()
2815 enum pkcs11_rc rc = PKCS11_CKR_GENERAL_ERROR; in add_missing_attribute_id() local
2824 rc = get_attribute_ptr(*pub_head, PKCS11_CKA_ID, &id1, &id1_size); in add_missing_attribute_id()
2825 if (rc) { in add_missing_attribute_id()
2826 if (rc != PKCS11_RV_NOT_FOUND) in add_missing_attribute_id()
2827 return rc; in add_missing_attribute_id()
2833 rc = get_attribute_ptr(*priv_head, PKCS11_CKA_ID, &id2, &id2_size); in add_missing_attribute_id()
2834 if (rc) { in add_missing_attribute_id()
2835 if (rc != PKCS11_RV_NOT_FOUND) in add_missing_attribute_id()
2836 return rc; in add_missing_attribute_id()
2865 enum pkcs11_rc rc = PKCS11_CKR_GENERAL_ERROR; in compute_check_value_with_sha1() local
2874 rc = tee2pkcs_error(res); in compute_check_value_with_sha1()
2875 if (rc != PKCS11_CKR_OK) in compute_check_value_with_sha1()
2880 rc = PKCS11_CKR_DEVICE_MEMORY; in compute_check_value_with_sha1()
2885 rc = tee2pkcs_error(res); in compute_check_value_with_sha1()
2886 if (rc != PKCS11_CKR_OK) in compute_check_value_with_sha1()
2895 return rc; in compute_check_value_with_sha1()
2907 enum pkcs11_rc rc = PKCS11_CKR_GENERAL_ERROR; in compute_check_value_with_ecb() local
2919 rc = tee2pkcs_error(res); in compute_check_value_with_ecb()
2920 if (rc != PKCS11_CKR_OK) in compute_check_value_with_ecb()
2924 rc = tee2pkcs_error(res); in compute_check_value_with_ecb()
2925 if (rc != PKCS11_CKR_OK) in compute_check_value_with_ecb()
2931 rc = tee2pkcs_error(res); in compute_check_value_with_ecb()
2932 if (rc != PKCS11_CKR_OK) in compute_check_value_with_ecb()
2936 rc = tee2pkcs_error(res); in compute_check_value_with_ecb()
2937 if (rc != PKCS11_CKR_OK) in compute_check_value_with_ecb()
2943 rc = tee2pkcs_error(res); in compute_check_value_with_ecb()
2944 if (rc != PKCS11_CKR_OK) in compute_check_value_with_ecb()
2953 return rc; in compute_check_value_with_ecb()
2958 enum pkcs11_rc rc = PKCS11_CKR_GENERAL_ERROR; in set_check_value_attr() local
2980 rc = get_attribute_ptr(*head, PKCS11_CKA_CHECK_VALUE, &kcv2, &kcv2_len); in set_check_value_attr()
2982 if (rc != PKCS11_CKR_OK && rc != PKCS11_RV_NOT_FOUND) in set_check_value_attr()
2990 if (rc == PKCS11_CKR_OK && !kcv2_len) in set_check_value_attr()
2993 if (rc == PKCS11_CKR_OK && kcv2_len != PKCS11_CKA_CHECK_VALUE_SIZE) in set_check_value_attr()
2997 rc = get_attribute_ptr(*head, PKCS11_CKA_VALUE, &val, &val_len); in set_check_value_attr()
2998 if (rc) in set_check_value_attr()
2999 return rc; in set_check_value_attr()
3004 rc = compute_check_value_with_ecb(val, val_len, kcv); in set_check_value_attr()
3013 rc = compute_check_value_with_sha1(val, val_len, kcv); in set_check_value_attr()
3016 rc = PKCS11_CKR_TEMPLATE_INCONSISTENT; in set_check_value_attr()
3020 rc = compute_check_value_with_sha1(val, val_len, kcv); in set_check_value_attr()
3023 if (rc) in set_check_value_attr()
3024 return rc; in set_check_value_attr()
3033 rc = PKCS11_CKR_ATTRIBUTE_VALUE_INVALID; in set_check_value_attr()
3035 rc = add_attribute(head, PKCS11_CKA_CHECK_VALUE, kcv, in set_check_value_attr()
3039 return rc; in set_check_value_attr()