client_hello does not need to be a reference

This commit is contained in:
Jerome Gravel-Niquet 2019-09-14 17:29:22 -04:00 committed by ctz
parent 5bfd6d13f1
commit dbcc42f8d0
4 changed files with 7 additions and 7 deletions

View File

@ -96,7 +96,7 @@ pub struct FailResolveChain {}
impl server::ResolvesServerCert for FailResolveChain {
fn resolve(&self,
_client_hello: &ClientHello)
_client_hello: ClientHello)
-> Option<sign::CertifiedKey> {
None
}
@ -136,7 +136,7 @@ impl AlwaysResolvesChain {
impl server::ResolvesServerCert for AlwaysResolvesChain {
fn resolve(&self,
_client_hello: &ClientHello)
_client_hello: ClientHello)
-> Option<sign::CertifiedKey> {
Some(self.0.clone())
}
@ -170,7 +170,7 @@ impl ResolvesServerCertUsingSNI {
}
impl server::ResolvesServerCert for ResolvesServerCertUsingSNI {
fn resolve(&self, client_hello: &ClientHello)
fn resolve(&self, client_hello: ClientHello)
-> Option<sign::CertifiedKey> {
if let Some(name) = client_hello.server_name() {
self.by_name.get(name.into())

View File

@ -618,7 +618,7 @@ impl State for ExpectClientHello {
let client_hello = ClientHello::new(sni_ref, &sigschemes_ext, alpn_slices);
let certkey = sess.config.cert_resolver.resolve(&client_hello);
let certkey = sess.config.cert_resolver.resolve(client_hello);
certkey.ok_or_else(|| {
sess.common.send_fatal_alert(AlertDescription::AccessDenied);
TLSError::General("no server certificate chain resolved".to_string())

View File

@ -113,7 +113,7 @@ pub trait ResolvesServerCert : Send + Sync {
///
/// Return `None` to abort the handshake.
fn resolve(&self,
client_hello: &ClientHello)
client_hello: ClientHello)
-> Option<sign::CertifiedKey>;
}

View File

@ -320,7 +320,7 @@ struct ServerCheckCertResolve {
impl ResolvesServerCert for ServerCheckCertResolve {
fn resolve(&self,
client_hello: &ClientHello)
client_hello: ClientHello)
-> Option<sign::CertifiedKey> {
if client_hello.sigschemes().len() == 0 {
panic!("no signature schemes shared by client");
@ -442,7 +442,7 @@ struct ServerCheckNoSNI {}
impl ResolvesServerCert for ServerCheckNoSNI {
fn resolve(&self,
client_hello: &ClientHello)
client_hello: ClientHello)
-> Option<sign::CertifiedKey> {
assert!(client_hello.server_name().is_none());