File tree Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -1252,11 +1252,17 @@ impl From<&Mechanism<'_>> for CK_MECHANISM {
12521252fn make_mechanism < T > ( mechanism : CK_MECHANISM_TYPE , param : & T ) -> CK_MECHANISM {
12531253 CK_MECHANISM {
12541254 mechanism,
1255- // SAFETY: Parameters that expect to have some part of themselves
1256- // mutated (such as additional_derived_keys in Kbkdf{*}Params) should
1257- // indicate this to the end user by marking the relevant constructor
1258- // parameters as mut. Otherwise, we should generally not expect the
1259- // backend to mutate the parameters, so this cast is fine.
1255+ /* SAFETY: Parameters that expect to have some part of themselves
1256+ * mutated should indicate this to the end user by marking both the
1257+ * relevant constructor parameters and the type's PhantomData as mut.
1258+ * Otherwise, we should generally not expect the backend to mutate the
1259+ * parameters, so this cast is fine.
1260+ * The list of such mutable parameter types so far:
1261+ * - aead::GcmParams
1262+ * - aead::GcmMessageParams
1263+ * - kbkdf::KbkdfParams
1264+ * - kbkdf::KbkdfFeedbackParams
1265+ **/
12601266 pParameter : param as * const T as * mut c_void ,
12611267 ulParameterLen : size_of :: < T > ( )
12621268 . try_into ( )
You can’t perform that action at this time.
0 commit comments