File tree Expand file tree Collapse file tree
postgres-protocol/src/authentication Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22
33use hmac:: { Hmac , Mac , NewMac } ;
44use rand:: { self , Rng } ;
5- use sha2:: { Digest , Sha256 } ;
65use sha2:: digest:: FixedOutput ;
6+ use sha2:: { Digest , Sha256 } ;
77use std:: fmt:: Write ;
88use std:: io;
99use std:: iter;
@@ -271,8 +271,8 @@ impl ScramSha256 {
271271 hmac. update ( b"Server Key" ) ;
272272 let server_key = hmac. finalize ( ) . into_bytes ( ) ;
273273
274- let mut hmac = Hmac :: < Sha256 > :: new_varkey ( & server_key )
275- . expect ( "HMAC is able to accept all key sizes" ) ;
274+ let mut hmac =
275+ Hmac :: < Sha256 > :: new_varkey ( & server_key ) . expect ( "HMAC is able to accept all key sizes" ) ;
276276 hmac. update ( auth_message. as_bytes ( ) ) ;
277277 hmac. verify ( & verifier)
278278 . map_err ( |_| io:: Error :: new ( io:: ErrorKind :: InvalidInput , "SCRAM verification error" ) )
Original file line number Diff line number Diff line change @@ -158,16 +158,17 @@ macro_rules! accepts {
158158#[ macro_export]
159159macro_rules! to_sql_checked {
160160 ( ) => {
161- fn to_sql_checked( & self ,
162- ty: & $crate:: Type ,
163- out: & mut $crate:: private:: BytesMut )
164- -> :: std:: result:: Result <$crate:: IsNull ,
165- Box <dyn :: std:: error:: Error +
166- :: std:: marker:: Sync +
167- :: std:: marker:: Send >> {
161+ fn to_sql_checked(
162+ & self ,
163+ ty: & $crate:: Type ,
164+ out: & mut $crate:: private:: BytesMut ,
165+ ) -> :: std:: result:: Result <
166+ $crate:: IsNull ,
167+ Box <dyn :: std:: error:: Error + :: std:: marker:: Sync + :: std:: marker:: Send >,
168+ > {
168169 $crate:: __to_sql_checked( self , ty, out)
169170 }
170- }
171+ } ;
171172}
172173
173174// WARNING: this function is not considered part of this crate's public API.
You can’t perform that action at this time.
0 commit comments