Re: SCRAM authentication, take three
Michael Paquier <michael.paquier@gmail.com>
From: Michael Paquier <michael.paquier@gmail.com>
To: Aleksander Alekseev <a.alekseev@postgrespro.ru>
Cc: Heikki Linnakangas <hlinnaka@iki.fi>,
Alvaro Herrera <alvherre@2ndquadrant.com>, pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2017-02-21T00:53:57Z
Lists: pgsql-hackers
On Mon, Feb 20, 2017 at 9:41 PM, Aleksander Alekseev <a.alekseev@postgrespro.ru> wrote: >> Speaking about flaws, it looks like there is a memory leak in >> array_to_utf procedure - result is allocated twice. Pushed a fix for this one on my branch. > And a few more things I've noticed after a closer look: > > * build_client_first_message does not free `state->client_nonce` if > second malloc (for `buf`) fails > * same for `state->client_first_message_bare` > * ... and most other procedures declared in fe-auth-scram.c file > (see malloc and strdup calls) You are visibly missing pg_fe_scram_free(). > * scram_Normalize doesn't check malloc return value Yes, I am aware of this one. This makes the interface utterly ugly though because an error log message needs to be handled across many API layers. We could just assume anything returning NULL is equivalent to an OOM and nothing else though. -- Michael
Commits
-
Rename "scram" to "scram-sha-256" in pg_hba.conf and password_encryption.
- c727f120ff50 10.0 landed
-
Support SCRAM-SHA-256 authentication (RFC 5802 and 7677).
- 818fd4a67d61 10.0 landed