Просмотр исходного кода

net/transport/tls | crypto/constants : Match the order of impl members with the trait

nighthawk24 2 лет назад
Родитель
Сommit
3d4bd17a2e
2 измененных файлов с 11 добавлено и 11 удалено
  1. 10 10
      src/net/transport/tls.rs
  2. 1 1
      src/sdk/src/crypto/constants/fixed_bases.rs

+ 10 - 10
src/net/transport/tls.rs

@@ -71,10 +71,6 @@ fn validate_dnsname(cert: &X509Certificate) -> std::result::Result<(), rustls::E
 #[derive(Debug)]
 struct ServerCertificateVerifier;
 impl ServerCertVerifier for ServerCertificateVerifier {
-    fn supported_verify_schemes(&self) -> Vec<SignatureScheme> {
-        vec![SignatureScheme::ED25519]
-    }
-
     fn verify_server_cert(
         &self,
         end_entity: &CertificateDer,
@@ -151,20 +147,20 @@ impl ServerCertVerifier for ServerCertificateVerifier {
 
         Ok(HandshakeSignatureValid::assertion())
     }
-}
 
-#[derive(Debug)]
-struct ClientCertificateVerifier;
-impl ClientCertVerifier for ClientCertificateVerifier {
     fn supported_verify_schemes(&self) -> Vec<SignatureScheme> {
         vec![SignatureScheme::ED25519]
     }
+}
 
-    fn client_auth_mandatory(&self) -> bool {
+#[derive(Debug)]
+struct ClientCertificateVerifier;
+impl ClientCertVerifier for ClientCertificateVerifier {
+    fn offer_client_auth(&self) -> bool {
         true
     }
 
-    fn offer_client_auth(&self) -> bool {
+    fn client_auth_mandatory(&self) -> bool {
         true
     }
 
@@ -246,6 +242,10 @@ impl ClientCertVerifier for ClientCertificateVerifier {
 
         Ok(HandshakeSignatureValid::assertion())
     }
+
+    fn supported_verify_schemes(&self) -> Vec<SignatureScheme> {
+        vec![SignatureScheme::ED25519]
+    }
 }
 
 pub struct TlsUpgrade {

+ 1 - 1
src/sdk/src/crypto/constants/fixed_bases.rs

@@ -133,8 +133,8 @@ impl ConstBaseFieldElement {
 
 impl FixedPoints<pallas::Affine> for OrchardFixedBases {
     type FullScalar = OrchardFixedBasesFull;
-    type Base = ConstBaseFieldElement;
     type ShortScalar = ValueCommitV;
+    type Base = ConstBaseFieldElement;
 }
 
 impl FixedPoint<pallas::Affine> for OrchardFixedBasesFull {