File tree 1 file changed +11
-5
lines changed
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 {
1252
1252
fn make_mechanism < T > ( mechanism : CK_MECHANISM_TYPE , param : & T ) -> CK_MECHANISM {
1253
1253
CK_MECHANISM {
1254
1254
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
+ **/
1260
1266
pParameter : param as * const T as * mut c_void ,
1261
1267
ulParameterLen : size_of :: < T > ( )
1262
1268
. try_into ( )
You can’t perform that action at this time.
0 commit comments