Skip to content

Commit

Permalink
Merge pull request #2289 from reaperhulk/kdf
Browse files Browse the repository at this point in the history
add basic EVP_KDF bindings
  • Loading branch information
alex authored Aug 31, 2024
2 parents 48824a6 + 3ed6fe2 commit 30179f6
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 0 deletions.
8 changes: 8 additions & 0 deletions openssl-sys/src/handwritten/kdf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,14 @@ cfg_if! {
info: *const u8,
infolen: c_int,
) -> c_int;
pub fn EVP_KDF_CTX_new(kdf: *mut EVP_KDF) -> *mut EVP_KDF_CTX;
pub fn EVP_KDF_CTX_free(ctx: *mut EVP_KDF_CTX);
pub fn EVP_KDF_CTX_reset(ctx: *mut EVP_KDF_CTX);
pub fn EVP_KDF_CTX_get_kdf_size(ctx: *mut EVP_KDF_CTX) -> size_t;
pub fn EVP_KDF_derive(ctx: *mut EVP_KDF_CTX, key: *mut u8, keylen: size_t, params: *const OSSL_PARAM) -> c_int;
pub fn EVP_KDF_fetch(ctx: *mut OSSL_LIB_CTX, algorithm: *const c_char, properties: *const c_char) -> *mut EVP_KDF;
pub fn EVP_KDF_free(kdf: *mut EVP_KDF);
}

}
}
7 changes: 7 additions & 0 deletions openssl-sys/src/handwritten/params.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,11 @@ extern "C" {
pub fn OSSL_PARAM_construct_uint(key: *const c_char, buf: *mut c_uint) -> OSSL_PARAM;
#[cfg(ossl300)]
pub fn OSSL_PARAM_construct_end() -> OSSL_PARAM;
#[cfg(ossl300)]
pub fn OSSL_PARAM_construct_octet_string(
key: *const c_char,
buf: *mut c_void,
bsize: size_t,
) -> OSSL_PARAM;

}
5 changes: 5 additions & 0 deletions openssl-sys/src/handwritten/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1139,3 +1139,8 @@ pub struct OSSL_PARAM {
data_size: size_t,
return_size: size_t,
}

#[cfg(ossl300)]
pub enum EVP_KDF {}
#[cfg(ossl300)]
pub enum EVP_KDF_CTX {}

0 comments on commit 30179f6

Please sign in to comment.