ongres / scram

SCRAM (RFC 5802) Java implementation
BSD 2-Clause "Simplified" License
26 stars 11 forks source link

Scram Diver raises an error when entering a Password with non-ASCII chracters in DBeaver #13

Closed bkolb249 closed 3 years ago

bkolb249 commented 3 years ago

Not 100% sure if I am right here, but I experienced the following Issue when Using DBeaver: https://github.com/dbeaver/dbeaver/issues/11320

It is caused by a non-ASCII Character in my password. As far as I know, DBeaver is using the the ongres srcam driver. DBeaver team said this is a problem on your end, thats why I am reporting it here

This is the Stacktrace of the error:

java.lang.IllegalArgumentException: value contains character '§' which is non US-ASCII at org.postgresql.shaded.com.ongres.scram.common.util.UsAsciiUtils.toPrintable(UsAsciiUtils.java:45) at org.postgresql.shaded.com.ongres.scram.common.stringprep.StringPreparations$1.doNormalize(StringPreparations.java:43) at org.postgresql.shaded.com.ongres.scram.common.stringprep.StringPreparations.normalize(StringPreparations.java:53) at org.postgresql.shaded.com.ongres.scram.common.ScramFunctions.saltedPassword(ScramFunctions.java:62) at org.postgresql.shaded.com.ongres.scram.client.ScramSession$ClientFinalProcessor.<init>(ScramSession.java:198) at org.postgresql.shaded.com.ongres.scram.client.ScramSession$ClientFinalProcessor.<init>(ScramSession.java:165) at org.postgresql.shaded.com.ongres.scram.client.ScramSession$ServerFirstProcessor.clientFinalProcessor(ScramSession.java:132) at org.postgresql.jre8.sasl.ScramAuthenticator.processServerFirstMessage(ScramAuthenticator.java:131) at org.postgresql.core.v3.ConnectionFactoryImpl.doAuthentication(ConnectionFactoryImpl.java:678) at org.postgresql.core.v3.ConnectionFactoryImpl.tryConnect(ConnectionFactoryImpl.java:141) at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:192) at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:49) at org.postgresql.jdbc.PgConnection.<init>(PgConnection.java:195) at org.postgresql.Driver.makeConnection(Driver.java:454) at org.postgresql.Driver.access$100(Driver.java:57) at org.postgresql.Driver$ConnectThread.run(Driver.java:364) at java.base/java.lang.Thread.run(Unknown Source)

Session data:

eclipse.buildId=unknown java.version=11.0.5 java.vendor=AdoptOpenJDK BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=de Command-line arguments: -os win32 -ws win32 -arch x86_64

Is there any fix? Thank you in advance.

jorsol commented 3 years ago

Hi @bkolb249, try to use the latest PostgreSQL JDBC Driver version 42.2.19, that version contains the fix for the use of SASLprep normalization, and that should allow the use of some non-ASCII characters.

bkolb249 commented 3 years ago

Thanks @jorsol, that solved it.