Skip to content

Commit 4ab57da

Browse files
committed
sys: add decoder symbols
1 parent a87b819 commit 4ab57da

File tree

5 files changed

+73
-1
lines changed

5 files changed

+73
-1
lines changed

openssl-sys/build/run_bindgen.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ const INCLUDES: &str = "
6161
#include <openssl/provider.h>
6262
#include <openssl/params.h>
6363
#include <openssl/param_build.h>
64+
#include <openssl/decoder.h>
6465
#endif
6566
6667
#if OPENSSL_VERSION_NUMBER >= 0x30200000
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
use super::super::*;
2+
use libc::*;
3+
4+
#[cfg(ossl300)]
5+
extern "C" {
6+
pub fn OSSL_DECODER_CTX_new() -> *mut OSSL_DECODER_CTX;
7+
pub fn OSSL_DECODER_CTX_free(ctx: *mut OSSL_DECODER_CTX);
8+
9+
pub fn OSSL_DECODER_CTX_new_for_pkey(
10+
pkey: *mut *mut EVP_PKEY,
11+
input_type: *const c_char,
12+
input_struct: *const c_char,
13+
keytype: *const c_char,
14+
selection: c_int,
15+
libctx: *mut OSSL_LIB_CTX,
16+
propquery: *const c_char,
17+
) -> *mut OSSL_DECODER_CTX;
18+
19+
pub fn OSSL_DECODER_CTX_set_selection(ctx: *mut OSSL_DECODER_CTX, selection: c_int) -> c_int;
20+
pub fn OSSL_DECODER_CTX_set_input_type(
21+
ctx: *mut OSSL_DECODER_CTX,
22+
input_type: *const c_char,
23+
) -> c_int;
24+
pub fn OSSL_DECODER_CTX_set_input_structure(
25+
ctx: *mut OSSL_DECODER_CTX,
26+
input_structure: *const c_char,
27+
) -> c_int;
28+
29+
pub fn OSSL_DECODER_CTX_set_passphrase(
30+
ctx: *mut OSSL_DECODER_CTX,
31+
kstr: *const c_uchar,
32+
klen: size_t,
33+
) -> c_int;
34+
pub fn OSSL_DECODER_CTX_set_pem_password_cb(
35+
ctx: *mut OSSL_DECODER_CTX,
36+
cb: pem_password_cb,
37+
cbarg: *mut c_void,
38+
) -> c_int;
39+
pub fn OSSL_DECODER_CTX_set_passphrase_cb(
40+
ctx: *mut OSSL_DECODER_CTX,
41+
cb: OSSL_PASSPHRASE_CALLBACK,
42+
cbarg: *mut c_void,
43+
) -> c_int;
44+
45+
pub fn OSSL_DECODER_from_bio(ctx: *mut OSSL_DECODER_CTX, b_in: *mut BIO) -> c_int;
46+
#[cfg(not(osslconf = "OPENSSL_NO_STDIO"))]
47+
pub fn OSSL_DECODER_from_fp(ctx: *mut OSSL_DECODER_CTX, fp: *mut FILE) -> c_int;
48+
pub fn OSSL_DECODER_from_data(
49+
ctx: *mut OSSL_DECODER_CTX,
50+
pdata: *mut *const c_uchar,
51+
pdata_len: *mut size_t,
52+
) -> c_int;
53+
}

openssl-sys/src/handwritten/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ pub use self::cmac::*;
66
pub use self::cms::*;
77
pub use self::conf::*;
88
pub use self::crypto::*;
9+
pub use self::decoder::*;
910
pub use self::dh::*;
1011
pub use self::dsa::*;
1112
pub use self::ec::*;
@@ -45,6 +46,7 @@ mod cmac;
4546
mod cms;
4647
mod conf;
4748
mod crypto;
49+
mod decoder;
4850
mod dh;
4951
mod dsa;
5052
mod ec;

openssl-sys/src/handwritten/types.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1147,3 +1147,17 @@ pub enum OSSL_PARAM_BLD {}
11471147
pub enum EVP_KDF {}
11481148
#[cfg(ossl300)]
11491149
pub enum EVP_KDF_CTX {}
1150+
1151+
#[cfg(ossl300)]
1152+
pub enum OSSL_DECODER_CTX {}
1153+
1154+
#[cfg(ossl300)]
1155+
pub type OSSL_PASSPHRASE_CALLBACK = Option<
1156+
unsafe extern "C" fn(
1157+
pass: *mut c_char,
1158+
pass_size: size_t,
1159+
pass_len: *mut size_t,
1160+
params: *const OSSL_PARAM,
1161+
arg: *mut c_void,
1162+
) -> c_int,
1163+
>;

systest/build.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,8 @@ fn main() {
8585
if version >= 0x30000000 {
8686
cfg.header("openssl/provider.h")
8787
.header("openssl/params.h")
88-
.header("openssl/param_build.h");
88+
.header("openssl/param_build.h")
89+
.header("openssl/decoder.h");
8990
}
9091
if version >= 0x30200000 {
9192
cfg.header("openssl/thread.h");
@@ -120,6 +121,7 @@ fn main() {
120121
s == "PasswordCallback"
121122
|| s == "pem_password_cb"
122123
|| s == "bio_info_cb"
124+
|| s == "OSSL_PASSPHRASE_CALLBACK"
123125
|| s.starts_with("CRYPTO_EX_")
124126
});
125127
cfg.skip_struct(|s| {

0 commit comments

Comments
 (0)