Re: SCRAM authentication, take three

From: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
To: Kyotaro HORIGUCHI <horiguchi(dot)kyotaro(at)lab(dot)ntt(dot)co(dot)jp>
Cc: a(dot)alekseev(at)postgrespro(dot)ru, Heikki Linnakangas <hlinnaka(at)iki(dot)fi>, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, PostgreSQL mailing lists <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: SCRAM authentication, take three
Date: 2017-03-06 02:50:42
Message-ID: CAB7nPqTZDC_jz22nMKdbHa5RvSk=MO9iHUq4f9F8KcVpqieG5A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Mar 3, 2017 at 2:43 PM, Michael Paquier
<michael(dot)paquier(at)gmail(dot)com> wrote:
> I am attaching 0009 and 0010 that address those problems (pushed on
> github as well) that can be applied on top of the latest set.

While doing more tests with my module able to do SASLprep, I have
noticed that calculations related to Hangul characters were incorrect:
/* Constants for calculations wih Hangul characters */
-#define SBASE 0xAC00
-#define LBASE 0x1100
-#define VBASE 0x1161
-#define TBASE 0x11A7
+#define SBASE 0xEAB080 /* U+AC00 */
+#define LBASE 0xE18480 /* U+1100 */
+#define VBASE 0xE185A1 /* U+1161 */
+#define TBASE 0xE186A7 /* U+11A7 */

Once the following is applied things get better:
-- Test for U+FB01, Latin Small Ligature Fi
=# select array_to_utf8(pg_sasl_prepare(utf8_to_array('fi')));
array_to_utf8
---------------
fi
(1 row)
-- Test for U+1E9B, Latin Small Letter Long S with Dot Above
-- This one was failing previously.
=# select array_to_utf8(pg_sasl_prepare(utf8_to_array('ẛ')));
array_to_utf8
---------------

(1 row)
-- Test for U+2075, superscript 5
=# select array_to_utf8(pg_sasl_prepare(utf8_to_array('⁵')));
array_to_utf8
---------------
5
(1 row)
--
Michael

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2017-03-06 02:54:59 Re: SCRAM authentication, take three
Previous Message Amit Kapila 2017-03-06 02:41:50 Re: Parallel seq. plan is not coming against inheritance or partition table