@@ -1054,8 +1054,10 @@ psa_status_t psa_unwrap_key_to_alternate_lifetime(
1054
1054
* and authenticity of the key material. In practical terms, the key
1055
1055
* material is encrypted and authenticated.
1056
1056
*
1057
- * The policy on the key must have the usage flag
1057
+ * The policy on the key to wrap must have the usage flag
1058
1058
* #PSA_KEY_USAGE_EXPORT_WRAPPED set.
1059
+ * The policy on the wrapping key must have the usage flag
1060
+ * #PSA_KEY_USAGE_WRAP_OTHER_KEY set.
1059
1061
*
1060
1062
* \param wrapping_key Handle to the key to wrap with.
1061
1063
* \param alg The key wrapping algorithm to compute
@@ -1074,6 +1076,9 @@ psa_status_t psa_unwrap_key_to_alternate_lifetime(
1074
1076
* handle to a key.
1075
1077
* \retval #PSA_ERROR_NOT_PERMITTED
1076
1078
* The key \p handle does not have the #PSA_KEY_USAGE_BACKUP flag.
1079
+ * \retval #PSA_ERROR_NOT_PERMITTED
1080
+ * The key \p wrapping_key does not have the
1081
+ * #PSA_KEY_USAGE_WRAP_OTHER_KEY flag.
1077
1082
* \retval #PSA_ERROR_INVALID_ARGUMENT
1078
1083
* \p wrapping_key does not support wrapping key material.
1079
1084
* \retval #PSA_ERROR_NOT_SUPPORTED
@@ -1105,6 +1110,9 @@ psa_status_t psa_wrap_key_material(psa_key_handle_t wrapping_key,
1105
1110
/**
1106
1111
* \brief Import wrapped key material.
1107
1112
*
1113
+ * The policy on the wrapping key must have the usage flag
1114
+ * #PSA_KEY_USAGE_UNWRAP_OTHER_KEY set.
1115
+ *
1108
1116
* \param wrapping_key Handle to the key to unwrap with.
1109
1117
* \param alg The key unwrapping algorithm to compute
1110
1118
* (\c PSA_ALG_XXX value such that
@@ -1126,6 +1134,9 @@ psa_status_t psa_wrap_key_material(psa_key_handle_t wrapping_key,
1126
1134
* \retval #PSA_ERROR_ALREADY_EXISTS
1127
1135
* This is an attempt to create a persistent key, and there is
1128
1136
* already a persistent key with the given identifier.
1137
+ * \retval #PSA_ERROR_NOT_PERMITTED
1138
+ * The key \p wrapping_key does not have the
1139
+ * #PSA_KEY_USAGE_UNWRAP_OTHER_KEY flag.
1129
1140
* \retval #PSA_ERROR_INVALID_ARGUMENT
1130
1141
* The key attributes, as a whole, are invalid.
1131
1142
* \retval #PSA_ERROR_INVALID_ARGUMENT
0 commit comments