summaryrefslogtreecommitdiffstats
path: root/Configure
diff options
context:
space:
mode:
authorRich Salz <rsalz@openssl.org>2017-07-18 09:39:21 -0400
committerRich Salz <rsalz@openssl.org>2017-07-22 14:00:07 -0400
commit8389ec4b4950b9474e72a959eb0b0a6ce77ac1e8 (patch)
tree433fb30336963d2bd5a8cd7bb87a4dba32313f92 /Configure
parent0d7903f83f84bba1d29225efd999c633a0c5ba01 (diff)
Add --with-rand-seed
Add a new config param to specify how the CSPRNG should be seeded. Illegal values or nonsensical combinations (e.g., anything other than "os" on VMS or HP VOS etc) result in build failures. Add RDSEED support. Add RDTSC but leave it disabled for now pending more investigation. Refactor and reorganization all seeding files (rand_unix/win/vms) so that they are simpler. Only require 128 bits of seeding material. Many document improvements, including why to not use RAND_add() and the limitations around using load_file/write_file. Document RAND_poll(). Cleanup Windows RAND_poll and return correct status More completely initialize the default DRBG. Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/3965)
Diffstat (limited to 'Configure')
-rwxr-xr-xConfigure23
1 files changed, 23 insertions, 0 deletions
diff --git a/Configure b/Configure
index 9612976cfa..ebfe01d290 100755
--- a/Configure
+++ b/Configure
@@ -561,6 +561,9 @@ $config{build_type} = "release";
my %unsupported_options = ();
my %deprecated_options = ();
+# If you change this, update apps/version.c
+my @known_seed_sources = qw(getrandom devrandom os egd none rdcpu librandom);
+my @seed_sources = ();
while (@argvcopy)
{
$_ = shift @argvcopy;
@@ -729,6 +732,15 @@ while (@argvcopy)
{
$withargs{fuzzer_include}=$1;
}
+ elsif (/^--with-rand-seed=(.*)$/)
+ {
+ foreach my $x (split(m|,|, $1))
+ {
+ die "Unknown --with-rand-seed choice $x\n"
+ if ! grep { $x eq $_ } @known_seed_sources;
+ push @seed_sources, $x;
+ }
+ }
elsif (/^--cross-compile-prefix=(.*)$/)
{
$config{cross_compile_prefix}=$1;
@@ -812,6 +824,17 @@ if ($libs =~ /(^|\s)-Wl,-rpath,/
"***** any of asan, msan or ubsan\n";
}
+if (scalar(@seed_sources) == 0) {
+ print "Using implicit seed configuration\n";
+ push @seed_sources, 'os';
+}
+die "Cannot seed with none and anything else"
+ if scalar(grep { $_ eq 'none' } @seed_sources) > 0
+ && scalar(@seed_sources) > 1;
+push @{$config{openssl_other_defines}},
+ map { (my $x = $_) =~ tr|[\-a-z]|[_A-Z]|; "OPENSSL_RAND_SEED_$x" }
+ @seed_sources;
+
my @tocheckfor = (keys %disabled);
while (@tocheckfor) {
my %new_tocheckfor = ();