mirror of
https://github.com/postgres/postgres.git
synced 2025-08-18 12:22:09 +03:00
Remove configure switch --disable-strong-random
This removes a portion of infrastructure introduced by fe0a0b5
to allow
compilation of Postgres in environments where no strong random source is
available, meaning that there is no linking to OpenSSL and no
/dev/urandom (Windows having its own CryptoAPI). No systems shipped
this century lack /dev/urandom, and the buildfarm is actually not
testing this switch at all, so just remove it. This simplifies
particularly some backend code which included a fallback implementation
using shared memory, and removes a set of alternate regression output
files from pgcrypto.
Author: Michael Paquier
Reviewed-by: Tom Lane
Discussion: https://postgr.es/m/20181230063219.GG608@paquier.xyz
This commit is contained in:
@@ -102,7 +102,6 @@
|
||||
#include "libpq/crypt.h"
|
||||
#include "libpq/scram.h"
|
||||
#include "miscadmin.h"
|
||||
#include "utils/backend_random.h"
|
||||
#include "utils/builtins.h"
|
||||
#include "utils/timestamp.h"
|
||||
|
||||
@@ -468,7 +467,7 @@ pg_be_scram_build_verifier(const char *password)
|
||||
password = (const char *) prep_password;
|
||||
|
||||
/* Generate random salt */
|
||||
if (!pg_backend_random(saltbuf, SCRAM_DEFAULT_SALT_LEN))
|
||||
if (!pg_strong_random(saltbuf, SCRAM_DEFAULT_SALT_LEN))
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_INTERNAL_ERROR),
|
||||
errmsg("could not generate random salt")));
|
||||
@@ -1123,7 +1122,7 @@ build_server_first_message(scram_state *state)
|
||||
char raw_nonce[SCRAM_RAW_NONCE_LEN];
|
||||
int encoded_len;
|
||||
|
||||
if (!pg_backend_random(raw_nonce, SCRAM_RAW_NONCE_LEN))
|
||||
if (!pg_strong_random(raw_nonce, SCRAM_RAW_NONCE_LEN))
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_INTERNAL_ERROR),
|
||||
errmsg("could not generate random nonce")));
|
||||
|
Reference in New Issue
Block a user