diff options
author | Matt Caswell <matt@openssl.org> | 2020-01-15 16:34:55 +0000 |
---|---|---|
committer | Matt Caswell <matt@openssl.org> | 2020-01-20 14:54:31 +0000 |
commit | 993ebac9ed38481e4d3795c437d4e98b985c68ce (patch) | |
tree | 0e30982d57fac860519fae6071b33988c7e68c11 /doc | |
parent | 09a4cb9ec7ea9ccb4885588ba3e138b9f5f606c7 (diff) |
Convert rand_bytes_ex and rand_priv_bytes_ex to public functions
These were initially added as internal functions only. However they will
also need to be used by libssl as well. Therefore it make sense to move
them into the public API.
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/10864)
Diffstat (limited to 'doc')
-rw-r--r-- | doc/internal/man3/rand_bytes_ex.pod | 41 | ||||
-rw-r--r-- | doc/man3/RAND_bytes.pod | 19 |
2 files changed, 18 insertions, 42 deletions
diff --git a/doc/internal/man3/rand_bytes_ex.pod b/doc/internal/man3/rand_bytes_ex.pod deleted file mode 100644 index e1bb0f04df..0000000000 --- a/doc/internal/man3/rand_bytes_ex.pod +++ /dev/null @@ -1,41 +0,0 @@ -=pod - -=head1 NAME - -rand_bytes_ex, rand_priv_bytes_ex -- internal random number routines - -=head1 SYNOPSIS - - #include "crypto/rand.h" - - int rand_bytes_ex(OPENSSL_CTX *ctx, unsigned char *buf, int num); - int rand_priv_bytes_ex(OPENSSL_CTX *ctx, unsigned char *buf, int num); - -=head1 DESCRIPTION - -rand_bytes_ex() and rand_priv_bytes_ex() are the equivalent of RAND_bytes() and -RAND_priv_bytes() in the public API except that they both take an additional -I<ctx> parameter. -The DRBG used for the operation is the public or private DRBG associated with -the specified I<ctx>. The parameter can be NULL, in which case -the default library ctx is used. -If the default RAND_METHOD has been changed then for compatibility reasons the -RAND_METHOD will be used in preference and the DRBG of the library context -ignored. - -=head1 RETURN VALUES - -rand_bytes_ex() and rand_bytes_priv_ex() return 0 or less on error or 1 on -success. - -=head1 COPYRIGHT - -Copyright 2019 The OpenSSL Project Authors. All Rights Reserved. - -Licensed under the Apache License 2.0 (the "License"). You may not use -this file except in compliance with the License. You can obtain a copy -in the file LICENSE in the source distribution or at -L<https://www.openssl.org/source/license.html>. - -=cut diff --git a/doc/man3/RAND_bytes.pod b/doc/man3/RAND_bytes.pod index fb1e1c9a22..5da4692520 100644 --- a/doc/man3/RAND_bytes.pod +++ b/doc/man3/RAND_bytes.pod @@ -2,7 +2,8 @@ =head1 NAME -RAND_bytes, RAND_priv_bytes, RAND_pseudo_bytes - generate random data +RAND_bytes, RAND_priv_bytes, RAND_bytes_ex, RAND_priv_bytes_ex, +RAND_pseudo_bytes - generate random data =head1 SYNOPSIS @@ -11,6 +12,9 @@ RAND_bytes, RAND_priv_bytes, RAND_pseudo_bytes - generate random data int RAND_bytes(unsigned char *buf, int num); int RAND_priv_bytes(unsigned char *buf, int num); + int RAND_bytes_ex(OPENSSL_CTX *ctx, unsigned char *buf, int num); + int RAND_priv_bytes_ex(OPENSSL_CTX *ctx, unsigned char *buf, int num); + Deprecated since OpenSSL 1.1.0, can be hidden entirely by defining B<OPENSSL_API_COMPAT> with a suitable version value, see L<openssl_user_macros(7)>: @@ -29,6 +33,15 @@ instance so that a compromise of the "public" PRNG instance will not affect the secrecy of these private values, as described in L<RAND(7)> and L<RAND_DRBG(7)>. +RAND_bytes_ex() and RAND_priv_bytes_ex() are the same as RAND_bytes() and +RAND_priv_bytes() except that they both take an additional I<ctx> parameter. +The DRBG used for the operation is the public or private DRBG associated with +the specified I<ctx>. The parameter can be NULL, in which case +the default library context is used (see L<OPENSSL_CTX(3)>. +If the default RAND_METHOD has been changed then for compatibility reasons the +RAND_METHOD will be used in preference and the DRBG of the library context +ignored. + =head1 NOTES Always check the error return value of RAND_bytes() and @@ -64,6 +77,10 @@ RAND_pseudo_bytes() was deprecated in OpenSSL 1.1.0; use RAND_bytes() instead. The RAND_priv_bytes() function was added in OpenSSL 1.1.1. +=item * + +The RAND_bytes_ex() and RAND_priv_bytes_ex() functions were added in OpenSSL 3.0 + =back =head1 COPYRIGHT |