Skip to content

Commit 30179f6

Browse files
authored
Merge pull request #2289 from reaperhulk/kdf
add basic EVP_KDF bindings
2 parents 48824a6 + 3ed6fe2 commit 30179f6

File tree

3 files changed

+20
-0
lines changed

3 files changed

+20
-0
lines changed

openssl-sys/src/handwritten/kdf.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,14 @@ cfg_if! {
2121
info: *const u8,
2222
infolen: c_int,
2323
) -> c_int;
24+
pub fn EVP_KDF_CTX_new(kdf: *mut EVP_KDF) -> *mut EVP_KDF_CTX;
25+
pub fn EVP_KDF_CTX_free(ctx: *mut EVP_KDF_CTX);
26+
pub fn EVP_KDF_CTX_reset(ctx: *mut EVP_KDF_CTX);
27+
pub fn EVP_KDF_CTX_get_kdf_size(ctx: *mut EVP_KDF_CTX) -> size_t;
28+
pub fn EVP_KDF_derive(ctx: *mut EVP_KDF_CTX, key: *mut u8, keylen: size_t, params: *const OSSL_PARAM) -> c_int;
29+
pub fn EVP_KDF_fetch(ctx: *mut OSSL_LIB_CTX, algorithm: *const c_char, properties: *const c_char) -> *mut EVP_KDF;
30+
pub fn EVP_KDF_free(kdf: *mut EVP_KDF);
2431
}
32+
2533
}
2634
}

openssl-sys/src/handwritten/params.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,11 @@ extern "C" {
66
pub fn OSSL_PARAM_construct_uint(key: *const c_char, buf: *mut c_uint) -> OSSL_PARAM;
77
#[cfg(ossl300)]
88
pub fn OSSL_PARAM_construct_end() -> OSSL_PARAM;
9+
#[cfg(ossl300)]
10+
pub fn OSSL_PARAM_construct_octet_string(
11+
key: *const c_char,
12+
buf: *mut c_void,
13+
bsize: size_t,
14+
) -> OSSL_PARAM;
15+
916
}

openssl-sys/src/handwritten/types.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1139,3 +1139,8 @@ pub struct OSSL_PARAM {
11391139
data_size: size_t,
11401140
return_size: size_t,
11411141
}
1142+
1143+
#[cfg(ossl300)]
1144+
pub enum EVP_KDF {}
1145+
#[cfg(ossl300)]
1146+
pub enum EVP_KDF_CTX {}

0 commit comments

Comments
 (0)