Skip to content

Commit 43d030c

Browse files
authored
Merge pull request #2436 from huwcbjones/huw/pkey-params
sys/evp: set/get params bindings
2 parents b7cd35b + 2502407 commit 43d030c

File tree

1 file changed

+67
-0
lines changed
  • openssl-sys/src/handwritten

1 file changed

+67
-0
lines changed

openssl-sys/src/handwritten/evp.rs

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -669,3 +669,70 @@ extern "C" {
669669
pub fn EVP_EncodeBlock(dst: *mut c_uchar, src: *const c_uchar, src_len: c_int) -> c_int;
670670
pub fn EVP_DecodeBlock(dst: *mut c_uchar, src: *const c_uchar, src_len: c_int) -> c_int;
671671
}
672+
673+
cfg_if! {
674+
if #[cfg(ossl300)] {
675+
extern "C" {
676+
pub fn EVP_PKEY_gettable_params(pkey: *const EVP_PKEY) -> *const OSSL_PARAM;
677+
pub fn EVP_PKEY_get_params(pkey: *const EVP_PKEY, params: *mut OSSL_PARAM) -> c_int;
678+
pub fn EVP_PKEY_get_int_param(
679+
pkey: *const EVP_PKEY,
680+
key_name: *const c_char,
681+
out: *mut c_int,
682+
) -> c_int;
683+
pub fn EVP_PKEY_get_size_t_param(
684+
pkey: *const EVP_PKEY,
685+
key_name: *const c_char,
686+
out: *mut size_t,
687+
) -> c_int;
688+
pub fn EVP_PKEY_get_bn_param(
689+
pkey: *const EVP_PKEY,
690+
key_name: *const c_char,
691+
out: *mut *mut BIGNUM,
692+
) -> c_int;
693+
pub fn EVP_PKEY_get_utf8_string_param(
694+
pkey: *const EVP_PKEY,
695+
key_name: *const c_char,
696+
str: *mut c_char,
697+
max_buf_sz: size_t,
698+
out_len: *mut size_t,
699+
) -> c_int;
700+
pub fn EVP_PKEY_get_octet_string_param(
701+
pkey: *const EVP_PKEY,
702+
key_name: *const c_char,
703+
buf: *mut c_uchar,
704+
max_buf_sz: size_t,
705+
out_len: *mut size_t,
706+
) -> c_int;
707+
708+
pub fn EVP_PKEY_settable_params(pkey: *const EVP_PKEY) -> *const OSSL_PARAM;
709+
pub fn EVP_PKEY_set_params(pkey: *mut EVP_PKEY, params: *mut OSSL_PARAM) -> c_int;
710+
pub fn EVP_PKEY_set_int_param(
711+
pkey: *mut EVP_PKEY,
712+
key_name: *const c_char,
713+
in_val: c_int,
714+
) -> c_int;
715+
pub fn EVP_PKEY_set_size_t_param(
716+
pkey: *mut EVP_PKEY,
717+
key_name: *const c_char,
718+
in_val: size_t,
719+
) -> c_int;
720+
pub fn EVP_PKEY_set_bn_param(
721+
pkey: *mut EVP_PKEY,
722+
key_name: *const c_char,
723+
bn: *const BIGNUM,
724+
) -> c_int;
725+
pub fn EVP_PKEY_set_utf8_string_param(
726+
pkey: *mut EVP_PKEY,
727+
key_name: *const c_char,
728+
str: *const c_char,
729+
) -> c_int;
730+
pub fn EVP_PKEY_set_octet_string_param(
731+
pkey: *mut EVP_PKEY,
732+
key_name: *const c_char,
733+
buf: *const c_uchar,
734+
bsize: size_t,
735+
) -> c_int;
736+
}
737+
}
738+
}

0 commit comments

Comments
 (0)