Loading openssl-sys/src/x509.rs +14 −51 Original line number Diff line number Diff line Loading @@ -308,15 +308,9 @@ extern "C" { pub fn X509_new() -> *mut X509; pub fn X509_free(x: *mut X509); } cfg_if! { if #[cfg(ossl300)] { extern "C" { pub fn i2d_X509(x: *const X509, buf: *mut *mut u8) -> c_int; } } else { const_ptr_api! { extern "C" { pub fn i2d_X509(x: *mut X509, buf: *mut *mut u8) -> c_int; } pub fn i2d_X509(x: #[const_ptr_if(ossl300)] X509, buf: *mut *mut u8) -> c_int; } } extern "C" { Loading @@ -328,15 +322,9 @@ extern "C" { pub fn X509_set_serialNumber(x: *mut X509, sn: *mut ASN1_INTEGER) -> c_int; pub fn X509_get_serialNumber(x: *mut X509) -> *mut ASN1_INTEGER; } cfg_if! { if #[cfg(ossl300)] { extern "C" { pub fn X509_set_issuer_name(x: *mut X509, name: *const X509_NAME) -> c_int; } } else { const_ptr_api! { extern "C" { pub fn X509_set_issuer_name(x: *mut X509, name: *mut X509_NAME) -> c_int; } pub fn X509_set_issuer_name(x: *mut X509, name: #[const_ptr_if(ossl300)] X509_NAME) -> c_int; } } extern "C" { Loading @@ -345,21 +333,7 @@ extern "C" { const_ptr_api! { extern "C" { pub fn X509_get_issuer_name(x: #[const_ptr_if(any(ossl110, libressl280))] ::X509) -> *mut ::X509_NAME; } } cfg_if! { if #[cfg(ossl300)] { extern "C" { pub fn X509_set_subject_name(x: *mut X509, name: *const X509_NAME) -> c_int; } } else { extern "C" { pub fn X509_set_subject_name(x: *mut X509, name: *mut X509_NAME) -> c_int; } } } const_ptr_api! { extern "C" { pub fn X509_set_subject_name(x: *mut X509, name: #[const_ptr_if(ossl300)] X509_NAME) -> c_int; pub fn X509_get_subject_name(x: #[const_ptr_if(any(ossl110, libressl280))] ::X509) -> *mut ::X509_NAME; } } Loading @@ -383,15 +357,9 @@ extern "C" { #[cfg(ossl110)] pub fn X509_REQ_get_subject_name(req: *const X509_REQ) -> *mut X509_NAME; } cfg_if! { if #[cfg(ossl300)] { extern "C" { pub fn X509_REQ_set_subject_name(req: *mut X509_REQ, name: *const X509_NAME) -> c_int; } } else { const_ptr_api! { extern "C" { pub fn X509_REQ_set_subject_name(req: *mut X509_REQ, name: *mut X509_NAME) -> c_int; } pub fn X509_REQ_set_subject_name(req: *mut X509_REQ, name: #[const_ptr_if(ossl300)] X509_NAME) -> c_int; } } extern "C" { Loading Loading @@ -635,15 +603,10 @@ extern "C" { pub fn X509_verify_cert(ctx: *mut X509_STORE_CTX) -> c_int; } cfg_if! { if #[cfg(ossl300)] { extern "C" { pub fn X509_STORE_get0_objects(ctx: *const X509_STORE) -> *mut stack_st_X509_OBJECT; } } else if #[cfg(any(ossl110, libressl270))] { const_ptr_api! { extern "C" { pub fn X509_STORE_get0_objects(ctx: *mut X509_STORE) -> *mut stack_st_X509_OBJECT; } #[cfg(any(ossl110, libressl270))] pub fn X509_STORE_get0_objects(ctx: #[const_ptr_if(ossl300)] X509_STORE) -> *mut stack_st_X509_OBJECT; } } #[cfg(any(ossl110, libressl270))] Loading openssl-sys/src/x509_vfy.rs +11 −22 Original line number Diff line number Diff line Loading @@ -121,34 +121,23 @@ extern "C" { pub fn X509_STORE_set_default_paths(store: *mut X509_STORE) -> c_int; } cfg_if! { if #[cfg(ossl300)] { extern "C" { pub fn X509_STORE_CTX_get_ex_data(ctx: *const X509_STORE_CTX, idx: c_int) -> *mut c_void; pub fn X509_STORE_CTX_get_error(ctx: *const X509_STORE_CTX) -> c_int; pub fn X509_STORE_CTX_get_error_depth(ctx: *const X509_STORE_CTX) -> c_int; pub fn X509_STORE_CTX_get_current_cert(ctx: *const X509_STORE_CTX) -> *mut X509; } } else { const_ptr_api! { extern "C" { pub fn X509_STORE_CTX_get_ex_data(ctx: *mut X509_STORE_CTX, idx: c_int) -> *mut c_void; pub fn X509_STORE_CTX_get_error(ctx: *mut X509_STORE_CTX) -> c_int; pub fn X509_STORE_CTX_get_error_depth(ctx: *mut X509_STORE_CTX) -> c_int; pub fn X509_STORE_CTX_get_current_cert(ctx: *mut X509_STORE_CTX) -> *mut X509; } pub fn X509_STORE_CTX_get_ex_data(ctx: #[const_ptr_if(ossl300)] X509_STORE_CTX, idx: c_int) -> *mut c_void; pub fn X509_STORE_CTX_get_error(ctx: #[const_ptr_if(ossl300)] X509_STORE_CTX) -> c_int; pub fn X509_STORE_CTX_get_error_depth(ctx: #[const_ptr_if(ossl300)] X509_STORE_CTX) -> c_int; pub fn X509_STORE_CTX_get_current_cert(ctx: #[const_ptr_if(ossl300)] X509_STORE_CTX) -> *mut X509; } } extern "C" { pub fn X509_STORE_CTX_set_error(ctx: *mut X509_STORE_CTX, error: c_int); } cfg_if! { if #[cfg(ossl300)] { if #[cfg(ossl110)] { const_ptr_api! { extern "C" { pub fn X509_STORE_CTX_get0_chain(ctx: *const X509_STORE_CTX) -> *mut stack_st_X509; pub fn X509_STORE_CTX_get0_chain(ctx: #[const_ptr_if(ossl300)] X509_STORE_CTX) -> *mut stack_st_X509; } } else if #[cfg(ossl110)] { extern "C" { pub fn X509_STORE_CTX_get0_chain(ctx: *mut X509_STORE_CTX) -> *mut stack_st_X509; } } else { extern "C" { Loading Loading
openssl-sys/src/x509.rs +14 −51 Original line number Diff line number Diff line Loading @@ -308,15 +308,9 @@ extern "C" { pub fn X509_new() -> *mut X509; pub fn X509_free(x: *mut X509); } cfg_if! { if #[cfg(ossl300)] { extern "C" { pub fn i2d_X509(x: *const X509, buf: *mut *mut u8) -> c_int; } } else { const_ptr_api! { extern "C" { pub fn i2d_X509(x: *mut X509, buf: *mut *mut u8) -> c_int; } pub fn i2d_X509(x: #[const_ptr_if(ossl300)] X509, buf: *mut *mut u8) -> c_int; } } extern "C" { Loading @@ -328,15 +322,9 @@ extern "C" { pub fn X509_set_serialNumber(x: *mut X509, sn: *mut ASN1_INTEGER) -> c_int; pub fn X509_get_serialNumber(x: *mut X509) -> *mut ASN1_INTEGER; } cfg_if! { if #[cfg(ossl300)] { extern "C" { pub fn X509_set_issuer_name(x: *mut X509, name: *const X509_NAME) -> c_int; } } else { const_ptr_api! { extern "C" { pub fn X509_set_issuer_name(x: *mut X509, name: *mut X509_NAME) -> c_int; } pub fn X509_set_issuer_name(x: *mut X509, name: #[const_ptr_if(ossl300)] X509_NAME) -> c_int; } } extern "C" { Loading @@ -345,21 +333,7 @@ extern "C" { const_ptr_api! { extern "C" { pub fn X509_get_issuer_name(x: #[const_ptr_if(any(ossl110, libressl280))] ::X509) -> *mut ::X509_NAME; } } cfg_if! { if #[cfg(ossl300)] { extern "C" { pub fn X509_set_subject_name(x: *mut X509, name: *const X509_NAME) -> c_int; } } else { extern "C" { pub fn X509_set_subject_name(x: *mut X509, name: *mut X509_NAME) -> c_int; } } } const_ptr_api! { extern "C" { pub fn X509_set_subject_name(x: *mut X509, name: #[const_ptr_if(ossl300)] X509_NAME) -> c_int; pub fn X509_get_subject_name(x: #[const_ptr_if(any(ossl110, libressl280))] ::X509) -> *mut ::X509_NAME; } } Loading @@ -383,15 +357,9 @@ extern "C" { #[cfg(ossl110)] pub fn X509_REQ_get_subject_name(req: *const X509_REQ) -> *mut X509_NAME; } cfg_if! { if #[cfg(ossl300)] { extern "C" { pub fn X509_REQ_set_subject_name(req: *mut X509_REQ, name: *const X509_NAME) -> c_int; } } else { const_ptr_api! { extern "C" { pub fn X509_REQ_set_subject_name(req: *mut X509_REQ, name: *mut X509_NAME) -> c_int; } pub fn X509_REQ_set_subject_name(req: *mut X509_REQ, name: #[const_ptr_if(ossl300)] X509_NAME) -> c_int; } } extern "C" { Loading Loading @@ -635,15 +603,10 @@ extern "C" { pub fn X509_verify_cert(ctx: *mut X509_STORE_CTX) -> c_int; } cfg_if! { if #[cfg(ossl300)] { extern "C" { pub fn X509_STORE_get0_objects(ctx: *const X509_STORE) -> *mut stack_st_X509_OBJECT; } } else if #[cfg(any(ossl110, libressl270))] { const_ptr_api! { extern "C" { pub fn X509_STORE_get0_objects(ctx: *mut X509_STORE) -> *mut stack_st_X509_OBJECT; } #[cfg(any(ossl110, libressl270))] pub fn X509_STORE_get0_objects(ctx: #[const_ptr_if(ossl300)] X509_STORE) -> *mut stack_st_X509_OBJECT; } } #[cfg(any(ossl110, libressl270))] Loading
openssl-sys/src/x509_vfy.rs +11 −22 Original line number Diff line number Diff line Loading @@ -121,34 +121,23 @@ extern "C" { pub fn X509_STORE_set_default_paths(store: *mut X509_STORE) -> c_int; } cfg_if! { if #[cfg(ossl300)] { extern "C" { pub fn X509_STORE_CTX_get_ex_data(ctx: *const X509_STORE_CTX, idx: c_int) -> *mut c_void; pub fn X509_STORE_CTX_get_error(ctx: *const X509_STORE_CTX) -> c_int; pub fn X509_STORE_CTX_get_error_depth(ctx: *const X509_STORE_CTX) -> c_int; pub fn X509_STORE_CTX_get_current_cert(ctx: *const X509_STORE_CTX) -> *mut X509; } } else { const_ptr_api! { extern "C" { pub fn X509_STORE_CTX_get_ex_data(ctx: *mut X509_STORE_CTX, idx: c_int) -> *mut c_void; pub fn X509_STORE_CTX_get_error(ctx: *mut X509_STORE_CTX) -> c_int; pub fn X509_STORE_CTX_get_error_depth(ctx: *mut X509_STORE_CTX) -> c_int; pub fn X509_STORE_CTX_get_current_cert(ctx: *mut X509_STORE_CTX) -> *mut X509; } pub fn X509_STORE_CTX_get_ex_data(ctx: #[const_ptr_if(ossl300)] X509_STORE_CTX, idx: c_int) -> *mut c_void; pub fn X509_STORE_CTX_get_error(ctx: #[const_ptr_if(ossl300)] X509_STORE_CTX) -> c_int; pub fn X509_STORE_CTX_get_error_depth(ctx: #[const_ptr_if(ossl300)] X509_STORE_CTX) -> c_int; pub fn X509_STORE_CTX_get_current_cert(ctx: #[const_ptr_if(ossl300)] X509_STORE_CTX) -> *mut X509; } } extern "C" { pub fn X509_STORE_CTX_set_error(ctx: *mut X509_STORE_CTX, error: c_int); } cfg_if! { if #[cfg(ossl300)] { if #[cfg(ossl110)] { const_ptr_api! { extern "C" { pub fn X509_STORE_CTX_get0_chain(ctx: *const X509_STORE_CTX) -> *mut stack_st_X509; pub fn X509_STORE_CTX_get0_chain(ctx: #[const_ptr_if(ossl300)] X509_STORE_CTX) -> *mut stack_st_X509; } } else if #[cfg(ossl110)] { extern "C" { pub fn X509_STORE_CTX_get0_chain(ctx: *mut X509_STORE_CTX) -> *mut stack_st_X509; } } else { extern "C" { Loading