/mbedtls-latest/library/ |
D | psa_crypto_slot_management.c | 389 psa_key_slot_t *slot = NULL; in psa_get_and_lock_key_slot_in_memory() local 392 slot = get_volatile_key_slot(key_id); in psa_get_and_lock_key_slot_in_memory() 396 if (slot != NULL && in psa_get_and_lock_key_slot_in_memory() 397 slot->state == PSA_SLOT_FULL && in psa_get_and_lock_key_slot_in_memory() 398 mbedtls_svc_key_id_equal(key, slot->attr.id)) { in psa_get_and_lock_key_slot_in_memory() 409 slot = get_persistent_key_slot(slot_idx); in psa_get_and_lock_key_slot_in_memory() 411 if ((slot->state == PSA_SLOT_FULL) && in psa_get_and_lock_key_slot_in_memory() 412 (mbedtls_svc_key_id_equal(key, slot->attr.id))) { in psa_get_and_lock_key_slot_in_memory() 421 status = psa_register_read(slot); in psa_get_and_lock_key_slot_in_memory() 423 *p_slot = slot; in psa_get_and_lock_key_slot_in_memory() [all …]
|
D | psa_crypto.c | 710 psa_status_t psa_allocate_buffer_to_slot(psa_key_slot_t *slot, in psa_allocate_buffer_to_slot() argument 718 if (slot->key.data != NULL) { in psa_allocate_buffer_to_slot() 722 slot->key.data = mbedtls_calloc(1, buffer_length); in psa_allocate_buffer_to_slot() 723 if (slot->key.data == NULL) { in psa_allocate_buffer_to_slot() 728 slot->key.bytes = buffer_length; in psa_allocate_buffer_to_slot() 732 psa_status_t psa_copy_key_material_into_slot(psa_key_slot_t *slot, in psa_copy_key_material_into_slot() argument 736 psa_status_t status = psa_allocate_buffer_to_slot(slot, in psa_copy_key_material_into_slot() 742 memcpy(slot->key.data, data, data_length); in psa_copy_key_material_into_slot() 1109 psa_key_slot_t *slot = NULL; in psa_get_and_lock_key_slot_with_policy() local 1115 slot = *p_slot; in psa_get_and_lock_key_slot_with_policy() [all …]
|
D | psa_crypto_slot_management.h | 184 psa_key_slot_t *slot); 206 psa_key_slot_t *slot, psa_key_slot_state_t expected_state, in psa_key_slot_state_transition() argument 209 if (slot->state != expected_state) { in psa_key_slot_state_transition() 212 slot->state = new_state; in psa_key_slot_state_transition() 230 static inline psa_status_t psa_register_read(psa_key_slot_t *slot) in psa_register_read() argument 232 if ((slot->state != PSA_SLOT_FULL) || in psa_register_read() 233 (slot->var.occupied.registered_readers >= SIZE_MAX)) { in psa_register_read() 236 slot->var.occupied.registered_readers++; in psa_register_read() 265 psa_status_t psa_unregister_read(psa_key_slot_t *slot); 286 psa_status_t psa_unregister_read_under_mutex(psa_key_slot_t *slot);
|
D | psa_crypto_core.h | 218 static inline int psa_key_slot_has_readers(const psa_key_slot_t *slot) in psa_key_slot_has_readers() argument 220 return slot->var.occupied.registered_readers > 0; in psa_key_slot_has_readers() 231 const psa_key_slot_t *slot) in psa_key_slot_get_slot_number() argument 233 return *((psa_key_slot_number_t *) (slot->key.data)); in psa_key_slot_get_slot_number() 255 psa_status_t psa_wipe_key_slot(psa_key_slot_t *slot); 269 psa_status_t psa_allocate_buffer_to_slot(psa_key_slot_t *slot, 273 psa_status_t psa_remove_key_data_from_memory(psa_key_slot_t *slot); 292 psa_status_t psa_copy_key_material_into_slot(psa_key_slot_t *slot,
|
D | cipher.c | 220 (void) psa_destroy_key(cipher_psa->slot); in mbedtls_cipher_free() 357 &cipher_psa->slot); in mbedtls_cipher_setkey() 1333 cipher_psa->slot, in mbedtls_cipher_crypt() 1337 cipher_psa->slot, in mbedtls_cipher_crypt() 1430 status = psa_aead_encrypt(cipher_psa->slot, in mbedtls_cipher_aead_encrypt() 1507 status = psa_aead_decrypt(cipher_psa->slot, in mbedtls_cipher_aead_decrypt()
|
D | psa_crypto_storage.h | 295 psa_key_slot_number_t slot; member
|
D | cipher_wrap.h | 163 mbedtls_svc_key_id_t slot; member
|
/mbedtls-latest/tests/suites/ |
D | test_suite_psa_crypto_slot_management.data | 1 Transient slot, check after closing 4 Transient slot, check after closing and restarting 7 Transient slot, check after destroying 10 Transient slot, check after destroying and restarting 13 Transient slot, check after restart with live handles 16 Persistent slot, check after closing, id=min 19 Persistent slot, check after closing and restarting, id=min 22 Persistent slot, check after destroying, id=min 25 Persistent slot, check after destroying and restarting, id=min 28 Persistent slot, check after purging, id=min [all …]
|
D | test_suite_psa_crypto_se_driver_hal.data | 30 SE key import-export persistent (p_allocate allows 1 slot) 33 SE key import-export persistent, check after restart (slot 0) 36 SE key import-export persistent, check after restart (slot 3) 42 SE key import-export volatile (p_allocate allows 1 slot) 45 SE key import-export volatile, check after restart (slot 0) 48 SE key import-export volatile, check after restart (slot 3) 51 Key creation in a specific slot (0) 54 Key creation in a specific slot (max) 57 Key creation in a specific slot (0, restart) 60 Key creation in a specific slot (max, restart) [all …]
|
D | test_suite_psa_crypto_attributes.function | 100 /* Initially, there is no slot number. */ 104 /* Test setting a slot number. */ 109 /* Test changing the slot number. */ 114 /* Test clearing the slot number. */ 124 /* Test that reset clears the slot number. */
|
D | test_suite_psa_crypto_se_driver_hal.function | 142 /* Validate a choice of slot number as directed. */ 160 /* Allocate slot numbers with a monotonic counter. */ 466 ram_slot_t *slot; 473 slot = &ram_slots[slot_number]; 477 psa_set_key_type(&attributes, slot->type); 479 slot->content, 480 PSA_BITS_TO_BYTES(slot->bits), 499 ram_slot_t *slot; 506 slot = &ram_slots[slot_number]; 510 psa_set_key_type(&attributes, slot->type); [all …]
|
D | test_suite_psa_crypto_slot_management.function | 405 /* Attempt to create a new key in the same slot. */ 539 /* Populate the source slot. */ 554 /* Prepare the target slot. */ 577 /* Test that the target slot has the expected content. */ 663 /* Populate the source slot. */ 675 /* Populate the target slot. */ 699 /* Test that the target slot is unaffected. */ 950 * in the same slot in the key store as the destroyed key. 951 * Since volatile keys IDs are assigned based on which slot contains 1035 * slots when creating the last key is restored in a RAM slot to export [all …]
|
D | test_suite_psa_crypto_init.data | 19 No key slot access without init 25 No key slot access after deinit
|
D | test_suite_psa_crypto_attributes.data | 26 PSA key attributes: slot number
|
D | test_suite_psa_crypto_persistent_key.function | 179 /* Check key slot storage is removed */ 186 /* Create another key in the same slot */
|
/mbedtls-latest/docs/architecture/ |
D | psa-keystore-design.md | 12 ## Key slot management interface 16 The **key store** consists of a collection of **key slots**. Each key slot contains the metadata fo… 18 A key slot has the type `psa_key_slot_t`. The key store is a global object which is private inside … 20 ### Key slot entry points 22 The following operations allocate a key slot by calling `psa_reserve_free_key_slot()`: 27 The following operations free a key slot by calling `psa_wipe_key_slot()` and, if applicable, `psa_… 40 ### Key slot states 42 The state of a key slot is indicated by its `state` field of type `psa_key_slot_state_t`, which can… 44 * `PSA_SLOT_EMPTY`: a slot that occupies memory but does not currently contain a key. 45 * `PSA_SLOT_FILLING`: a slot that is being filled to create or load a key. [all …]
|
D | mbed-crypto-storage-specification.md | 28 * [Persistent transparent keys](#key-file-format-for-0.1.0) designated by a [slot number](#key-name… 226 …ferences to keys in a secure element. In such key files, the key material contains the slot number. 275 * For an opaque key (key in a secure element): slot number (8 bytes), in platform endianness. 291 * slot number (8 bytes): `psa_key_slot_number_t` value. This is the unique designation of the key f… 297 * The slot in the secure element designated by the slot number. 301 * The slot in the secure element designated by the slot number. 335 * For an opaque key (key in a secure element): slot number (8 bytes), in platform endianness. 360 …ically registered drivers (`MBEDTLS_PSA_CRYPTO_SE_C`). The driver picks a slot number which is sto… 426 …* For an opaque key (key in a dynamic secure element): slot number (8 bytes), in platform endianne… 455 * slot number (8 bytes): `psa_key_slot_number_t` value. This is the unique designation of the key f… [all …]
|
D | psa-crypto-implementation-structure.md | 62 …2. Call psa_start_key_creation() that allocates a key slot, prepares it with the specified key att… 63 …3. Generate or copy the key material into the key slot. This entails the allocation of the buffer … 66 …t step 3 or 4, psa_fail_key_creation() is called. It wipes and cleans the slot especially the key …
|
D | psa-storage-resilience.md | 161 …slot always exists, and it's up to the user to remember what, if anything, they put in it. The dri… 431 We assume that the key is loaded in a key slot in memory: the core needs to know the key's location… 437 5. Free the corresponding key slot in memory. 445 1. Load the key into a key slot in memory (to get its location and the driver key identifier, altho… 449 5. Free the corresponding key slot in memory.
|
/mbedtls-latest/docs/architecture/psa-thread-safety/ |
D | psa-thread-safety.md | 10 … states are described in the [Key slot states](#key-slot-states) section. They guarantee safe conc… 121 …e trying to load a persistent key into the key store a thread temporarily reserves a free key slot. 157 ##### Key slot states 159 …slot has a state variable and a `registered_readers` counter. These two variables dictate whether … 161 There are four possible states for a key slot: 163 …slot, and no information is stored in the slot. Any thread is able to change the slot's state to `… 164 …aterial to fill the slot, this thread is responsible for the next state transition. Other threads … 165 * `PSA_SLOT_FULL`: the slot contains a key, and any thread is able to use the key after registering… 166 …slot has been destroyed or marked for destruction, but at least one thread is still registered as … 168 ###### Key slot state transition diagram [all …]
|
/mbedtls-latest/programs/ssl/ |
D | ssl_server2.c | 949 mbedtls_svc_key_id_t slot; member 964 mbedtls_svc_key_id_t const slot = head->slot; in psk_free() local 966 if (MBEDTLS_SVC_KEY_ID_GET_KEY_ID(slot) != 0) { in psk_free() 967 status = psa_destroy_key(slot); in psk_free() 1039 if (MBEDTLS_SVC_KEY_ID_GET_KEY_ID(cur->slot) != 0) { in psk_callback() 1040 return mbedtls_ssl_set_hs_psk_opaque(ssl, cur->slot); in psk_callback() 1133 unsigned slot; member 1161 unsigned slot; in ssl_async_start() local 1177 for (slot = 0; slot < config_data->slots_used; slot++) { in ssl_async_start() 1179 config_data->slots[slot].pk, in ssl_async_start() [all …]
|
D | ssl_client2.c | 819 mbedtls_svc_key_id_t slot = MBEDTLS_SVC_KEY_ID_INIT; in main() local 2012 status = psa_import_key(&key_attributes, psk, psk_len, &slot); in main() 2018 if ((ret = mbedtls_ssl_conf_psk_opaque(&conf, slot, in main() 3174 status = psa_destroy_key(slot); in main() 3178 (unsigned) MBEDTLS_SVC_KEY_ID_GET_KEY_ID(slot), in main()
|
/mbedtls-latest/scripts/data_files/driver_templates/ |
D | psa_crypto_driver_wrappers.h.jinja | 130 /* Key is stored in the slot in export representation, so 204 /* Key is stored in the slot in export representation, so 291 /* Key is stored in the slot in export representation, so 395 /* Key is stored in the slot in export representation, so 525 /* Key is stored in the slot in export representation, so 617 /* Key is stored in the slot in export representation, so 893 /* Key is stored in the slot in export representation, so 1053 /* Key is stored in the slot in export representation, so 1143 /* Key is stored in the slot in export representation, so 1220 /* Key is stored in the slot in export representation, so [all …]
|
D | psa_crypto_driver_wrappers_no_static.c.jinja | 165 /* Key is stored in the slot in export representation, so
|
/mbedtls-latest/docs/architecture/psa-migration/ |
D | strategy.md | 426 memory controlled by the PK layer as opposed to a PSA key slot, moving it to a 427 slot only when needed (see current `ecdsa_verify_wrap` when 433 bytes in the X.509 CRT structure, and only moved to a PK context / PSA slot
|