Re: Removing --disable-strong-random from the code

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Removing --disable-strong-random from the code
Дата
Msg-id 20186.1546188423@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Removing --disable-strong-random from the code  (Michael Paquier <michael@paquier.xyz>)
Ответы Re: Removing --disable-strong-random from the code  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: Removing --disable-strong-random from the code  (Michael Paquier <michael@paquier.xyz>)
Список pgsql-hackers
Michael Paquier <michael@paquier.xyz> writes:
> And attached is an updated patch with all those fixes included.  Any
> thoughts or opinions?

contrib/pgcrypto has some variant expected-files for the no-strong-random
case that could be removed now.

BackendRandomLock should be removed, too.

Since pg_strong_random is declared to take "void *", the places that
cast arguments to "char *" could be simplified.  (I guess that's a
hangover from the rather random decision to make pg_backend_random
take char *?)

The wording for pgcrypto's PXE_NO_RANDOM error,

    {PXE_NO_RANDOM, "No strong random source"},

perhaps needs to be changed --- maybe "Failed to generate strong random bits"?

Not the fault of this patch, but surely this bit in pgcrypto's
pad_eme_pkcs1_v15()

            if (!pg_strong_random((char *) p, 1))
            {
                px_memset(buf, 0, res_len);
                px_free(buf);
                break;
            }

is insane, because the "break" makes it fall into code that will continue
to scribble on "buf".  I think the "break" needs to be "return
PXE_NO_RANDOM", and probably we'd better back-patch that as a bug fix.
(I'm also failing to see the point of that px_memset before freeing the
buffer --- at this point, it contains no sensitive data, surely.)

LGTM otherwise.

            regards, tom lane


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Noah Misch
Дата:
Сообщение: Re: Move regression.diffs of pg_upgrade test suite
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Removing --disable-strong-random from the code