Skip to content

Commit

Permalink
docs: iff => if and only if
Browse files Browse the repository at this point in the history
  • Loading branch information
Borber authored and ctz committed Jun 20, 2024
1 parent 9dfbc8e commit d53e071
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion rustls/src/client/hs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -621,7 +621,7 @@ pub(super) fn process_alpn_protocol(
// RFC 9001 says: "While ALPN only specifies that servers use this alert, QUIC clients MUST
// use error 0x0178 to terminate a connection when ALPN negotiation fails." We judge that
// the user intended to use ALPN (rather than some out-of-band protocol negotiation
// mechanism) iff any ALPN protocols were configured. This defends against badly-behaved
// mechanism) if and only if any ALPN protocols were configured. This defends against badly-behaved
// servers which accept a connection that requires an application-layer protocol they do not
// understand.
if common.is_quic() && common.alpn_protocol.is_none() && !config.alpn_protocols.is_empty() {
Expand Down
2 changes: 1 addition & 1 deletion rustls/src/crypto/ring/kx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ struct KxGroup {

/// Whether the algorithm is allowed by FIPS
///
/// `SupportedKxGroup::fips()` is true iff the algorithm is allowed,
/// `SupportedKxGroup::fips()` is true if and only if the algorithm is allowed,
/// _and_ the implementation is FIPS-validated.
fips_allowed: bool,
}
Expand Down
2 changes: 1 addition & 1 deletion rustls/src/quic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -680,7 +680,7 @@ pub trait PacketKey: Send + Sync {
/// the additional authenticated data; and the `payload`. The authentication tag is returned if
/// encryption succeeds.
///
/// Fails iff the payload is longer than allowed by the cipher suite's AEAD algorithm.
/// Fails if and only if the payload is longer than allowed by the cipher suite's AEAD algorithm.
fn encrypt_in_place(
&self,
packet_number: u64,
Expand Down
2 changes: 1 addition & 1 deletion rustls/src/server/hs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ impl ExtensionProcessing {
// QUIC has strict ALPN, unlike TLS's more backwards-compatible behavior. RFC 9001
// says: "The server MUST treat the inability to select a compatible application
// protocol as a connection error of type 0x0178". We judge that ALPN was desired
// (rather than some out-of-band protocol negotiation mechanism) iff any ALPN
// (rather than some out-of-band protocol negotiation mechanism) if and only if any ALPN
// protocols were configured locally or offered by the client. This helps prevent
// successful establishment of connections between peers that can't understand
// each other.
Expand Down
2 changes: 1 addition & 1 deletion rustls/src/server/server_conn.rs
Original file line number Diff line number Diff line change
Expand Up @@ -595,7 +595,7 @@ mod connection {
///
/// Recovered from the prior session's `set_resumption_data`. Integrity is guaranteed by rustls.
///
/// Returns `Some` iff a valid resumption ticket has been received from the client.
/// Returns `Some` if and only if a valid resumption ticket has been received from the client.
pub fn received_resumption_data(&self) -> Option<&[u8]> {
self.inner
.core
Expand Down

0 comments on commit d53e071

Please sign in to comment.