mirror of https://github.com/ctz/rustls
Rename `SignatureScheme::sign`
The old name doesn't really make sense for me.
This commit is contained in:
parent
c46cf7e6ca
commit
17e6c953a0
|
@ -882,11 +882,12 @@ impl State<ClientConnectionData> for ExpectServerDone<'_> {
|
|||
|
||||
// Check the signature is compatible with the ciphersuite.
|
||||
let sig = &st.server_kx.kx_sig;
|
||||
if !SupportedCipherSuite::from(suite).usable_for_signature_algorithm(sig.scheme.sign())
|
||||
if !SupportedCipherSuite::from(suite)
|
||||
.usable_for_signature_algorithm(sig.scheme.algorithm())
|
||||
{
|
||||
warn!(
|
||||
"peer signed kx with wrong algorithm (got {:?} expect {:?})",
|
||||
sig.scheme.sign(),
|
||||
sig.scheme.algorithm(),
|
||||
suite.sign
|
||||
);
|
||||
return Err(PeerMisbehaved::SignedKxWithWrongAlgorithm.into());
|
||||
|
|
|
@ -248,7 +248,7 @@ impl SigningKey for EcdsaSigningKey {
|
|||
}
|
||||
|
||||
fn algorithm(&self) -> SignatureAlgorithm {
|
||||
self.scheme.sign()
|
||||
self.scheme.algorithm()
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -332,7 +332,7 @@ impl SigningKey for Ed25519SigningKey {
|
|||
}
|
||||
|
||||
fn algorithm(&self) -> SignatureAlgorithm {
|
||||
self.scheme.sign()
|
||||
self.scheme.algorithm()
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -286,7 +286,7 @@ impl SigningKey for EcdsaSigningKey {
|
|||
}
|
||||
|
||||
fn algorithm(&self) -> SignatureAlgorithm {
|
||||
self.scheme.sign()
|
||||
self.scheme.algorithm()
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -370,7 +370,7 @@ impl SigningKey for Ed25519SigningKey {
|
|||
}
|
||||
|
||||
fn algorithm(&self) -> SignatureAlgorithm {
|
||||
self.scheme.sign()
|
||||
self.scheme.algorithm()
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -513,7 +513,7 @@ enum_builder! {
|
|||
}
|
||||
|
||||
impl SignatureScheme {
|
||||
pub(crate) fn sign(&self) -> SignatureAlgorithm {
|
||||
pub(crate) fn algorithm(&self) -> SignatureAlgorithm {
|
||||
match *self {
|
||||
Self::RSA_PKCS1_SHA1
|
||||
| Self::RSA_PKCS1_SHA256
|
||||
|
|
|
@ -101,7 +101,7 @@ impl SupportedCipherSuite {
|
|||
Self::Tls12(inner) => inner
|
||||
.sign
|
||||
.iter()
|
||||
.any(|scheme| scheme.sign() == _sig_alg),
|
||||
.any(|scheme| scheme.algorithm() == _sig_alg),
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -164,7 +164,7 @@ pub(crate) fn compatible_sigscheme_for_suites(
|
|||
sigscheme: SignatureScheme,
|
||||
common_suites: &[SupportedCipherSuite],
|
||||
) -> bool {
|
||||
let sigalg = sigscheme.sign();
|
||||
let sigalg = sigscheme.algorithm();
|
||||
common_suites
|
||||
.iter()
|
||||
.any(|&suite| suite.usable_for_signature_algorithm(sigalg))
|
||||
|
|
Loading…
Reference in New Issue