diff options
author | Dr. Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com> | 2019-06-27 10:12:08 +0200 |
---|---|---|
committer | Dr. Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com> | 2019-06-27 14:39:07 +0200 |
commit | 262c00882a2fd7cf16672bf467a86f75b4098a7c (patch) | |
tree | 8145f67128e8db9c6a5d39f1da0017e8899231fb /doc/man3/BN_generate_prime.pod | |
parent | 0588be2e01c244c41b0215689f411a6223063fd7 (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/man3/BN_generate_prime.pod')
-rw-r--r-- | doc/man3/BN_generate_prime.pod | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/doc/man3/BN_generate_prime.pod b/doc/man3/BN_generate_prime.pod index 253fde3c70..eb5d89a3dc 100644 --- a/doc/man3/BN_generate_prime.pod +++ b/doc/man3/BN_generate_prime.pod @@ -51,7 +51,9 @@ L<openssl_user_macros(7)>: =head1 DESCRIPTION BN_generate_prime_ex() generates a pseudo-random prime number of -at least bit length B<bits>. +at least bit length B<bits>. The returned number is probably prime +with a negligible error. + If B<ret> is not B<NULL>, it will be used to store the number. If B<cb> is not B<NULL>, it is used as follows: @@ -89,8 +91,9 @@ generator. If B<safe> is true, it will be a safe prime (i.e. a prime p so that (p-1)/2 is also prime). -The PRNG must be seeded prior to calling BN_generate_prime_ex(). -The prime number generation has a negligible error probability. +The random generator must be seeded prior to calling BN_generate_prime_ex(). +If the automatic seeding or reseeding of the OpenSSL CSPRNG fails due to +external circumstances (see L<RAND(7)>), the operation will fail. BN_is_prime_ex() and BN_is_prime_fasttest_ex() test if the number B<p> is prime. The following tests are performed until one of them shows that @@ -193,7 +196,8 @@ Instead applications should create a BN_GENCB structure using BN_GENCB_new: =head1 SEE ALSO L<DH_generate_parameters(3)>, L<DSA_generate_parameters(3)>, -L<RSA_generate_key(3)>, L<ERR_get_error(3)>, L<RAND_bytes(3)> +L<RSA_generate_key(3)>, L<ERR_get_error(3)>, L<RAND_bytes(3)>, +L<RAND(7)> =head1 HISTORY |