@@ -1054,8 +1054,10 @@ psa_status_t psa_unwrap_key_to_alternate_lifetime(
10541054 * and authenticity of the key material. In practical terms, the key
10551055 * material is encrypted and authenticated.
10561056 *
1057- * The policy on the key must have the usage flag
1057+ * The policy on the key to wrap must have the usage flag
10581058 * #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.
10591061 *
10601062 * \param wrapping_key Handle to the key to wrap with.
10611063 * \param alg The key wrapping algorithm to compute
@@ -1074,6 +1076,9 @@ psa_status_t psa_unwrap_key_to_alternate_lifetime(
10741076 * handle to a key.
10751077 * \retval #PSA_ERROR_NOT_PERMITTED
10761078 * 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.
10771082 * \retval #PSA_ERROR_INVALID_ARGUMENT
10781083 * \p wrapping_key does not support wrapping key material.
10791084 * \retval #PSA_ERROR_NOT_SUPPORTED
@@ -1105,6 +1110,9 @@ psa_status_t psa_wrap_key_material(psa_key_handle_t wrapping_key,
11051110/**
11061111 * \brief Import wrapped key material.
11071112 *
1113+ * The policy on the wrapping key must have the usage flag
1114+ * #PSA_KEY_USAGE_UNWRAP_OTHER_KEY set.
1115+ *
11081116 * \param wrapping_key Handle to the key to unwrap with.
11091117 * \param alg The key unwrapping algorithm to compute
11101118 * (\c PSA_ALG_XXX value such that
@@ -1126,6 +1134,9 @@ psa_status_t psa_wrap_key_material(psa_key_handle_t wrapping_key,
11261134 * \retval #PSA_ERROR_ALREADY_EXISTS
11271135 * This is an attempt to create a persistent key, and there is
11281136 * 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.
11291140 * \retval #PSA_ERROR_INVALID_ARGUMENT
11301141 * The key attributes, as a whole, are invalid.
11311142 * \retval #PSA_ERROR_INVALID_ARGUMENT
0 commit comments