Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit1707a0d

Browse files
committed
Remove configure switch --disable-strong-random
This removes a portion of infrastructure introduced byfe0a0b5 to allowcompilation of Postgres in environments where no strong random source isavailable, meaning that there is no linking to OpenSSL and no/dev/urandom (Windows having its own CryptoAPI). No systems shippedthis century lack /dev/urandom, and the buildfarm is actually nottesting this switch at all, so just remove it. This simplifiesparticularly some backend code which included a fallback implementationusing shared memory, and removes a set of alternate regression outputfiles from pgcrypto.Author: Michael PaquierReviewed-by: Tom LaneDiscussion:https://postgr.es/m/20181230063219.GG608@paquier.xyz
1 parentd880b20 commit1707a0d

32 files changed

+60
-1183
lines changed

‎configure

Lines changed: 10 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -761,7 +761,6 @@ GENHTML
761761
LCOV
762762
GCOV
763763
enable_debug
764-
enable_strong_random
765764
enable_rpath
766765
default_port
767766
WANTED_LANGUAGES
@@ -829,7 +828,6 @@ with_pgport
829828
enable_rpath
830829
enable_spinlocks
831830
enable_atomics
832-
enable_strong_random
833831
enable_debug
834832
enable_profiling
835833
enable_coverage
@@ -1512,7 +1510,6 @@ Optional Features:
15121510
executables
15131511
--disable-spinlocks do not use spinlocks
15141512
--disable-atomics do not use atomic operations
1515-
--disable-strong-random do not use a strong random number source
15161513
--enable-debug build with debugging symbols (-g)
15171514
--enable-profiling build with profiling enabled
15181515
--enable-coverage build with coverage testing instrumentation
@@ -3272,34 +3269,6 @@ fi
32723269

32733270

32743271

3275-
#
3276-
# Random number generation
3277-
#
3278-
3279-
3280-
# Check whether --enable-strong-random was given.
3281-
if test "${enable_strong_random+set}" = set; then :
3282-
enableval=$enable_strong_random;
3283-
case $enableval in
3284-
yes)
3285-
:
3286-
;;
3287-
no)
3288-
:
3289-
;;
3290-
*)
3291-
as_fn_error $? "no argument expected for --enable-strong-random option" "$LINENO" 5
3292-
;;
3293-
esac
3294-
3295-
else
3296-
enable_strong_random=yes
3297-
3298-
fi
3299-
3300-
3301-
3302-
33033272
#
33043273
# --enable-debug adds -g to compiler flags
33053274
#
@@ -17937,7 +17906,7 @@ fi
1793717906
# in the template or configure command line.
1793817907

1793917908
# If not selected manually, try to select a source automatically.
17940-
if test"$enable_strong_random" = "yes" && testx"$USE_OPENSSL_RANDOM" = x"" && test x"$USE_WIN32_RANDOM" = x"" && test x"$USE_DEV_URANDOM" = x"" ; then
17909+
if test x"$USE_OPENSSL_RANDOM" = x"" && test x"$USE_WIN32_RANDOM" = x"" && test x"$USE_DEV_URANDOM" = x"" ; then
1794117910
if test x"$with_openssl" = x"yes" ; then
1794217911
USE_OPENSSL_RANDOM=1
1794317912
elif test "$PORTNAME" = "win32" ; then
@@ -17971,42 +17940,28 @@ fi
1797117940

1797217941
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking which random number source to use" >&5
1797317942
$as_echo_n "checking which random number source to use... " >&6; }
17974-
if test "$enable_strong_random" = yes ; then
17975-
if test x"$USE_OPENSSL_RANDOM" = x"1" ; then
17943+
if test x"$USE_OPENSSL_RANDOM" = x"1" ; then
1797617944

1797717945
$as_echo "#define USE_OPENSSL_RANDOM 1" >>confdefs.h
1797817946

17979-
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: OpenSSL" >&5
17947+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: OpenSSL" >&5
1798017948
$as_echo "OpenSSL" >&6; }
17981-
elif test x"$USE_WIN32_RANDOM" = x"1" ; then
17949+
elif test x"$USE_WIN32_RANDOM" = x"1" ; then
1798217950

1798317951
$as_echo "#define USE_WIN32_RANDOM 1" >>confdefs.h
1798417952

17985-
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Windows native" >&5
17953+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Windows native" >&5
1798617954
$as_echo "Windows native" >&6; }
17987-
elif test x"$USE_DEV_URANDOM" = x"1" ; then
17955+
elif test x"$USE_DEV_URANDOM" = x"1" ; then
1798817956

1798917957
$as_echo "#define USE_DEV_URANDOM 1" >>confdefs.h
1799017958

17991-
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: /dev/urandom" >&5
17959+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: /dev/urandom" >&5
1799217960
$as_echo "/dev/urandom" >&6; }
17993-
else
17994-
as_fn_error $? "
17995-
no source of strong random numbers was found
17996-
PostgreSQL can use OpenSSL or /dev/urandom as a source of random numbers,
17997-
for authentication protocols. You can use --disable-strong-random to use a
17998-
built-in pseudo random number generator, but that may be insecure." "$LINENO" 5
17999-
fi
18000-
18001-
$as_echo "#define HAVE_STRONG_RANDOM 1" >>confdefs.h
18002-
1800317961
else
18004-
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: weak builtin PRNG" >&5
18005-
$as_echo "weak builtin PRNG" >&6; }
18006-
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING:
18007-
*** Not using a strong random number source may be insecure." >&5
18008-
$as_echo "$as_me: WARNING:
18009-
*** Not using a strong random number source may be insecure." >&2;}
17962+
as_fn_error $? "
17963+
no source of strong random numbers was found
17964+
PostgreSQL can use OpenSSL or /dev/urandom as a source of random numbers." "$LINENO" 5
1801017965
fi
1801117966

1801217967
# If not set in template file, set bytes to use libc memset()

‎configure.in

Lines changed: 13 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -193,13 +193,6 @@ PGAC_ARG_BOOL(enable, spinlocks, yes,
193193
PGAC_ARG_BOOL(enable, atomics, yes,
194194
[do not use atomic operations])
195195

196-
#
197-
# Random number generation
198-
#
199-
PGAC_ARG_BOOL(enable, strong-random, yes,
200-
[do not use a strong random number source])
201-
AC_SUBST(enable_strong_random)
202-
203196
#
204197
# --enable-debug adds -g to compiler flags
205198
#
@@ -2151,7 +2144,7 @@ fi
21512144
# in the template or configure command line.
21522145

21532146
# If not selected manually, try to select a source automatically.
2154-
if test"$enable_strong_random" = "yes" && testx"$USE_OPENSSL_RANDOM" = x"" && test x"$USE_WIN32_RANDOM" = x"" && test x"$USE_DEV_URANDOM" = x"" ; then
2147+
if test x"$USE_OPENSSL_RANDOM" = x"" && test x"$USE_WIN32_RANDOM" = x"" && test x"$USE_DEV_URANDOM" = x"" ; then
21552148
if test x"$with_openssl" = x"yes" ; then
21562149
USE_OPENSSL_RANDOM=1
21572150
elif test "$PORTNAME" = "win32" ; then
@@ -2166,28 +2159,19 @@ if test "$enable_strong_random" = "yes" && test x"$USE_OPENSSL_RANDOM" = x"" &&
21662159
fi
21672160

21682161
AC_MSG_CHECKING([which random number source to use])
2169-
if test "$enable_strong_random" = yes ; then
2170-
if test x"$USE_OPENSSL_RANDOM" = x"1" ; then
2171-
AC_DEFINE(USE_OPENSSL_RANDOM, 1, [Define to use OpenSSL for random number generation])
2172-
AC_MSG_RESULT([OpenSSL])
2173-
elif test x"$USE_WIN32_RANDOM" = x"1" ; then
2174-
AC_DEFINE(USE_WIN32_RANDOM, 1, [Define to use native Windows API for random number generation])
2175-
AC_MSG_RESULT([Windows native])
2176-
elif test x"$USE_DEV_URANDOM" = x"1" ; then
2177-
AC_DEFINE(USE_DEV_URANDOM, 1, [Define to use /dev/urandom for random number generation])
2178-
AC_MSG_RESULT([/dev/urandom])
2179-
else
2180-
AC_MSG_ERROR([
2181-
no source of strong random numbers was found
2182-
PostgreSQL can use OpenSSL or /dev/urandom as a source of random numbers,
2183-
for authentication protocols. You can use --disable-strong-random to use a
2184-
built-in pseudo random number generator, but that may be insecure.])
2185-
fi
2186-
AC_DEFINE(HAVE_STRONG_RANDOM, 1, [Define to use have a strong random number source])
2162+
if test x"$USE_OPENSSL_RANDOM" = x"1" ; then
2163+
AC_DEFINE(USE_OPENSSL_RANDOM, 1, [Define to use OpenSSL for random number generation])
2164+
AC_MSG_RESULT([OpenSSL])
2165+
elif test x"$USE_WIN32_RANDOM" = x"1" ; then
2166+
AC_DEFINE(USE_WIN32_RANDOM, 1, [Define to use native Windows API for random number generation])
2167+
AC_MSG_RESULT([Windows native])
2168+
elif test x"$USE_DEV_URANDOM" = x"1" ; then
2169+
AC_DEFINE(USE_DEV_URANDOM, 1, [Define to use /dev/urandom for random number generation])
2170+
AC_MSG_RESULT([/dev/urandom])
21872171
else
2188-
AC_MSG_RESULT([weak builtin PRNG])
2189-
AC_MSG_WARN([
2190-
*** Not using a strong random numbersourcemay be insecure.])
2172+
AC_MSG_ERROR([
2173+
no source of strong random numbers was found
2174+
PostgreSQL can use OpenSSL or /dev/urandom as asourceof random numbers.])
21912175
fi
21922176

21932177
# If not set in template file, set bytes to use libc memset()

‎contrib/pgcrypto/expected/pgp-compression_1.out

Lines changed: 0 additions & 42 deletions
This file was deleted.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp