summaryrefslogtreecommitdiffstats
path: root/doc/man7/RAND.pod
diff options
context:
space:
mode:
authorDr. Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com>2019-06-27 10:12:08 +0200
committerDr. Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com>2019-06-27 14:39:07 +0200
commit262c00882a2fd7cf16672bf467a86f75b4098a7c (patch)
tree8145f67128e8db9c6a5d39f1da0017e8899231fb /doc/man7/RAND.pod
parent0588be2e01c244c41b0215689f411a6223063fd7 (diff)
man: clarify the 'random number generator must be seeded' requirement
The manual pages require for some API functions that the 'random number generator must be seeded' before calling the function. Initially, this was meant literally, i.e. the OpenSSL CSPRNG had to be seeded manually before calling these functions. Since version 1.1.1, the CSPRNG is seeded automatically on first use, so it's not the responsibility of the programmer anymore. Still, he needs to be aware that the seeding might fail. Reviewed-by: Paul Dale <paul.dale@oracle.com> Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org> (Merged from https://github.com/openssl/openssl/pull/9257)
Diffstat (limited to 'doc/man7/RAND.pod')
-rw-r--r--doc/man7/RAND.pod6
1 files changed, 6 insertions, 0 deletions
diff --git a/doc/man7/RAND.pod b/doc/man7/RAND.pod
index 3d4766694e..e253e9025d 100644
--- a/doc/man7/RAND.pod
+++ b/doc/man7/RAND.pod
@@ -28,6 +28,12 @@ As a normal application developer, you do not have to worry about any details,
just use L<RAND_bytes(3)> to obtain random data.
Having said that, there is one important rule to obey: Always check the error
return value of L<RAND_bytes(3)> and do not take randomness for granted.
+Although (re-)seeding is automatic, it can fail because no trusted random source
+is available or the trusted source(s) temporarily fail to provide sufficient
+random seed material.
+In this case the CSPRNG enters an error state and ceases to provide output,
+until it is able to recover from the error by reseeding itself.
+For more details on reseeding and error recovery, see L<RAND_DRBG(7)>.
For values that should remain secret, you can use L<RAND_priv_bytes(3)>
instead.