mirror of
https://github.com/openssl/openssl.git
synced 2024-12-09 05:51:54 +08:00
6694e51dba
We provider internal versions of RAND_bytes() and RAND_priv_bytes() which have the addition of taking an OPENSSL_CTX as a parameter. Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com> (Merged from https://github.com/openssl/openssl/pull/9193)
42 lines
1.2 KiB
Plaintext
42 lines
1.2 KiB
Plaintext
=pod
|
|
|
|
=head1 NAME
|
|
|
|
rand_bytes_ex, rand_priv_bytes_ex
|
|
- internal random number routines
|
|
|
|
=head1 SYNOPSIS
|
|
|
|
#include "internal/rand_int.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
|
|
B<ctx> parameter.
|
|
The DRBG used for the operation is the public or private DRBG associated with
|
|
the specified B<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
|