File tree 2 files changed +12
-11
lines changed
postgres-protocol/src/authentication
2 files changed +12
-11
lines changed Original file line number Diff line number Diff line change 2
2
3
3
use hmac:: { Hmac , Mac , NewMac } ;
4
4
use rand:: { self , Rng } ;
5
- use sha2:: { Digest , Sha256 } ;
6
5
use sha2:: digest:: FixedOutput ;
6
+ use sha2:: { Digest , Sha256 } ;
7
7
use std:: fmt:: Write ;
8
8
use std:: io;
9
9
use std:: iter;
@@ -271,8 +271,8 @@ impl ScramSha256 {
271
271
hmac. update ( b"Server Key" ) ;
272
272
let server_key = hmac. finalize ( ) . into_bytes ( ) ;
273
273
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" ) ;
276
276
hmac. update ( auth_message. as_bytes ( ) ) ;
277
277
hmac. verify ( & verifier)
278
278
. 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 {
158
158
#[ macro_export]
159
159
macro_rules! to_sql_checked {
160
160
( ) => {
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
+ > {
168
169
$crate:: __to_sql_checked( self , ty, out)
169
170
}
170
- }
171
+ } ;
171
172
}
172
173
173
174
// 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