Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions rustls-platform-verifier/src/verification/android.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ impl Drop for Verifier {
impl Verifier {
/// Creates a new instance of a TLS certificate verifier that utilizes the
/// Android certificate facilities.
#[cfg_attr(docsrs, doc(cfg(all())))]
pub fn new(crypto_provider: Arc<CryptoProvider>) -> Result<Self, TlsError> {
Ok(Self {
#[cfg(any(test, feature = "ffi-testing"))]
Expand Down Expand Up @@ -268,6 +269,7 @@ fn extract_result_info(
(status, msg)
}

#[cfg_attr(docsrs, doc(cfg(all())))]
impl ServerCertVerifier for Verifier {
fn verify_server_cert(
&self,
Expand Down
3 changes: 3 additions & 0 deletions rustls-platform-verifier/src/verification/apple.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ pub struct Verifier {
impl Verifier {
/// Creates a new instance of a TLS certificate verifier that utilizes the Apple certificate
/// facilities.
#[cfg_attr(docsrs, doc(cfg(all())))]
pub fn new(crypto_provider: Arc<CryptoProvider>) -> Result<Self, TlsError> {
Ok(Self {
extra_roots: Vec::new(),
Expand All @@ -68,6 +69,7 @@ impl Verifier {
/// facilities with the addition of extra root certificates to trust.
///
/// See [Verifier::new] for the external requirements the verifier needs.
#[cfg_attr(docsrs, doc(cfg(not(target_os = "android"))))]
pub fn new_with_extra_roots(
roots: impl IntoIterator<Item = pki_types::CertificateDer<'static>>,
crypto_provider: Arc<CryptoProvider>,
Expand Down Expand Up @@ -240,6 +242,7 @@ impl Verifier {
}
}

#[cfg_attr(docsrs, doc(cfg(all())))]
impl ServerCertVerifier for Verifier {
fn verify_server_cert(
&self,
Expand Down
3 changes: 3 additions & 0 deletions rustls-platform-verifier/src/verification/others.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,15 @@ pub struct Verifier {
impl Verifier {
/// Creates a new verifier whose certificate validation is provided by
/// WebPKI, using root certificates provided by the platform.
#[cfg_attr(docsrs, doc(cfg(all())))]
pub fn new(crypto_provider: Arc<CryptoProvider>) -> Result<Self, TlsError> {
Self::new_inner([], None, crypto_provider)
}

/// Creates a new verifier whose certificate validation is provided by
/// WebPKI, using root certificates provided by the platform and augmented by
/// the provided extra root certificates.
#[cfg_attr(docsrs, doc(cfg(not(target_os = "android"))))]
pub fn new_with_extra_roots(
extra_roots: impl IntoIterator<Item = pki_types::CertificateDer<'static>>,
crypto_provider: Arc<CryptoProvider>,
Expand Down Expand Up @@ -130,6 +132,7 @@ impl Verifier {
}
}

#[cfg_attr(docsrs, doc(cfg(all())))]
impl ServerCertVerifier for Verifier {
fn verify_server_cert(
&self,
Expand Down
3 changes: 3 additions & 0 deletions rustls-platform-verifier/src/verification/windows.rs
Original file line number Diff line number Diff line change
Expand Up @@ -522,6 +522,7 @@ pub struct Verifier {
impl Verifier {
/// Creates a new instance of a TLS certificate verifier that utilizes the
/// Windows certificate facilities.
#[cfg_attr(docsrs, doc(cfg(all())))]
pub fn new(crypto_provider: Arc<CryptoProvider>) -> Result<Self, TlsError> {
Ok(Self {
#[cfg(any(test, feature = "ffi-testing", feature = "dbg"))]
Expand All @@ -533,6 +534,7 @@ impl Verifier {

/// Creates a new instance of a TLS certificate verifier that utilizes the
/// Windows certificate facilities and augmented by the provided extra root certificates.
#[cfg_attr(docsrs, doc(cfg(not(target_os = "android"))))]
pub fn new_with_extra_roots(
roots: impl IntoIterator<Item = pki_types::CertificateDer<'static>>,
crypto_provider: Arc<CryptoProvider>,
Expand Down Expand Up @@ -660,6 +662,7 @@ impl Verifier {
}
}

#[cfg_attr(docsrs, doc(cfg(all())))]
impl ServerCertVerifier for Verifier {
fn verify_server_cert(
&self,
Expand Down
Loading