File tree Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -359,21 +359,32 @@ pub fn keyctl_session_to_parent() -> Result<()> {
359
359
unsafe { keyctl ! ( libc:: KEYCTL_SESSION_TO_PARENT , ) } . map ( ignore)
360
360
}
361
361
362
+ #[ repr( C ) ]
363
+ struct DhComputeParamsKernel {
364
+ priv_ : i32 ,
365
+ prime : i32 ,
366
+ base : i32 ,
367
+ }
368
+
362
369
pub fn keyctl_dh_compute (
363
370
private : KeyringSerial ,
364
371
prime : KeyringSerial ,
365
372
base : KeyringSerial ,
366
373
mut buffer : Option < Out < [ u8 ] > > ,
367
374
) -> Result < usize > {
375
+ let params = DhComputeParamsKernel {
376
+ priv_ : private. get ( ) ,
377
+ prime : prime. get ( ) ,
378
+ base : base. get ( ) ,
379
+ } ;
368
380
let capacity = buffer. as_mut ( ) . map_or ( 0 , |b| b. len ( ) ) ;
369
381
unsafe {
370
382
keyctl ! (
371
383
libc:: KEYCTL_DH_COMPUTE ,
372
- private. get( ) ,
373
- prime. get( ) ,
374
- base. get( ) ,
384
+ & params as * const DhComputeParamsKernel ,
375
385
buffer. as_mut( ) . map_or( ptr:: null( ) , |b| b. as_mut_ptr( ) ) ,
376
386
capacity,
387
+ 0 ,
377
388
)
378
389
}
379
390
. map ( size)
You can’t perform that action at this time.
0 commit comments