Received: from localhost (unknown [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id A97202E00FB for ; Tue, 11 Dec 2007 11:22:31 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-maia, port 10024) with ESMTP id 55733-05 for ; Tue, 11 Dec 2007 11:22:27 -0400 (AST) Received: from mxp.excelsarc.ro (unknown [89.38.26.199]) by postgresql.org (Postfix) with ESMTP id 5CC302E006F for ; Tue, 11 Dec 2007 11:22:27 -0400 (AST) Received: (qmail 969 invoked from network); 11 Dec 2007 15:22:23 -0000 Received: from localhost (127.0.0.1) by localhost with ESMTPS (DHE-RSA-AES256-SHA encrypted); 11 Dec 2007 15:22:23 -0000 From: sulfinu@gmail.com To: Oliver Jowett Subject: Re: JDBC driver patch for non-ASCII users Date: Tue, 11 Dec 2007 17:22:18 +0200 User-Agent: KMail/1.9.7 Cc: pgsql-jdbc@postgresql.org References: <200712071448.21411.sulfinu@gmail.com> <200712111421.47161.sulfinu@gmail.com> <475E8CAF.5000504@opencloud.com> In-Reply-To: <475E8CAF.5000504@opencloud.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200712111722.19122.sulfinu@gmail.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200712/73 X-Sequence-Number: 17928 On Tuesday 11 December 2007, Oliver Jowett wrote: > A general String certainly might contain non-ASCII, but all Strings > returned by UnixCrypt.crypt() contain only ASCII. See the implementation > of UnixCrypt.crypt(), and in particular the UnixCrypt.cov_2char array. > > So I still do not understand why the change quoted above is necessary. > Can you explain why it is necessary? As I already stated, UnixCrypt looks like a lost cause to me. It truncates a lot of the information in the password (try to imagine what happens to a Unicode password at line 620), so it's result is a little more relevant than nothing. > The server only ever sends a subset of ASCII as crypt salt characters > (specifically, the 62 characters a-z A-Z 0-9), so US-ASCII is just fine > for decoding. See postmaster.c, RandomSalt() / RemapChar(). I didn't know that, I'll take your word for it. Is it officially specified anywhere? Can it be relied upon in the future? I used the same Encoding.AUTHENTICATION_PHASE_ENCODING in all places for consistency and it doesn't harm in any way, since I make sure it is an ASCII extension.