@@ -85,8 +85,8 @@ pub struct NoiseConfig {
85
85
impl ClientConfig for NoiseConfig {
86
86
fn start_session (
87
87
self : Arc < Self > ,
88
- version : u32 ,
89
- server_name : & str ,
88
+ _version : u32 ,
89
+ _server_name : & str ,
90
90
params : & TransportParameters ,
91
91
) -> Result < Box < dyn Session > , ConnectError > {
92
92
Ok ( Box :: new ( NoiseConfig :: start_session (
@@ -100,17 +100,17 @@ impl ClientConfig for NoiseConfig {
100
100
impl ServerConfig for NoiseConfig {
101
101
fn start_session (
102
102
self : Arc < Self > ,
103
- version : u32 ,
103
+ _version : u32 ,
104
104
params : & TransportParameters ,
105
105
) -> Box < dyn Session > {
106
106
Box :: new ( NoiseConfig :: start_session ( & self , Side :: Server , params) )
107
107
}
108
108
109
109
fn initial_keys (
110
110
& self ,
111
- version : u32 ,
112
- dst_cid : & ConnectionId ,
113
- side : Side ,
111
+ _version : u32 ,
112
+ _dst_cid : & ConnectionId ,
113
+ _side : Side ,
114
114
) -> Result < Keys , quinn_proto:: crypto:: UnsupportedVersion > {
115
115
Ok ( Keys {
116
116
header : header_keypair ( ) ,
@@ -121,7 +121,7 @@ impl ServerConfig for NoiseConfig {
121
121
} )
122
122
}
123
123
124
- fn retry_tag ( & self , version : u32 , orig_dst_cid : & ConnectionId , packet : & [ u8 ] ) -> [ u8 ; 16 ] {
124
+ fn retry_tag ( & self , _version : u32 , orig_dst_cid : & ConnectionId , packet : & [ u8 ] ) -> [ u8 ; 16 ] {
125
125
let mut pseudo_packet = Vec :: with_capacity ( packet. len ( ) + orig_dst_cid. len ( ) + 1 ) ;
126
126
pseudo_packet. push ( orig_dst_cid. len ( ) as u8 ) ;
127
127
pseudo_packet. extend_from_slice ( orig_dst_cid) ;
@@ -318,7 +318,7 @@ impl Session for NoiseSession {
318
318
}
319
319
let ( remote_s, rest) = rest. split_at ( 32 ) ;
320
320
let mut s = [ 0 ; 32 ] ;
321
- self . xoodyak . decrypt ( & remote_s, & mut s) ;
321
+ self . xoodyak . decrypt ( remote_s, & mut s) ;
322
322
let s = PublicKey :: from_bytes ( & s)
323
323
. map_err ( |_| connection_refused ( "invalid static public key" ) ) ?;
324
324
self . remote_s = Some ( s) ;
@@ -343,9 +343,8 @@ impl Session for NoiseSession {
343
343
. supported_protocols
344
344
. as_ref ( )
345
345
. expect ( "invalid config" )
346
- . into_iter ( )
347
- . find ( |proto| proto. as_slice ( ) == alpn)
348
- . is_some ( ) ;
346
+ . iter ( )
347
+ . any ( |proto| proto. as_slice ( ) == alpn) ;
349
348
if !is_supported {
350
349
return Err ( connection_refused ( "unsupported alpn" ) ) ;
351
350
}
@@ -356,11 +355,11 @@ impl Session for NoiseSession {
356
355
}
357
356
let ( params, auth) = rest. split_at ( rest. len ( ) - 16 ) ;
358
357
let mut transport_parameters = vec ! [ 0 ; params. len( ) ] ;
359
- self . xoodyak . decrypt ( & params, & mut transport_parameters) ;
358
+ self . xoodyak . decrypt ( params, & mut transport_parameters) ;
360
359
// check tag
361
360
let mut tag = [ 0 ; 16 ] ;
362
361
self . xoodyak . squeeze ( & mut tag) ;
363
- if !bool:: from ( tag. ct_eq ( & auth) ) {
362
+ if !bool:: from ( tag. ct_eq ( auth) ) {
364
363
return Err ( connection_refused ( "invalid authentication tag" ) ) ;
365
364
}
366
365
self . remote_transport_parameters = Some ( TransportParameters :: read (
@@ -377,7 +376,7 @@ impl Session for NoiseSession {
377
376
}
378
377
let ( remote_e, rest) = handshake. split_at ( 32 ) ;
379
378
let mut e = [ 0 ; 32 ] ;
380
- self . xoodyak . decrypt ( & remote_e, & mut e) ;
379
+ self . xoodyak . decrypt ( remote_e, & mut e) ;
381
380
let e = PublicKey :: from_bytes ( & e)
382
381
. map_err ( |_| connection_refused ( "invalid ephemeral public key" ) ) ?;
383
382
self . remote_e = Some ( e) ;
@@ -393,11 +392,11 @@ impl Session for NoiseSession {
393
392
}
394
393
let ( params, auth) = rest. split_at ( rest. len ( ) - 16 ) ;
395
394
let mut transport_parameters = vec ! [ 0 ; params. len( ) ] ;
396
- self . xoodyak . decrypt ( & params, & mut transport_parameters) ;
395
+ self . xoodyak . decrypt ( params, & mut transport_parameters) ;
397
396
// check tag
398
397
let mut tag = [ 0 ; 16 ] ;
399
398
self . xoodyak . squeeze ( & mut tag) ;
400
- if !bool:: from ( tag. ct_eq ( & auth) ) {
399
+ if !bool:: from ( tag. ct_eq ( auth) ) {
401
400
return Err ( connection_refused ( "invalid authentication tag" ) ) ;
402
401
}
403
402
self . remote_transport_parameters = Some ( TransportParameters :: read (
0 commit comments