use core::cell::UnsafeCell;
use core::ffi::*;
use core::marker::{PhantomData, PhantomPinned};
use core::ptr::NonNull;
#[cfg(feature = "objc2")]
use objc2::__framework_prelude::*;
use crate::*;
#[repr(C)]
#[derive(Debug)]
pub struct sec_protocol_options {
inner: [u8; 0],
_p: UnsafeCell<PhantomData<(*const UnsafeCell<()>, PhantomPinned)>>,
}
#[cfg(feature = "objc2")]
unsafe impl RefEncode for sec_protocol_options {
const ENCODING_REF: Encoding =
Encoding::Pointer(&Encoding::Struct("sec_protocol_options", &[]));
}
pub type sec_protocol_options_t = *mut sec_protocol_options;
impl sec_protocol_options {
#[doc(alias = "sec_protocol_options_are_equal")]
#[inline]
pub unsafe fn are_equal(
options_a: sec_protocol_options_t,
options_b: sec_protocol_options_t,
) -> bool {
extern "C-unwind" {
fn sec_protocol_options_are_equal(
options_a: sec_protocol_options_t,
options_b: sec_protocol_options_t,
) -> bool;
}
unsafe { sec_protocol_options_are_equal(options_a, options_b) }
}
#[doc(alias = "sec_protocol_options_set_local_identity")]
#[cfg(feature = "SecProtocolTypes")]
#[inline]
pub unsafe fn set_local_identity(options: sec_protocol_options_t, identity: sec_identity_t) {
extern "C-unwind" {
fn sec_protocol_options_set_local_identity(
options: sec_protocol_options_t,
identity: sec_identity_t,
);
}
unsafe { sec_protocol_options_set_local_identity(options, identity) }
}
#[doc(alias = "sec_protocol_options_append_tls_ciphersuite")]
#[cfg(feature = "SecProtocolTypes")]
#[inline]
pub unsafe fn append_tls_ciphersuite(
options: sec_protocol_options_t,
ciphersuite: tls_ciphersuite_t,
) {
extern "C-unwind" {
fn sec_protocol_options_append_tls_ciphersuite(
options: sec_protocol_options_t,
ciphersuite: tls_ciphersuite_t,
);
}
unsafe { sec_protocol_options_append_tls_ciphersuite(options, ciphersuite) }
}
#[doc(alias = "sec_protocol_options_add_tls_ciphersuite")]
#[cfg(feature = "CipherSuite")]
#[deprecated = "Use sec_protocol_options_append_tls_ciphersuite"]
#[inline]
pub unsafe fn add_tls_ciphersuite(
options: sec_protocol_options_t,
ciphersuite: SSLCipherSuite,
) {
extern "C-unwind" {
fn sec_protocol_options_add_tls_ciphersuite(
options: sec_protocol_options_t,
ciphersuite: SSLCipherSuite,
);
}
unsafe { sec_protocol_options_add_tls_ciphersuite(options, ciphersuite) }
}
#[doc(alias = "sec_protocol_options_append_tls_ciphersuite_group")]
#[cfg(feature = "SecProtocolTypes")]
#[inline]
pub unsafe fn append_tls_ciphersuite_group(
options: sec_protocol_options_t,
group: tls_ciphersuite_group_t,
) {
extern "C-unwind" {
fn sec_protocol_options_append_tls_ciphersuite_group(
options: sec_protocol_options_t,
group: tls_ciphersuite_group_t,
);
}
unsafe { sec_protocol_options_append_tls_ciphersuite_group(options, group) }
}
#[doc(alias = "sec_protocol_options_add_tls_ciphersuite_group")]
#[cfg(feature = "CipherSuite")]
#[deprecated = "Use sec_protocol_options_append_tls_ciphersuite_group"]
#[inline]
pub unsafe fn add_tls_ciphersuite_group(
options: sec_protocol_options_t,
group: SSLCiphersuiteGroup,
) {
extern "C-unwind" {
fn sec_protocol_options_add_tls_ciphersuite_group(
options: sec_protocol_options_t,
group: SSLCiphersuiteGroup,
);
}
unsafe { sec_protocol_options_add_tls_ciphersuite_group(options, group) }
}
#[doc(alias = "sec_protocol_options_set_tls_min_version")]
#[cfg(feature = "SecProtocolTypes")]
#[deprecated]
#[inline]
pub unsafe fn set_tls_min_version(options: sec_protocol_options_t, version: SSLProtocol) {
extern "C-unwind" {
fn sec_protocol_options_set_tls_min_version(
options: sec_protocol_options_t,
version: SSLProtocol,
);
}
unsafe { sec_protocol_options_set_tls_min_version(options, version) }
}
#[doc(alias = "sec_protocol_options_set_min_tls_protocol_version")]
#[cfg(feature = "SecProtocolTypes")]
#[inline]
pub unsafe fn set_min_tls_protocol_version(
options: sec_protocol_options_t,
version: tls_protocol_version_t,
) {
extern "C-unwind" {
fn sec_protocol_options_set_min_tls_protocol_version(
options: sec_protocol_options_t,
version: tls_protocol_version_t,
);
}
unsafe { sec_protocol_options_set_min_tls_protocol_version(options, version) }
}
#[doc(alias = "sec_protocol_options_get_default_min_tls_protocol_version")]
#[cfg(feature = "SecProtocolTypes")]
#[inline]
pub unsafe fn default_min_tls_protocol_version() -> tls_protocol_version_t {
extern "C-unwind" {
fn sec_protocol_options_get_default_min_tls_protocol_version() -> tls_protocol_version_t;
}
unsafe { sec_protocol_options_get_default_min_tls_protocol_version() }
}
#[doc(alias = "sec_protocol_options_get_default_min_dtls_protocol_version")]
#[cfg(feature = "SecProtocolTypes")]
#[inline]
pub unsafe fn default_min_dtls_protocol_version() -> tls_protocol_version_t {
extern "C-unwind" {
fn sec_protocol_options_get_default_min_dtls_protocol_version() -> tls_protocol_version_t;
}
unsafe { sec_protocol_options_get_default_min_dtls_protocol_version() }
}
#[doc(alias = "sec_protocol_options_set_tls_max_version")]
#[cfg(feature = "SecProtocolTypes")]
#[deprecated]
#[inline]
pub unsafe fn set_tls_max_version(options: sec_protocol_options_t, version: SSLProtocol) {
extern "C-unwind" {
fn sec_protocol_options_set_tls_max_version(
options: sec_protocol_options_t,
version: SSLProtocol,
);
}
unsafe { sec_protocol_options_set_tls_max_version(options, version) }
}
#[doc(alias = "sec_protocol_options_set_max_tls_protocol_version")]
#[cfg(feature = "SecProtocolTypes")]
#[inline]
pub unsafe fn set_max_tls_protocol_version(
options: sec_protocol_options_t,
version: tls_protocol_version_t,
) {
extern "C-unwind" {
fn sec_protocol_options_set_max_tls_protocol_version(
options: sec_protocol_options_t,
version: tls_protocol_version_t,
);
}
unsafe { sec_protocol_options_set_max_tls_protocol_version(options, version) }
}
#[doc(alias = "sec_protocol_options_get_default_max_tls_protocol_version")]
#[cfg(feature = "SecProtocolTypes")]
#[inline]
pub unsafe fn default_max_tls_protocol_version() -> tls_protocol_version_t {
extern "C-unwind" {
fn sec_protocol_options_get_default_max_tls_protocol_version() -> tls_protocol_version_t;
}
unsafe { sec_protocol_options_get_default_max_tls_protocol_version() }
}
#[doc(alias = "sec_protocol_options_get_default_max_dtls_protocol_version")]
#[cfg(feature = "SecProtocolTypes")]
#[inline]
pub unsafe fn default_max_dtls_protocol_version() -> tls_protocol_version_t {
extern "C-unwind" {
fn sec_protocol_options_get_default_max_dtls_protocol_version() -> tls_protocol_version_t;
}
unsafe { sec_protocol_options_get_default_max_dtls_protocol_version() }
}
#[doc(alias = "sec_protocol_options_get_enable_encrypted_client_hello")]
#[inline]
pub unsafe fn enabled_encrypted_client_hello(options: sec_protocol_options_t) -> bool {
extern "C-unwind" {
fn sec_protocol_options_get_enable_encrypted_client_hello(
options: sec_protocol_options_t,
) -> bool;
}
unsafe { sec_protocol_options_get_enable_encrypted_client_hello(options) }
}
#[doc(alias = "sec_protocol_options_get_quic_use_legacy_codepoint")]
#[inline]
pub unsafe fn quic_use_legacy_codepoint(options: sec_protocol_options_t) -> bool {
extern "C-unwind" {
fn sec_protocol_options_get_quic_use_legacy_codepoint(
options: sec_protocol_options_t,
) -> bool;
}
unsafe { sec_protocol_options_get_quic_use_legacy_codepoint(options) }
}
#[doc(alias = "sec_protocol_options_add_tls_application_protocol")]
#[inline]
pub unsafe fn add_tls_application_protocol(
options: sec_protocol_options_t,
application_protocol: NonNull<c_char>,
) {
extern "C-unwind" {
fn sec_protocol_options_add_tls_application_protocol(
options: sec_protocol_options_t,
application_protocol: NonNull<c_char>,
);
}
unsafe { sec_protocol_options_add_tls_application_protocol(options, application_protocol) }
}
#[doc(alias = "sec_protocol_options_set_tls_server_name")]
#[inline]
pub unsafe fn set_tls_server_name(
options: sec_protocol_options_t,
server_name: NonNull<c_char>,
) {
extern "C-unwind" {
fn sec_protocol_options_set_tls_server_name(
options: sec_protocol_options_t,
server_name: NonNull<c_char>,
);
}
unsafe { sec_protocol_options_set_tls_server_name(options, server_name) }
}
#[doc(alias = "sec_protocol_options_set_tls_tickets_enabled")]
#[inline]
pub unsafe fn set_tls_tickets_enabled(options: sec_protocol_options_t, tickets_enabled: bool) {
extern "C-unwind" {
fn sec_protocol_options_set_tls_tickets_enabled(
options: sec_protocol_options_t,
tickets_enabled: bool,
);
}
unsafe { sec_protocol_options_set_tls_tickets_enabled(options, tickets_enabled) }
}
#[doc(alias = "sec_protocol_options_set_tls_is_fallback_attempt")]
#[inline]
pub unsafe fn set_tls_is_fallback_attempt(
options: sec_protocol_options_t,
is_fallback_attempt: bool,
) {
extern "C-unwind" {
fn sec_protocol_options_set_tls_is_fallback_attempt(
options: sec_protocol_options_t,
is_fallback_attempt: bool,
);
}
unsafe { sec_protocol_options_set_tls_is_fallback_attempt(options, is_fallback_attempt) }
}
#[doc(alias = "sec_protocol_options_set_tls_resumption_enabled")]
#[inline]
pub unsafe fn set_tls_resumption_enabled(
options: sec_protocol_options_t,
resumption_enabled: bool,
) {
extern "C-unwind" {
fn sec_protocol_options_set_tls_resumption_enabled(
options: sec_protocol_options_t,
resumption_enabled: bool,
);
}
unsafe { sec_protocol_options_set_tls_resumption_enabled(options, resumption_enabled) }
}
#[doc(alias = "sec_protocol_options_set_tls_false_start_enabled")]
#[inline]
pub unsafe fn set_tls_false_start_enabled(
options: sec_protocol_options_t,
false_start_enabled: bool,
) {
extern "C-unwind" {
fn sec_protocol_options_set_tls_false_start_enabled(
options: sec_protocol_options_t,
false_start_enabled: bool,
);
}
unsafe { sec_protocol_options_set_tls_false_start_enabled(options, false_start_enabled) }
}
#[doc(alias = "sec_protocol_options_set_tls_ocsp_enabled")]
#[inline]
pub unsafe fn set_tls_ocsp_enabled(options: sec_protocol_options_t, ocsp_enabled: bool) {
extern "C-unwind" {
fn sec_protocol_options_set_tls_ocsp_enabled(
options: sec_protocol_options_t,
ocsp_enabled: bool,
);
}
unsafe { sec_protocol_options_set_tls_ocsp_enabled(options, ocsp_enabled) }
}
#[doc(alias = "sec_protocol_options_set_tls_sct_enabled")]
#[inline]
pub unsafe fn set_tls_sct_enabled(options: sec_protocol_options_t, sct_enabled: bool) {
extern "C-unwind" {
fn sec_protocol_options_set_tls_sct_enabled(
options: sec_protocol_options_t,
sct_enabled: bool,
);
}
unsafe { sec_protocol_options_set_tls_sct_enabled(options, sct_enabled) }
}
#[doc(alias = "sec_protocol_options_set_tls_renegotiation_enabled")]
#[inline]
pub unsafe fn set_tls_renegotiation_enabled(
options: sec_protocol_options_t,
renegotiation_enabled: bool,
) {
extern "C-unwind" {
fn sec_protocol_options_set_tls_renegotiation_enabled(
options: sec_protocol_options_t,
renegotiation_enabled: bool,
);
}
unsafe {
sec_protocol_options_set_tls_renegotiation_enabled(options, renegotiation_enabled)
}
}
#[doc(alias = "sec_protocol_options_set_peer_authentication_required")]
#[inline]
pub unsafe fn set_peer_authentication_required(
options: sec_protocol_options_t,
peer_authentication_required: bool,
) {
extern "C-unwind" {
fn sec_protocol_options_set_peer_authentication_required(
options: sec_protocol_options_t,
peer_authentication_required: bool,
);
}
unsafe {
sec_protocol_options_set_peer_authentication_required(
options,
peer_authentication_required,
)
}
}
#[doc(alias = "sec_protocol_options_set_peer_authentication_optional")]
#[inline]
pub unsafe fn set_peer_authentication_optional(
options: sec_protocol_options_t,
peer_authentication_optional: bool,
) {
extern "C-unwind" {
fn sec_protocol_options_set_peer_authentication_optional(
options: sec_protocol_options_t,
peer_authentication_optional: bool,
);
}
unsafe {
sec_protocol_options_set_peer_authentication_optional(
options,
peer_authentication_optional,
)
}
}
#[doc(alias = "sec_protocol_options_set_enable_encrypted_client_hello")]
#[inline]
pub unsafe fn set_enable_encrypted_client_hello(
options: sec_protocol_options_t,
enable_encrypted_client_hello: bool,
) {
extern "C-unwind" {
fn sec_protocol_options_set_enable_encrypted_client_hello(
options: sec_protocol_options_t,
enable_encrypted_client_hello: bool,
);
}
unsafe {
sec_protocol_options_set_enable_encrypted_client_hello(
options,
enable_encrypted_client_hello,
)
}
}
#[doc(alias = "sec_protocol_options_set_quic_use_legacy_codepoint")]
#[inline]
pub unsafe fn set_quic_use_legacy_codepoint(
options: sec_protocol_options_t,
quic_use_legacy_codepoint: bool,
) {
extern "C-unwind" {
fn sec_protocol_options_set_quic_use_legacy_codepoint(
options: sec_protocol_options_t,
quic_use_legacy_codepoint: bool,
);
}
unsafe {
sec_protocol_options_set_quic_use_legacy_codepoint(options, quic_use_legacy_codepoint)
}
}
}
#[cfg(feature = "block2")]
pub type sec_protocol_key_update_complete_t = *mut block2::DynBlock<dyn Fn()>;
#[cfg(all(feature = "SecProtocolMetadata", feature = "block2"))]
pub type sec_protocol_key_update_t =
*mut block2::DynBlock<dyn Fn(sec_protocol_metadata_t, sec_protocol_key_update_complete_t)>;
#[cfg(all(feature = "SecProtocolTypes", feature = "block2"))]
pub type sec_protocol_challenge_complete_t = *mut block2::DynBlock<dyn Fn(sec_identity_t)>;
#[cfg(all(
feature = "SecProtocolMetadata",
feature = "SecProtocolTypes",
feature = "block2"
))]
pub type sec_protocol_challenge_t =
*mut block2::DynBlock<dyn Fn(sec_protocol_metadata_t, sec_protocol_challenge_complete_t)>;
#[cfg(feature = "block2")]
pub type sec_protocol_verify_complete_t = *mut block2::DynBlock<dyn Fn(bool)>;
#[cfg(all(
feature = "SecProtocolMetadata",
feature = "SecProtocolTypes",
feature = "block2"
))]
pub type sec_protocol_verify_t = *mut block2::DynBlock<
dyn Fn(sec_protocol_metadata_t, sec_trust_t, sec_protocol_verify_complete_t),
>;
extern "C-unwind" {
#[deprecated = "renamed to `sec_protocol_options::are_equal`"]
pub fn sec_protocol_options_are_equal(
options_a: sec_protocol_options_t,
options_b: sec_protocol_options_t,
) -> bool;
}
extern "C-unwind" {
#[cfg(feature = "SecProtocolTypes")]
#[deprecated = "renamed to `sec_protocol_options::set_local_identity`"]
pub fn sec_protocol_options_set_local_identity(
options: sec_protocol_options_t,
identity: sec_identity_t,
);
}
extern "C-unwind" {
#[cfg(feature = "SecProtocolTypes")]
#[deprecated = "renamed to `sec_protocol_options::append_tls_ciphersuite`"]
pub fn sec_protocol_options_append_tls_ciphersuite(
options: sec_protocol_options_t,
ciphersuite: tls_ciphersuite_t,
);
}
extern "C-unwind" {
#[cfg(feature = "CipherSuite")]
#[deprecated = "renamed to `sec_protocol_options::add_tls_ciphersuite`"]
pub fn sec_protocol_options_add_tls_ciphersuite(
options: sec_protocol_options_t,
ciphersuite: SSLCipherSuite,
);
}
extern "C-unwind" {
#[cfg(feature = "SecProtocolTypes")]
#[deprecated = "renamed to `sec_protocol_options::append_tls_ciphersuite_group`"]
pub fn sec_protocol_options_append_tls_ciphersuite_group(
options: sec_protocol_options_t,
group: tls_ciphersuite_group_t,
);
}
extern "C-unwind" {
#[cfg(feature = "CipherSuite")]
#[deprecated = "renamed to `sec_protocol_options::add_tls_ciphersuite_group`"]
pub fn sec_protocol_options_add_tls_ciphersuite_group(
options: sec_protocol_options_t,
group: SSLCiphersuiteGroup,
);
}
extern "C-unwind" {
#[cfg(feature = "SecProtocolTypes")]
#[deprecated = "renamed to `sec_protocol_options::set_tls_min_version`"]
pub fn sec_protocol_options_set_tls_min_version(
options: sec_protocol_options_t,
version: SSLProtocol,
);
}
extern "C-unwind" {
#[cfg(feature = "SecProtocolTypes")]
#[deprecated = "renamed to `sec_protocol_options::set_min_tls_protocol_version`"]
pub fn sec_protocol_options_set_min_tls_protocol_version(
options: sec_protocol_options_t,
version: tls_protocol_version_t,
);
}
extern "C-unwind" {
#[cfg(feature = "SecProtocolTypes")]
#[deprecated = "renamed to `sec_protocol_options::default_min_tls_protocol_version`"]
pub fn sec_protocol_options_get_default_min_tls_protocol_version() -> tls_protocol_version_t;
}
extern "C-unwind" {
#[cfg(feature = "SecProtocolTypes")]
#[deprecated = "renamed to `sec_protocol_options::default_min_dtls_protocol_version`"]
pub fn sec_protocol_options_get_default_min_dtls_protocol_version() -> tls_protocol_version_t;
}
extern "C-unwind" {
#[cfg(feature = "SecProtocolTypes")]
#[deprecated = "renamed to `sec_protocol_options::set_tls_max_version`"]
pub fn sec_protocol_options_set_tls_max_version(
options: sec_protocol_options_t,
version: SSLProtocol,
);
}
extern "C-unwind" {
#[cfg(feature = "SecProtocolTypes")]
#[deprecated = "renamed to `sec_protocol_options::set_max_tls_protocol_version`"]
pub fn sec_protocol_options_set_max_tls_protocol_version(
options: sec_protocol_options_t,
version: tls_protocol_version_t,
);
}
extern "C-unwind" {
#[cfg(feature = "SecProtocolTypes")]
#[deprecated = "renamed to `sec_protocol_options::default_max_tls_protocol_version`"]
pub fn sec_protocol_options_get_default_max_tls_protocol_version() -> tls_protocol_version_t;
}
extern "C-unwind" {
#[cfg(feature = "SecProtocolTypes")]
#[deprecated = "renamed to `sec_protocol_options::default_max_dtls_protocol_version`"]
pub fn sec_protocol_options_get_default_max_dtls_protocol_version() -> tls_protocol_version_t;
}
extern "C-unwind" {
#[deprecated = "renamed to `sec_protocol_options::enabled_encrypted_client_hello`"]
pub fn sec_protocol_options_get_enable_encrypted_client_hello(
options: sec_protocol_options_t,
) -> bool;
}
extern "C-unwind" {
#[deprecated = "renamed to `sec_protocol_options::quic_use_legacy_codepoint`"]
pub fn sec_protocol_options_get_quic_use_legacy_codepoint(
options: sec_protocol_options_t,
) -> bool;
}
extern "C-unwind" {
#[deprecated = "renamed to `sec_protocol_options::add_tls_application_protocol`"]
pub fn sec_protocol_options_add_tls_application_protocol(
options: sec_protocol_options_t,
application_protocol: NonNull<c_char>,
);
}
extern "C-unwind" {
#[deprecated = "renamed to `sec_protocol_options::set_tls_server_name`"]
pub fn sec_protocol_options_set_tls_server_name(
options: sec_protocol_options_t,
server_name: NonNull<c_char>,
);
}
extern "C-unwind" {
#[deprecated = "renamed to `sec_protocol_options::set_tls_tickets_enabled`"]
pub fn sec_protocol_options_set_tls_tickets_enabled(
options: sec_protocol_options_t,
tickets_enabled: bool,
);
}
extern "C-unwind" {
#[deprecated = "renamed to `sec_protocol_options::set_tls_is_fallback_attempt`"]
pub fn sec_protocol_options_set_tls_is_fallback_attempt(
options: sec_protocol_options_t,
is_fallback_attempt: bool,
);
}
extern "C-unwind" {
#[deprecated = "renamed to `sec_protocol_options::set_tls_resumption_enabled`"]
pub fn sec_protocol_options_set_tls_resumption_enabled(
options: sec_protocol_options_t,
resumption_enabled: bool,
);
}
extern "C-unwind" {
#[deprecated = "renamed to `sec_protocol_options::set_tls_false_start_enabled`"]
pub fn sec_protocol_options_set_tls_false_start_enabled(
options: sec_protocol_options_t,
false_start_enabled: bool,
);
}
extern "C-unwind" {
#[deprecated = "renamed to `sec_protocol_options::set_tls_ocsp_enabled`"]
pub fn sec_protocol_options_set_tls_ocsp_enabled(
options: sec_protocol_options_t,
ocsp_enabled: bool,
);
}
extern "C-unwind" {
#[deprecated = "renamed to `sec_protocol_options::set_tls_sct_enabled`"]
pub fn sec_protocol_options_set_tls_sct_enabled(
options: sec_protocol_options_t,
sct_enabled: bool,
);
}
extern "C-unwind" {
#[deprecated = "renamed to `sec_protocol_options::set_tls_renegotiation_enabled`"]
pub fn sec_protocol_options_set_tls_renegotiation_enabled(
options: sec_protocol_options_t,
renegotiation_enabled: bool,
);
}
extern "C-unwind" {
#[deprecated = "renamed to `sec_protocol_options::set_peer_authentication_required`"]
pub fn sec_protocol_options_set_peer_authentication_required(
options: sec_protocol_options_t,
peer_authentication_required: bool,
);
}
extern "C-unwind" {
#[deprecated = "renamed to `sec_protocol_options::set_peer_authentication_optional`"]
pub fn sec_protocol_options_set_peer_authentication_optional(
options: sec_protocol_options_t,
peer_authentication_optional: bool,
);
}
extern "C-unwind" {
#[deprecated = "renamed to `sec_protocol_options::set_enable_encrypted_client_hello`"]
pub fn sec_protocol_options_set_enable_encrypted_client_hello(
options: sec_protocol_options_t,
enable_encrypted_client_hello: bool,
);
}
extern "C-unwind" {
#[deprecated = "renamed to `sec_protocol_options::set_quic_use_legacy_codepoint`"]
pub fn sec_protocol_options_set_quic_use_legacy_codepoint(
options: sec_protocol_options_t,
quic_use_legacy_codepoint: bool,
);
}