/* automatically generated by rust-bindgen 0.69.5 */


// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0


#![allow(unused_imports, non_camel_case_types)]

use libc::{iovec, FILE, off_t};
// specify that aws-lc-rs is used, so that the rust compiler will link in the appropriate
// libcrypto artifact.
#[cfg(not(s2n_tls_external_build))]
extern crate aws_lc_rs as _;

use crate::api::*;


#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct s2n_certificate_request {
    _unused: [u8; 0],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct s2n_certificate_authority_list {
    _unused: [u8; 0],
}
extern "C" {
    #[doc = " Get the certificate_authorities list from the certificate request.\n\n @returns The list, with a lifetime equivalent to the s2n_certificate_request.\n This points into the certificate request (it is not a copy of the list).\n Can be null if the list is not available."]
    pub fn s2n_certificate_request_get_ca_list(
        request: *mut s2n_certificate_request,
    ) -> *mut s2n_certificate_authority_list;
}
extern "C" {
    #[doc = " Sets the certificate chain to return in response to the certificate request.\n\n @param chain must outlive the connection being served.\n\n @warning It is not recommended to free or modify the `chain`. It must\n outlive this connection.\n\n @returns S2N_SUCCESS on success. S2N_FAILURE on failure"]
    pub fn s2n_certificate_request_set_certificate(
        request: *mut s2n_certificate_request,
        chain: *mut s2n_cert_chain_and_key,
    ) -> ::libc::c_int;
}
extern "C" {
    #[doc = " Checks whether the offered list has a next entry.\n\n @param list A pointer to the certificate authority list being read.\n @returns bool If true, there is a next entry."]
    pub fn s2n_certificate_authority_list_has_next(
        list: *mut s2n_certificate_authority_list,
    ) -> bool;
}
extern "C" {
    #[doc = " Obtains the next entry in the certificate authority list.\n\n The lifetime of the name is bound to the lifetime of the list (in other\n words, it must not be used past the certificate request callback).\n\n The name contains the bytes sent by the server. This should be a DER-encoded\n DistinguishedName, but s2n-tls does not currently strictly enforce the\n contents of the parsed name.\n\n See https://tools.ietf.org/rfc/rfc8446#section-4.2.4.\n\n @param list A pointer to the list being read.\n @param name An out-pointer to the next name in the list.\n @param length An out-pointer which is initialized to the length of the next name.\n\n @returns S2N_SUCCESS on success. S2N_FAILURE on failure"]
    pub fn s2n_certificate_authority_list_next(
        list: *mut s2n_certificate_authority_list,
        name: *mut *mut u8,
        length: *mut u16,
    ) -> ::libc::c_int;
}
extern "C" {
    #[doc = " Returns the certificate authority list to its original state.\n\n When `s2n_certificate_authority_list_reread` is called, the list is reset to the beginning.\n\n @param list The list to re-read."]
    pub fn s2n_certificate_authority_list_reread(
        list: *mut s2n_certificate_authority_list,
    ) -> ::libc::c_int;
}
pub type s2n_cert_request_callback = ::core::option::Option<
    unsafe extern "C" fn(
        conn: *mut s2n_connection,
        ctx: *mut ::libc::c_void,
        request: *mut s2n_certificate_request,
    ) -> ::libc::c_int,
>;
extern "C" {
    pub fn s2n_config_set_cert_request_callback(
        config: *mut s2n_config,
        cert_req_callback: s2n_cert_request_callback,
        ctx: *mut ::libc::c_void,
    ) -> ::libc::c_int;
}
