Lines Matching refs:slot

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
159slot has a state variable and a `registered_readers` counter. These two variables dictate whether …
161 There are four possible states for a key slot:
163slot, 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…
166slot has been destroyed or marked for destruction, but at least one thread is still registered as …
168 ###### Key slot state transition diagram
169 ![](key-slot-state-transitions.png)
171 … two states `q1` and `q2` with label `f` indicates that if the state of a slot is `q1` immediately…
174 ##### Key slot access primitives
176slot is updated via the internal function `psa_key_slot_state_transition`. To change the state of …
178 Changing a slot's state to `PSA_SLOT_EMPTY` is done via `psa_wipe_key_slot`, this function wipes th…
180slot is incremented via `psa_register_read`, and decremented via `psa_unregister_read`. Library fu…
186 …tency of the key store by ensuring that all reads and writes to `slot->state` and `slot->registere…
190 {mbedtls_svc_key_id_t k : (\exists slot := &global_data.key_slots[i]) [
191 (slot->state == PSA_SLOT_FULL) &&
192 (slot->attr.id == k)]}
194 … currently exist as far as the code is concerned (even if the key is in a slot which has a `PSA_SL…
204 To load a new key into a slot, the following internal utility functions are used:
206 … iterates through the key store to find a slot whose state is `PSA_SLOT_EMPTY`. If found, it reser…
207slot has been found then the slot id is set. This second step is not done under the mutex, at this…
208 … in the key store (this check cannot be done before this stage), sets the slot's state to `PSA_SLO…
209 … takes the mutex, wipes the slot, and releases the mutex. Immediately after this unlock, any threa…
213slot array provided they are not currently being used (`registered_readers == 0`). When attempting…
215 If `psa_reserve_free_key_slot` cannot find a suitable slot, the key cannot be loaded back in. This …
222 …e on the key slot, usually copying the key into a separate buffer to be used by the operation. Thi…
229slot. The destroying thread registers to read the key, sets the slot's state to `PSA_SLOT_PENDING_…
231slot's state is `PSA_SLOT_PENDING_DELETION` and the slot's registered reader counter is equal to 1…
244 …linearization point for a successful destruction is the mutex unlock, the slot is now in the state…
245 …close_key` - The linearization point is the mutex unlock after wiping the slot for a success, or u…
249 …not yet tested whether they rely on unprotected global resources. The key slot access in these ope…
265 ….html) to detect data races. We test the key store, and test that our key slot state system is enf…
283 Key loading does somewhat run in parallel, deriving the key and copying it key into the slot is not…
296 …l each only hold the global mutex for finding the relevant key in the key slot, and unregistering …
319 …* Instead of calling `psa_unregister_read`, the thread waits until the condition `slot->registered…
324 …* Multi-part operations will need to remain registered as readers of their key slot until their co…
325 …functionality where `psa_unregister_read` can wipe the key slot will need to be removed, slot wipi…