pgsql: Fix generation of padding message before encrypting Elgamal in p

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Fix generation of padding message before encrypting Elgamal in p
Date: 2019-01-01 01:40:23
Message-ID: E1ge92d-0004nG-W2@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Fix generation of padding message before encrypting Elgamal in pgcrypto

fe0a0b5, which has added a stronger random source in Postgres, has
introduced a thinko when creating a padding message which gets encrypted
for Elgamal. The padding message cannot have zeros, which are replaced
by random bytes. However if pg_strong_random() failed, the message
would finish by being considered in correct shape for encryption with
zeros.

Author: Tom Lane
Reviewed-by: Michael Paquier
Discussion: https://postgr.es/m/20186.1546188423@sss.pgh.pa.us
Backpatch-through: 10

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/d880b208e5fcf55e3ae396d5fc5fa6639f58205f

Modified Files
--------------
contrib/pgcrypto/pgp-pubenc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Michael Paquier 2019-01-01 11:06:49 pgsql: Remove configure switch --disable-strong-random
Previous Message Michael Paquier 2019-01-01 00:03:45 pgsql: Improve comments and logs in do_pg_stop/start_backup