Skip to content

Commit 6278a38

Browse files
committed
kdf: set_params is deprecated
From discussion on openssl/openssl#14551 it sounds like set_params is going to be deprecated. Signed-off-by: Arthur Gautier <[email protected]>
1 parent 182557a commit 6278a38

File tree

3 files changed

+5
-9
lines changed

3 files changed

+5
-9
lines changed

openssl-sys/src/evp.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,6 @@ cfg_if! {
226226
pub fn EVP_KDF_CTX_new(kdf: *mut EVP_KDF) -> *mut EVP_KDF_CTX;
227227
pub fn EVP_KDF_CTX_free(ctx: *mut EVP_KDF_CTX);
228228

229-
pub fn EVP_KDF_CTX_set_params(ctx: *mut EVP_KDF_CTX, params: *mut OSSL_PARAM)-> c_int;
230229
pub fn EVP_KDF_CTX_reset(ctx: *mut EVP_KDF_CTX);
231230
pub fn EVP_KDF_CTX_get_kdf_size(ctx: *mut EVP_KDF_CTX) -> size_t;
232231
pub fn EVP_KDF_CTX_kdf(ctx: *mut EVP_KDF_CTX) -> *const EVP_KDF;

openssl/src/kdf.rs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -202,21 +202,14 @@ pub fn derive<P: KDFParams>(kdf: P, output: &mut [u8]) -> Result<(), KDFError> {
202202

203203
let mut ctx = KDFContext::new(kdf_ptr)?;
204204
let mut params = kdf.to_params()?;
205-
unsafe {
206-
cvt(ffi::EVP_KDF_CTX_set_params(
207-
ctx.as_mut_ptr(),
208-
params.as_mut_ptr(),
209-
))?
210-
};
211205

212206
// TODO: Check EVP_KDF_CTX_get_kdf_size ?
213-
214207
unsafe {
215208
cvt(ffi::EVP_KDF_derive(
216209
ctx.as_mut_ptr(),
217210
output.as_mut_ptr(),
218211
output.len(),
219-
ptr::null(),
212+
params.as_ptr(),
220213
))?
221214
};
222215
drop(params);

openssl/src/params.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,10 @@ impl Params {
156156
pub fn as_mut_ptr(&mut self) -> *mut ffi::OSSL_PARAM {
157157
self.output.as_mut_ptr()
158158
}
159+
160+
pub fn as_ptr(&mut self) -> *const ffi::OSSL_PARAM {
161+
self.output.as_ptr()
162+
}
159163
}
160164

161165
impl fmt::Debug for Params {

0 commit comments

Comments
 (0)