Skip to content

Commit

Permalink
tls12/tls13: make hash_algorithm crate internal
Browse files Browse the repository at this point in the history
The `Tls12CipherSuite::hash_algorithm` and
`Tls13CipherSuite::hash_algorithm` functions were meant to be crate
internal, since their return type leaks the `ring::digest::Algorithm`
type. As written today these fns make updates to `*ring*` a breaking
change for the Rustls API.

This commit switches the visibility of both functions to be
crate-internal. Strictly speaking this is a breaking change, but we
don't expect there to be consumers of these functions and it unblocks
a *ring* update that would otherwise be breaking on its own.
  • Loading branch information
cpu committed Oct 24, 2023
1 parent fda92f4 commit 4797228
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion rustls/src/tls12/mod.rs
Expand Up @@ -171,7 +171,7 @@ impl Tls12CipherSuite {
}

/// Which hash function to use with this suite.
pub fn hash_algorithm(&self) -> &'static ring::digest::Algorithm {
pub(crate) fn hash_algorithm(&self) -> &'static ring::digest::Algorithm {
self.hmac_algorithm.digest_algorithm()
}
}
Expand Down
2 changes: 1 addition & 1 deletion rustls/src/tls13/mod.rs
Expand Up @@ -76,7 +76,7 @@ pub struct Tls13CipherSuite {

impl Tls13CipherSuite {
/// Which hash function to use with this suite.
pub fn hash_algorithm(&self) -> &'static ring::digest::Algorithm {
pub(crate) fn hash_algorithm(&self) -> &'static ring::digest::Algorithm {
self.hkdf_algorithm
.hmac_algorithm()
.digest_algorithm()
Expand Down

0 comments on commit 4797228

Please sign in to comment.