Commit f367ac2b authored by Rich Salz's avatar Rich Salz
Browse files

Use randomness not entropy

parent c91ec013
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -93,13 +93,14 @@ int app_RAND_write_file(const char *file)
{
    char buffer[200];

    if (egdsocket || !seeded)
    if (egdsocket || !seeded) {
        /*
         * If we did not manage to read the seed file, we should not write a
         * low-entropy seed file back -- it would suppress a crucial warning
         * the next time we want to use it.
         * If we didn't manage to read the seed file, don't write a
         * file out -- it would suppress a crucial warning the next
         * time we want to use it.
         */
        return 0;
    }

    if (file == NULL)
        file = RAND_file_name(buffer, sizeof buffer);
+1 −1
Original line number Diff line number Diff line
@@ -249,7 +249,7 @@ static double ecdh_results[EC_NUM][1];

#if !defined(OPENSSL_NO_DSA) || !defined(OPENSSL_NO_EC)
static const char rnd_seed[] =
    "string to make the random number generator think it has entropy";
    "string to make the random number generator think it has randomness";
#endif

#ifdef SIGALRM
+1 −1
Original line number Diff line number Diff line
@@ -16,7 +16,7 @@ OPENSSL_instrument_bus, OPENSSL_instrument_bus2 - instrument references to memor
It was empirically found that timings of references to primary memory
are subject to irregular, apparently non-deterministic variations. The
subroutines in question instrument these references for purposes of
gathering entropy for random number generator. In order to make it
gathering randomness for random number generator. In order to make it
bus-bound a 'flush cache line' instruction is used between probes. In
addition probes are added to B<vector> elements in atomic or
interlocked manner, which should contribute additional noise on
+7 −7
Original line number Diff line number Diff line
@@ -3,7 +3,7 @@
=head1 NAME

RAND_add, RAND_seed, RAND_status, RAND_event, RAND_screen - add
entropy to the PRNG
randomness to the PRNG

=head1 SYNOPSIS

@@ -11,7 +11,7 @@ entropy to the PRNG

 void RAND_seed(const void *buf, int num);

 void RAND_add(const void *buf, int num, double entropy);
 void RAND_add(const void *buf, int num, double randomness);

 int  RAND_status(void);

@@ -27,10 +27,10 @@ if the data at B<buf> are unpredictable to an adversary, this
increases the uncertainty about the state and makes the PRNG output
less predictable. Suitable input comes from user interaction (random
key presses, mouse movements) and certain hardware events. The
B<entropy> argument is (the lower bound of) an estimate of how much
randomness is contained in B<buf>, measured in bytes. Details about
sources of randomness and how to estimate their entropy can be found
in the literature, e.g. RFC 1750.
B<randomness> argument is an estimate of how much randomness is contained in
B<buf>, in bytes, and should be a number between zero and B<num>.
Details about sources of randomness and how to estimate their randomness
can be found in the literature; for example IETF RFC 4086.

RAND_add() may be called with sensitive data such as user entered
passwords. The seed values cannot be recovered from the PRNG output.
@@ -42,7 +42,7 @@ application is responsible for seeding the PRNG by calling RAND_add(),
L<RAND_egd(3)>
or L<RAND_load_file(3)>.

RAND_seed() is equivalent to RAND_add() when B<num == entropy>.
RAND_seed() is equivalent to RAND_add() with B<randomness> set to B<num>.

RAND_event() and RAND_screen() are deprecated and should not be called.

+0 −3
Original line number Diff line number Diff line
@@ -24,9 +24,6 @@ enough randomness to ensure an unpredictable byte sequence.

RAND_pseudo_bytes() has been deprecated; use RAND_bytes() instead.

The contents of B<buf> is mixed into the entropy pool before retrieving
the new pseudo-random bytes unless disabled at compile time (see FAQ).

=head1 RETURN VALUES

RAND_bytes() returns 1 on success, -1 if not supported by the current
Loading