@@ -71,10 +71,10 @@ async Task AuthenticateSASL(List<string> mechanisms, string username, bool async
7171 {
7272 // At the time of writing PostgreSQL only supports SCRAM-SHA-256 and SCRAM-SHA-256-PLUS
7373 var serverSupportsSha256 = mechanisms . Contains ( "SCRAM-SHA-256" ) ;
74- var clientSupportsSha256 = serverSupportsSha256 && Settings . ChannelBinding != ChannelBinding . Require ;
74+ var allowSha256 = serverSupportsSha256 && Settings . ChannelBinding != ChannelBinding . Require ;
7575 var serverSupportsSha256Plus = mechanisms . Contains ( "SCRAM-SHA-256-PLUS" ) ;
76- var clientSupportsSha256Plus = serverSupportsSha256Plus && Settings . ChannelBinding != ChannelBinding . Disable ;
77- if ( ! clientSupportsSha256 && ! clientSupportsSha256Plus )
76+ var allowSha256Plus = serverSupportsSha256Plus && Settings . ChannelBinding != ChannelBinding . Disable ;
77+ if ( ! allowSha256 && ! allowSha256Plus )
7878 {
7979 if ( serverSupportsSha256 && Settings . ChannelBinding == ChannelBinding . Require )
8080 throw new NpgsqlException ( $ "Couldn't connect because { nameof ( ChannelBinding ) } is set to { nameof ( ChannelBinding . Require ) } " +
@@ -92,10 +92,10 @@ async Task AuthenticateSASL(List<string> mechanisms, string username, bool async
9292 var cbind = string . Empty ;
9393 var successfulBind = false ;
9494
95- if ( clientSupportsSha256Plus )
95+ if ( allowSha256Plus )
9696 DataSource . TransportSecurityHandler . AuthenticateSASLSha256Plus ( this , ref mechanism , ref cbindFlag , ref cbind , ref successfulBind ) ;
9797
98- if ( ! successfulBind && serverSupportsSha256 )
98+ if ( ! successfulBind && allowSha256 )
9999 {
100100 mechanism = "SCRAM-SHA-256" ;
101101 // We can get here if PostgreSQL supports only SCRAM-SHA-256 or there was an error while binding to SCRAM-SHA-256-PLUS
0 commit comments