Skip to content

Commit

Permalink
feat(pkarr): instrument TLS server certificate verifier
Browse files Browse the repository at this point in the history
  • Loading branch information
Nuhvi committed Nov 26, 2024
1 parent d4555c7 commit 6d6e35e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkarr/src/extra/tls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ use rustls::{
pki_types::SubjectPublicKeyInfoDer,
CertificateError, SignatureScheme,
};
use tracing::{instrument, Level};

use crate::Client;

Expand All @@ -21,6 +22,7 @@ static SUPPORTED_ALGORITHMS: WebPkiSupportedAlgorithms = WebPkiSupportedAlgorith
};

impl<T: EndpointsResolver + Send + Sync + Debug + Clone> ServerCertVerifier for CertVerifier<T> {
#[instrument(ret(level = Level::DEBUG), err(level = Level::DEBUG))]
/// Verify Pkarr public keys
fn verify_server_cert(
&self,
Expand Down Expand Up @@ -66,6 +68,7 @@ impl<T: EndpointsResolver + Send + Sync + Debug + Clone> ServerCertVerifier for
))
}

#[instrument(ret(level = Level::DEBUG), err(level = Level::DEBUG))]
/// Verify a message signature using a raw public key and the first TLS 1.3 compatible
/// supported scheme.
fn verify_tls12_signature(
Expand All @@ -82,6 +85,7 @@ impl<T: EndpointsResolver + Send + Sync + Debug + Clone> ServerCertVerifier for
)
}

#[instrument(ret(level = Level::DEBUG), err(level = Level::DEBUG))]
/// Verify a message signature using a raw public key and the first TLS 1.3 compatible
/// supported scheme.
fn verify_tls13_signature(
Expand Down

0 comments on commit 6d6e35e

Please sign in to comment.