Lines Matching full:if
24 if (session_is_active(session)) in get_ready_session()
95 if (session->processing && in get_active_session()
104 if (!session->processing) in release_active_processing()
115 if (session->processing->tee_op_handle != TEE_HANDLE_NULL) { in release_active_processing()
120 if (session->processing->tee_op_handle2 != TEE_HANDLE_NULL) { in release_active_processing()
146 if (get_attribute_ptr(attrs, PKCS11_CKA_VALUE, NULL, &a_size)) in get_object_key_bit_size()
151 if (get_attribute_ptr(attrs, PKCS11_CKA_MODULUS, NULL, &a_size)) in get_object_key_bit_size()
156 if (get_attribute_ptr(attrs, PKCS11_CKA_EC_PARAMS, in get_object_key_bit_size()
162 if (get_attribute_ptr(attrs, PKCS11_CKA_EC_POINT, NULL, in get_object_key_bit_size()
181 if (!*head) in generate_random_key_value()
185 if (rc || data_size != sizeof(uint32_t)) { in generate_random_key_value()
193 /* Remove the default empty value attribute if found */ in generate_random_key_value()
195 if (rc != PKCS11_CKR_OK && rc != PKCS11_RV_NOT_FOUND) in generate_random_key_value()
199 if (!value) in generate_random_key_value()
206 if (rc == PKCS11_CKR_OK) in generate_random_key_value()
232 if (!client || ptypes != exp_pt || in entry_generate_secret()
239 if (rc) in entry_generate_secret()
243 if (rc) in entry_generate_secret()
247 if (rc) in entry_generate_secret()
250 if (serialargs_remaining_bytes(&ctrlargs)) { in entry_generate_secret()
256 if (rc) in entry_generate_secret()
264 if (rc) { in entry_generate_secret()
277 if (rc) in entry_generate_secret()
284 if (rc) in entry_generate_secret()
288 if (rc) in entry_generate_secret()
292 if (rc) in entry_generate_secret()
305 if (rc) in entry_generate_secret()
321 if (rc) in entry_generate_secret()
355 if (res != TEE_ERROR_SHORT_BUFFER) in alloc_get_tee_attribute_data()
359 if (!ptr) in alloc_get_tee_attribute_data()
363 if (res) { in alloc_get_tee_attribute_data()
383 if (rc) in tee2pkcs_add_attribute()
391 if (rc) in tee2pkcs_add_attribute()
422 if (!client || ptypes != exp_pt || out->memref.size != out_ref_size) in entry_generate_key_pair()
428 if (rc) in entry_generate_key_pair()
432 if (rc) in entry_generate_key_pair()
436 if (rc) in entry_generate_key_pair()
440 if (rc) in entry_generate_key_pair()
443 if (serialargs_remaining_bytes(&ctrlargs)) { in entry_generate_key_pair()
449 if (rc) in entry_generate_key_pair()
455 if (rc) in entry_generate_key_pair()
465 if (rc) in entry_generate_key_pair()
479 if (rc) in entry_generate_key_pair()
485 /* Generate CKA_ID for keys if not specified by the templates */ in entry_generate_key_pair()
487 if (rc) in entry_generate_key_pair()
492 if (rc) in entry_generate_key_pair()
496 if (rc) in entry_generate_key_pair()
501 if (rc) in entry_generate_key_pair()
505 if (rc) in entry_generate_key_pair()
509 if (rc) in entry_generate_key_pair()
513 if (rc) in entry_generate_key_pair()
517 if (rc) in entry_generate_key_pair()
535 if (rc) in entry_generate_key_pair()
545 if (rc) in entry_generate_key_pair()
557 if (rc) in entry_generate_key_pair()
574 if (pubkey_handle) { in entry_generate_key_pair()
576 if (!object) in entry_generate_key_pair()
613 if (!client || ptypes != exp_pt) in entry_processing_init()
619 if (rc) in entry_processing_init()
622 if (function != PKCS11_FUNCTION_DIGEST) { in entry_processing_init()
624 if (rc) in entry_processing_init()
629 if (rc) in entry_processing_init()
632 if (serialargs_remaining_bytes(&ctrlargs)) { in entry_processing_init()
638 if (rc) in entry_processing_init()
641 if (function != PKCS11_FUNCTION_DIGEST) { in entry_processing_init()
643 if (!obj) { in entry_processing_init()
650 if (rc) in entry_processing_init()
656 if (rc) in entry_processing_init()
659 if (obj) { in entry_processing_init()
663 if (rc) in entry_processing_init()
668 if (rc) in entry_processing_init()
672 if (processing_is_tee_symm(proc_params->id)) in entry_processing_init()
674 else if (processing_is_tee_asymm(proc_params->id)) in entry_processing_init()
676 else if (processing_is_tee_digest(proc_params->id)) in entry_processing_init()
681 if (rc == PKCS11_CKR_OK) { in entry_processing_init()
688 if (rc) in entry_processing_init()
718 if (!client || in entry_processing_step()
725 if (rc) in entry_processing_step()
728 if (step == PKCS11_FUNC_STEP_UPDATE_KEY) { in entry_processing_step()
732 if (rc) in entry_processing_step()
736 if (serialargs_remaining_bytes(&ctrlargs)) in entry_processing_step()
740 if (rc) in entry_processing_step()
743 if (step == PKCS11_FUNC_STEP_UPDATE_KEY) { in entry_processing_step()
747 if (!obj) { in entry_processing_step()
754 if (rc) { in entry_processing_step()
763 if (rc) in entry_processing_step()
766 if (processing_is_tee_symm(mecha_type)) in entry_processing_step()
769 else if (processing_is_tee_asymm(mecha_type)) in entry_processing_step()
772 else if (processing_is_tee_digest(mecha_type)) in entry_processing_step()
777 if (rc == PKCS11_CKR_OK && (step == PKCS11_FUNC_STEP_UPDATE || in entry_processing_step()
785 if (rc == PKCS11_CKR_BUFFER_TOO_SMALL && in entry_processing_step()
789 if (rc == PKCS11_CKR_BUFFER_TOO_SMALL && step == PKCS11_FUNC_STEP_FINAL) in entry_processing_step()
796 if (rc != PKCS11_CKR_OK && rc != PKCS11_CKR_BUFFER_TOO_SMALL) in entry_processing_step()
801 if (rc != PKCS11_CKR_BUFFER_TOO_SMALL) in entry_processing_step()
831 if (!client || in entry_processing_key()
840 if (TEE_PARAM_TYPE_GET(ptypes, 1) != in entry_processing_key()
846 if (in_size && !in_buf) in entry_processing_key()
858 if (TEE_PARAM_TYPE_GET(ptypes, 1) != TEE_PARAM_TYPE_NONE) in entry_processing_key()
876 if (rc) in entry_processing_key()
880 if (rc) in entry_processing_key()
884 if (rc) in entry_processing_key()
888 if (rc) in entry_processing_key()
891 if (serialargs_remaining_bytes(&ctrlargs)) { in entry_processing_key()
896 /* Return error if processing already active */ in entry_processing_key()
898 if (rc) in entry_processing_key()
903 if (!parent) { in entry_processing_key()
908 /* Check if mechanism can be used for derivation function */ in entry_processing_key()
912 if (rc) in entry_processing_key()
917 if (rc) in entry_processing_key()
921 * Check if base/parent key has CKA_DERIVE set and its key type is in entry_processing_key()
926 if (rc) { in entry_processing_key()
932 if (rc == PKCS11_CKR_KEY_FUNCTION_NOT_PERMITTED) { in entry_processing_key()
933 if (function == PKCS11_FUNCTION_UNWRAP) in entry_processing_key()
944 if (rc) in entry_processing_key()
957 if (rc) in entry_processing_key()
966 if (rc) in entry_processing_key()
970 if (rc) in entry_processing_key()
974 if (rc) in entry_processing_key()
977 if (processing_is_tee_symm(proc_params->id)) { in entry_processing_key()
980 if (rc) in entry_processing_key()
995 if (rc) in entry_processing_key()
998 } else if (processing_is_tee_asymm(proc_params->id)) { in entry_processing_key()
1003 if (rc) in entry_processing_key()
1007 if (!rc) in entry_processing_key()
1013 if (rc) in entry_processing_key()
1023 if (rc) in entry_processing_key()
1031 if (rc) in entry_processing_key()
1045 if (rc) in entry_processing_key()
1088 if (!client || ptypes != exp_pt) in entry_release_active_processing()
1094 if (rc) in entry_release_active_processing()
1099 if (serialargs_remaining_bytes(&ctrlargs)) in entry_release_active_processing()
1103 if (function == PKCS11_FUNCTION_UNKNOWN) in entry_release_active_processing()
1107 if (rc) in entry_release_active_processing()
1141 if (!client || ptypes != exp_pt || in entry_wrap_key()
1148 if (rc) in entry_wrap_key()
1152 if (rc) in entry_wrap_key()
1156 if (rc) in entry_wrap_key()
1160 if (rc) in entry_wrap_key()
1163 if (serialargs_remaining_bytes(&ctrlargs)) { in entry_wrap_key()
1169 if (rc) in entry_wrap_key()
1173 if (!wrapping_key) { in entry_wrap_key()
1179 if (!key) { in entry_wrap_key()
1190 if (key == wrapping_key) { in entry_wrap_key()
1196 if (rc) in entry_wrap_key()
1199 /* Check if mechanism can be used for wrapping function */ in entry_wrap_key()
1203 if (rc) in entry_wrap_key()
1207 * Check if wrapping key has CKA_WRAP set and its key type is in entry_wrap_key()
1212 if (rc) { in entry_wrap_key()
1218 if (rc == PKCS11_CKR_KEY_FUNCTION_NOT_PERMITTED) in entry_wrap_key()
1227 if (rc) in entry_wrap_key()
1239 /* Check if key to be wrapped is extractable */ in entry_wrap_key()
1240 if (!get_bool(key->attributes, PKCS11_CKA_EXTRACTABLE)) { in entry_wrap_key()
1246 if (get_bool(key->attributes, PKCS11_CKA_WRAP_WITH_TRUSTED) && in entry_wrap_key()
1254 if (rc) in entry_wrap_key()
1259 if (rc == PKCS11_CKR_OK && size != 0) { in entry_wrap_key()
1260 if (!attributes_match_reference(key->attributes, req_attrs)) { in entry_wrap_key()
1267 if (rc) in entry_wrap_key()
1270 if (processing_is_tee_symm(proc_params->id)) { in entry_wrap_key()
1273 if (rc) in entry_wrap_key()
1281 if (rc) in entry_wrap_key()
1288 if (rc == PKCS11_CKR_OK || rc == PKCS11_CKR_BUFFER_TOO_SMALL) in entry_wrap_key()