Remove unnecessary version req and clean up param names.

This commit is contained in:
Vojtěch Pejša 2019-04-17 21:40:51 +02:00
parent 1b5293a977
commit f40a328d43
3 changed files with 16 additions and 11 deletions

View File

@ -25,11 +25,8 @@ extern "C" {
pub fn EVP_MD_size(md: *const EVP_MD) -> c_int;
pub fn EVP_MD_type(md: *const EVP_MD) -> c_int;
#[cfg(any(ossl110, libressl273))]
pub fn EVP_CIPHER_key_length(cipher: *const EVP_CIPHER) -> c_int;
#[cfg(any(ossl110, libressl273))]
pub fn EVP_CIPHER_block_size(cipher: *const EVP_CIPHER) -> c_int;
#[cfg(any(ossl110, libressl273))]
pub fn EVP_CIPHER_iv_length(cipher: *const EVP_CIPHER) -> c_int;
}
@ -121,14 +118,12 @@ extern "C" {
npubk: c_int,
) -> c_int;
pub fn EVP_SealFinal(ctx: *mut EVP_CIPHER_CTX, out: *mut c_uchar, outl: *mut c_int) -> c_int;
#[cfg(ossl111)]
pub fn EVP_PKEY_size(pkey: *const EVP_PKEY) -> c_int;
pub fn EVP_EncryptUpdate(
ctx: *mut EVP_CIPHER_CTX,
out: *mut c_uchar,
outl: *mut c_int,
inbuf: *const u8,
inlen: c_int,
in_: *const u8,
inl: c_int,
) -> c_int;
pub fn EVP_OpenInit(
ctx: *mut EVP_CIPHER_CTX,
@ -143,10 +138,21 @@ extern "C" {
ctx: *mut EVP_CIPHER_CTX,
out: *mut c_uchar,
outl: *mut c_int,
inbuf: *const u8,
inlen: c_int,
in_: *const u8,
inl: c_int,
) -> c_int;
}
cfg_if! {
if #[cfg(any(ossl111, libressl280))] {
extern "C" {
pub fn EVP_PKEY_size(pkey: *const EVP_PKEY) -> c_int;
}
} else {
extern "C" {
pub fn EVP_PKEY_size(pkey: *mut EVP_PKEY) -> c_int;
}
}
}
cfg_if! {
if #[cfg(any(ossl102, libressl280))] {
extern "C" {

View File

@ -66,7 +66,7 @@ impl EvpSeal {
let mut my_ek = Vec::new();
for key in pub_keys {
let mut key_buffer: Vec<c_uchar>;
key_buffer = vec![0; ffi::EVP_PKEY_size(key.as_ptr()) as usize];
key_buffer = vec![0; ffi::EVP_PKEY_size(key.as_ptr() as *mut _) as usize];
let tmp = key_buffer.as_mut_ptr();
my_ek.push(key_buffer);
ek.push(tmp);

View File

@ -150,7 +150,6 @@ pub mod dsa;
pub mod ec;
pub mod ecdsa;
pub mod error;
#[cfg(ossl111)]
pub mod evp;
pub mod ex_data;
#[cfg(not(libressl))]