• Home
  • Raw
  • Download

Lines Matching refs:slot

103     psa_key_slot_t *slot = NULL;  in psa_get_and_lock_key_slot_in_memory()  local
106 slot = &global_data.key_slots[key_id - PSA_KEY_ID_VOLATILE_MIN]; in psa_get_and_lock_key_slot_in_memory()
116 status = mbedtls_svc_key_id_equal(key, slot->attr.id) ? in psa_get_and_lock_key_slot_in_memory()
124 slot = &global_data.key_slots[slot_idx]; in psa_get_and_lock_key_slot_in_memory()
125 if (mbedtls_svc_key_id_equal(key, slot->attr.id)) { in psa_get_and_lock_key_slot_in_memory()
134 status = psa_lock_key_slot(slot); in psa_get_and_lock_key_slot_in_memory()
136 *p_slot = slot; in psa_get_and_lock_key_slot_in_memory()
157 psa_key_slot_t *slot = &global_data.key_slots[slot_idx]; in psa_wipe_all_key_slots() local
158 slot->lock_count = 1; in psa_wipe_all_key_slots()
159 (void) psa_wipe_key_slot(slot); in psa_wipe_all_key_slots()
178 psa_key_slot_t *slot = &global_data.key_slots[slot_idx]; in psa_get_empty_key_slot() local
179 if (!psa_is_key_slot_occupied(slot)) { in psa_get_empty_key_slot()
180 selected_slot = slot; in psa_get_empty_key_slot()
185 (!PSA_KEY_LIFETIME_IS_VOLATILE(slot->attr.lifetime)) && in psa_get_empty_key_slot()
186 (!psa_is_key_slot_locked(slot))) { in psa_get_empty_key_slot()
187 unlocked_persistent_key_slot = slot; in psa_get_empty_key_slot()
227 static psa_status_t psa_load_persistent_key_into_slot(psa_key_slot_t *slot) in psa_load_persistent_key_into_slot() argument
233 status = psa_load_persistent_key(&slot->attr, in psa_load_persistent_key_into_slot()
244 if (psa_get_se_driver(slot->attr.lifetime, &drv, &drv_context)) { in psa_load_persistent_key_into_slot()
253 slot, data->slot_number, sizeof(data->slot_number)); in psa_load_persistent_key_into_slot()
258 status = psa_copy_key_material_into_slot(slot, key_data, key_data_length); in psa_load_persistent_key_into_slot()
268 static psa_status_t psa_load_builtin_key_into_slot(psa_key_slot_t *slot) in psa_load_builtin_key_into_slot() argument
278 MBEDTLS_SVC_KEY_ID_GET_KEY_ID(slot->attr.id))) { in psa_load_builtin_key_into_slot()
284 slot->attr.id, &lifetime, &slot_number); in psa_load_builtin_key_into_slot()
291 psa_set_key_id(&attributes, slot->attr.id); in psa_load_builtin_key_into_slot()
317 status = psa_allocate_buffer_to_slot(slot, key_buffer_size); in psa_load_builtin_key_into_slot()
324 slot->key.data, slot->key.bytes, &key_buffer_length); in psa_load_builtin_key_into_slot()
330 slot->key.bytes = key_buffer_length; in psa_load_builtin_key_into_slot()
331 slot->attr = attributes.core; in psa_load_builtin_key_into_slot()
335 psa_remove_key_data_from_memory(slot); in psa_load_builtin_key_into_slot()
401 psa_status_t psa_unlock_key_slot(psa_key_slot_t *slot) in psa_unlock_key_slot() argument
403 if (slot == NULL) { in psa_unlock_key_slot()
407 if (slot->lock_count > 0) { in psa_unlock_key_slot()
408 slot->lock_count--; in psa_unlock_key_slot()
420 MBEDTLS_TEST_HOOK_TEST_ASSERT(slot->lock_count > 0); in psa_unlock_key_slot()
479 psa_key_slot_t *slot; in psa_open_key() local
481 status = psa_get_and_lock_key_slot(key, &slot); in psa_open_key()
493 return psa_unlock_key_slot(slot); in psa_open_key()
505 psa_key_slot_t *slot; in psa_close_key() local
511 status = psa_get_and_lock_key_slot_in_memory(handle, &slot); in psa_close_key()
519 if (slot->lock_count <= 1) { in psa_close_key()
520 return psa_wipe_key_slot(slot); in psa_close_key()
522 return psa_unlock_key_slot(slot); in psa_close_key()
529 psa_key_slot_t *slot; in psa_purge_key() local
531 status = psa_get_and_lock_key_slot_in_memory(key, &slot); in psa_purge_key()
536 if ((!PSA_KEY_LIFETIME_IS_VOLATILE(slot->attr.lifetime)) && in psa_purge_key()
537 (slot->lock_count <= 1)) { in psa_purge_key()
538 return psa_wipe_key_slot(slot); in psa_purge_key()
540 return psa_unlock_key_slot(slot); in psa_purge_key()
551 const psa_key_slot_t *slot = &global_data.key_slots[slot_idx]; in mbedtls_psa_get_stats() local
552 if (psa_is_key_slot_locked(slot)) { in mbedtls_psa_get_stats()
555 if (!psa_is_key_slot_occupied(slot)) { in mbedtls_psa_get_stats()
559 if (PSA_KEY_LIFETIME_IS_VOLATILE(slot->attr.lifetime)) { in mbedtls_psa_get_stats()
562 psa_key_id_t id = MBEDTLS_SVC_KEY_ID_GET_KEY_ID(slot->attr.id); in mbedtls_psa_get_stats()
568 if (PSA_KEY_LIFETIME_GET_LOCATION(slot->attr.lifetime) != in mbedtls_psa_get_stats()
570 psa_key_id_t id = MBEDTLS_SVC_KEY_ID_GET_KEY_ID(slot->attr.id); in mbedtls_psa_get_stats()