@@ -179,7 +179,7 @@ fn pre_shared_key(algs: &Algorithms, session_ticket: &Bytes) -> Result<(Bytes, u
179
179
let binders_len = binders. len ( ) ;
180
180
let ext = bytes2 ( 0 , 41 ) . concat ( encode_length_u16 ( identities. concat ( binders) ) ?) ;
181
181
let ext_len = ext. len ( ) ;
182
- Ok ( ( ext, ext_len+ binders_len+ 199 - 16 - 82 ) )
182
+ Ok ( ( ext, ext_len + binders_len + 199 - 16 - 82 ) )
183
183
}
184
184
185
185
fn check_psk_shared_key ( algs : & Algorithms , ch : & [ U8 ] ) -> Result < ( Bytes , Bytes ) , TLSError > {
@@ -191,7 +191,7 @@ fn check_psk_shared_key(algs: &Algorithms, ch: &[U8]) -> Result<(Bytes, Bytes),
191
191
if ch. len ( ) - 5 - len_id != algs. hash ( ) . hash_len ( ) {
192
192
tlserr ( parse_failed ( ) )
193
193
} else {
194
- Ok ( ( Bytes :: from ( & ch[ 4 ..4 + len_tkt] ) , Bytes :: from ( [ 0 ; 0 ] ) ) )
194
+ Ok ( ( Bytes :: from ( & ch[ 4 ..4 + len_tkt] ) , Bytes :: from ( [ 0 ; 0 ] ) ) )
195
195
}
196
196
} else {
197
197
tlserr ( parse_failed ( ) )
@@ -291,13 +291,16 @@ fn check_extension(algs: &Algorithms, bytes: &[U8]) -> Result<(usize, Extensions
291
291
Err ( _) => tlserr ( MISSING_KEY_SHARE ) ,
292
292
} ,
293
293
( 0 , 41 ) => {
294
- let ( tkt, binder) = check_psk_shared_key ( algs, & bytes[ 4 ..4 + len] ) ?;
295
- Ok ( ( 4 + len, Extensions {
296
- sni : None ,
297
- key_share : None ,
298
- ticket : Some ( tkt) ,
299
- binder : Some ( binder) ,
300
- } ) )
294
+ let ( tkt, binder) = check_psk_shared_key ( algs, & bytes[ 4 ..4 + len] ) ?;
295
+ Ok ( (
296
+ 4 + len,
297
+ Extensions {
298
+ sni : None ,
299
+ key_share : None ,
300
+ ticket : Some ( tkt) ,
301
+ binder : Some ( binder) ,
302
+ } ,
303
+ ) )
301
304
}
302
305
_ => Ok ( ( 4 + len, out) ) ,
303
306
}
0 commit comments