File tree Expand file tree Collapse file tree 3 files changed +10
-19
lines changed Expand file tree Collapse file tree 3 files changed +10
-19
lines changed Original file line number Diff line number Diff line change @@ -1062,8 +1062,6 @@ cfg_if! {
1062
1062
1063
1063
cfg_if ! {
1064
1064
if #[ cfg( ossl300) ] {
1065
- #[ repr( C ) ]
1066
- // TODO(baloo): is that safe?
1067
- pub struct OSSL_LIB_CTX { }
1065
+ pub enum OSSL_LIB_CTX { }
1068
1066
}
1069
1067
}
Original file line number Diff line number Diff line change 1
- use cfg_if:: cfg_if;
2
1
use std:: error;
3
2
use std:: ffi:: { CStr , CString , NulError } ;
4
3
use std:: fmt;
5
- use std:: io;
6
- use std:: io:: prelude:: * ;
7
- use std:: ops:: { Deref , DerefMut } ;
8
4
use std:: ptr;
9
5
use std:: str;
10
6
11
7
use crate :: error:: ErrorStack ;
12
8
use crate :: hash:: MessageDigest ;
13
- use crate :: nid:: Nid ;
14
9
use crate :: params:: { Params , ParamsBuilder } ;
15
10
use crate :: { cvt, cvt_cp, cvt_p} ;
16
11
17
- use ffi:: { EVP_KDF_CTX_free , EVP_KDF_CTX_new } ;
18
-
19
12
#[ derive( Debug ) ]
20
13
pub enum KDFError {
21
14
Utf8Error ( str:: Utf8Error ) ,
@@ -43,7 +36,7 @@ impl From<ErrorStack> for KDFError {
43
36
}
44
37
45
38
impl fmt:: Display for KDFError {
46
- fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
39
+ fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
47
40
use KDFError :: * ;
48
41
match self {
49
42
Utf8Error ( ref e) => e. fmt ( f) ,
Original file line number Diff line number Diff line change @@ -84,11 +84,11 @@ pub struct ParamsBuilder(Vec<(&'static [u8], Param)>);
84
84
85
85
impl ParamsBuilder {
86
86
pub fn with_capacity ( capacity : usize ) -> Self {
87
- let mut params = Vec :: with_capacity ( capacity) ;
87
+ let params = Vec :: with_capacity ( capacity) ;
88
88
Self ( params)
89
89
}
90
90
91
- pub fn build ( mut self ) -> Params {
91
+ pub fn build ( self ) -> Params {
92
92
let len = self . 0 . len ( ) ;
93
93
94
94
let mut params = Params {
@@ -106,17 +106,17 @@ impl ParamsBuilder {
106
106
use Param :: * ;
107
107
let v = unsafe {
108
108
match p {
109
- I32 ( mut v) => {
109
+ I32 ( v) => {
110
110
let pname = name. as_ptr ( ) as * const i8 ;
111
- ffi:: OSSL_PARAM_construct_int ( pname, v)
111
+ ffi:: OSSL_PARAM_construct_int ( pname, * v)
112
112
}
113
- Vec ( mut buf, len) => {
113
+ Vec ( buf, len) => {
114
114
let pname = name. as_ptr ( ) as * const i8 ;
115
- ffi:: OSSL_PARAM_construct_octet_string ( pname, buf, * len)
115
+ ffi:: OSSL_PARAM_construct_octet_string ( pname, * buf, * len)
116
116
}
117
- String ( mut buf, len) => {
117
+ String ( buf, len) => {
118
118
let pname = name. as_ptr ( ) as * const i8 ;
119
- ffi:: OSSL_PARAM_construct_utf8_string ( pname, buf, * len)
119
+ ffi:: OSSL_PARAM_construct_utf8_string ( pname, * buf, * len)
120
120
}
121
121
}
122
122
} ;
You can’t perform that action at this time.
0 commit comments