aboutsummaryrefslogtreecommitdiff
path: root/library
diff options
context:
space:
mode:
authorRyan Everett <ryan.everett@arm.com>2024-04-29 18:26:19 +0100
committerRyan Everett <ryan.everett@arm.com>2024-04-29 18:26:19 +0100
commit04e2b04f7fd11eb70f686feab62d4daefb6c5a9c (patch)
tree50b6de11bb7edbbc5a97995227e957e7182ce748 /library
parentdd90507dc679284d1c99f3e18bafeb51e539e221 (diff)
downloadmbedtls-04e2b04f7fd11eb70f686feab62d4daefb6c5a9c.zip
mbedtls-04e2b04f7fd11eb70f686feab62d4daefb6c5a9c.tar.gz
mbedtls-04e2b04f7fd11eb70f686feab62d4daefb6c5a9c.tar.bz2
Explicitly document return behaviour
A bug existed previously where this guarantee was not met, causing some issues in multi-threaded code. Signed-off-by: Ryan Everett <ryan.everett@arm.com>
Diffstat (limited to 'library')
-rw-r--r--library/psa_crypto_slot_management.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/library/psa_crypto_slot_management.h b/library/psa_crypto_slot_management.h
index bcfc9d8..a84be7d 100644
--- a/library/psa_crypto_slot_management.h
+++ b/library/psa_crypto_slot_management.h
@@ -58,6 +58,9 @@ static inline int psa_key_id_is_volatile(psa_key_id_t key_id)
* It is the responsibility of the caller to call psa_unregister_read(slot)
* when they have finished reading the contents of the slot.
*
+ * On failure, `*p_slot` is set to NULL. This ensures that it is always valid
+ * to call psa_unregister_read on the returned slot.
+ *
* \param key Key identifier to query.
* \param[out] p_slot On success, `*p_slot` contains a pointer to the
* key slot containing the description of the key