Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: fix typos #5052

Merged
merged 1 commit into from
Jan 22, 2025
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
8 changes: 4 additions & 4 deletions bindings/rust/extended/s2n-tls/src/cert_chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,15 +120,15 @@ impl Builder {

/// Return an immutable, internally-reference counted CertificateChain.
pub fn build(self) -> Result<CertificateChain<'static>, Error> {
// This method is currently infalliable, but returning a result allows
// This method is currently infallible, but returning a result allows
// us to add validation in the future.
Ok(self.cert)
}
}

/// A CertificateChain represents a chain of X.509 certificates.
///
/// Certificate chains are internally reference counted and are cheaply cloneable.
/// Certificate chains are internally reference counted and are cheaply clone-able.
//
// SAFETY: it is important that no CertificateChain methods operate on mutable
// references. Because CertificateChains can be shared across threads, it is not
Expand Down Expand Up @@ -179,7 +179,7 @@ impl CertificateChain<'_> {

/// Return the length of this certificate chain.
///
/// Note that the underyling API currently traverses a linked list, so this is a relatively
/// Note that the underlying API currently traverses a linked list, so this is a relatively
/// expensive API to call.
///
/// Corresponds to [s2n_cert_chain_get_length].
Expand All @@ -196,7 +196,7 @@ impl CertificateChain<'_> {

/// Check if the certificate chain has any certificates.
///
/// Note that the underyling API currently traverses a linked list, so this is a relatively
/// Note that the underlying API currently traverses a linked list, so this is a relatively
/// expensive API to call.
pub fn is_empty(&self) -> bool {
self.len() == 0
Expand Down
4 changes: 2 additions & 2 deletions bindings/rust/extended/s2n-tls/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ impl Builder {
/// can be loaded.
///
/// For more advanced cert use cases such as sharing certs across configs or
/// serving differents certs based on the client SNI, see [Builder::load_chain].
/// serving different certs based on the client SNI, see [Builder::load_chain].
///
/// Corresponds to [s2n_config_add_cert_chain_and_key].
pub fn load_pem(&mut self, certificate: &[u8], private_key: &[u8]) -> Result<&mut Self, Error> {
Expand All @@ -320,7 +320,7 @@ impl Builder {

/// Corresponds to [s2n_config_add_cert_chain_and_key_to_store].
pub fn load_chain(&mut self, chain: CertificateChain<'static>) -> Result<&mut Self, Error> {
// Out of an abudance of caution, we hold a reference to the CertificateChain
// Out of an abundance of caution, we hold a reference to the CertificateChain
// regardless of whether add_to_store fails or succeeds. We have limited
// visibility into the failure modes, so this behavior ensures that _if_
// the C library held the reference despite the failure, it would continue
Expand Down
10 changes: 5 additions & 5 deletions bindings/rust/extended/s2n-tls/src/connection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,7 @@ impl Connection {
Ok(self)
}

/// Connections prefering low latency will be encrypted using small record sizes that
/// Connections preferring low latency will be encrypted using small record sizes that
/// can be decrypted sooner by the recipient.
///
/// Corresponds to [s2n_connection_prefer_low_latency].
Expand All @@ -475,7 +475,7 @@ impl Connection {
Ok(self)
}

/// Connections prefering throughput will use large record sizes that minimize overhead.
/// Connections preferring throughput will use large record sizes that minimize overhead.
///
/// Corresponds to [s2n_connection_prefer_throughput].
pub fn prefer_throughput(&mut self) -> Result<&mut Self, Error> {
Expand Down Expand Up @@ -672,7 +672,7 @@ impl Connection {
/// 0 bytes returned indicates EOF due to connection closure.
///
/// Safety: this function is always safe to call, and additionally:
/// 1. It will never deinitialize any bytes in `buf`.
/// 1. It will never uninitialize any bytes in `buf`.
/// 2. If it returns `Ok(n)`, then the first `n` bytes of `buf`
/// will have been initialized by this function.
///
Expand Down Expand Up @@ -737,7 +737,7 @@ impl Connection {

/// Attempts a graceful shutdown of the write side of a TLS connection.
///
/// Unlike Self::poll_shutdown, no reponse from the peer is necessary.
/// Unlike Self::poll_shutdown, no response from the peer is necessary.
/// If using TLS1.3, the connection can continue to be used for reading afterwards.
///
/// Corresponds to [s2n_shutdown_send].
Expand Down Expand Up @@ -834,7 +834,7 @@ impl Connection {

if let Some(waker) = waker {
if let Some(prev_waker) = ctx.waker.as_mut() {
// only replace the Waker if they dont reference the same task
// only replace the Waker if they don't reference the same task
if !prev_waker.will_wake(waker) {
prev_waker.clone_from(waker);
}
Expand Down
2 changes: 1 addition & 1 deletion bindings/rust/extended/s2n-tls/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ impl Error {
Self(Context::Application(error))
}

/// An error occured while running bindings code.
/// An error occurred while running bindings code.
pub(crate) const fn bindings(
kind: ErrorType,
name: &'static str,
Expand Down
2 changes: 1 addition & 1 deletion bindings/rust/extended/s2n-tls/src/fingerprint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ impl Drop for Fingerprint<'_> {
///
/// The `Builder` can build a new [Fingerprint] as soon as the old [Fingerprint]
/// goes out of scope. The [Fingerprint] implementation of [`Self::drop()`] ensures that this
/// is safe by reseting the underlying C structure.
/// is safe by resetting the underlying C structure.
///
/// See the below example:
/// ```no_run
Expand Down
2 changes: 1 addition & 1 deletion bindings/rust/extended/s2n-tls/src/pool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ mod tests {
#[test]
fn non_generic_pool() -> Result<(), Box<dyn std::error::Error>> {
let config_pool = ConfigPoolBuilder::new(Mode::Server, Config::default()).build();
// Note the unweildy type parameters on PooledConnection here.
// Note the unwieldy type parameters on PooledConnection here.
let _: PooledConnection<ConfigPoolRef> = PooledConnection::new(&config_pool)?;
// To avoid specifying the generic type parameters on PooledConnection,
// the pool can be converted to an Arc<dyn Pool>.
Expand Down
2 changes: 1 addition & 1 deletion bindings/rust/extended/s2n-tls/src/renegotiate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -748,7 +748,7 @@ mod tests {
pair.handshake().expect("Initial handshake");
pair.send_renegotiate_request()
.expect("Server sends request");
// s2n-tls doesn't fail when it rejects renegotiatation, it just sends
// s2n-tls doesn't fail when it rejects renegotiation, it just sends
// a warning alert. The peer chooses how to handle that alert.
// The openssl server receives the alert on its next read.
// Openssl considers the alert an error.
Expand Down
2 changes: 1 addition & 1 deletion bindings/rust/extended/s2n-tls/src/testing/s2n_tls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ mod tests {
}

#[test]
fn connnection_waker() {
fn connection_waker() {
let config = build_config(&security::DEFAULT_TLS13).unwrap();
assert_eq!(config.test_get_refcount().unwrap(), 1);

Expand Down
Loading