Update psa_destroy_key, psa_purge_key and psa_close_key
This does not yet implement destruction while a key is in use for psa_destroy_key;
that will be implemented in a separate pr.
(I am not sure if I am allowed to change the documentation in the include files.)
Signed-off-by: Ryan Everett <ryan.everett@arm.com>
diff --git a/include/psa/crypto.h b/include/psa/crypto.h
index fe10ee0..fd1928a 100644
--- a/include/psa/crypto.h
+++ b/include/psa/crypto.h
@@ -415,7 +415,9 @@
* \retval #PSA_ERROR_BAD_STATE
* The library has not been previously initialized by psa_crypto_init().
* It is implementation-dependent whether a failure to initialize
- * results in this error code.
+ * results in this error code. Or,
+ * this call was operating on a key slot and found the slot in
+ * an invalid state for the operation.
*/
psa_status_t psa_purge_key(mbedtls_svc_key_id_t key);
@@ -555,7 +557,9 @@
* \retval #PSA_ERROR_BAD_STATE
* The library has not been previously initialized by psa_crypto_init().
* It is implementation-dependent whether a failure to initialize
- * results in this error code.
+ * results in this error code. Or,
+ * this call was operating on a key slot and found the slot in
+ * an invalid state for the operation.
*/
psa_status_t psa_destroy_key(mbedtls_svc_key_id_t key);
diff --git a/include/psa/crypto_compat.h b/include/psa/crypto_compat.h
index f896fae..bfc0016 100644
--- a/include/psa/crypto_compat.h
+++ b/include/psa/crypto_compat.h
@@ -142,7 +142,9 @@
* \retval #PSA_ERROR_BAD_STATE
* The library has not been previously initialized by psa_crypto_init().
* It is implementation-dependent whether a failure to initialize
- * results in this error code.
+ * results in this error code. Or,
+ * this call was operating on a key slot and found the slot in
+ * an invalid state for the operation.
*/
psa_status_t psa_close_key(psa_key_handle_t handle);