Blame doc/man3/RAND_egd.pod

Packit c4476c
=pod
Packit c4476c
Packit c4476c
=head1 NAME
Packit c4476c
Packit c4476c
RAND_egd, RAND_egd_bytes, RAND_query_egd_bytes - query entropy gathering daemon
Packit c4476c
Packit c4476c
=head1 SYNOPSIS
Packit c4476c
Packit c4476c
 #include <openssl/rand.h>
Packit c4476c
Packit c4476c
 int RAND_egd_bytes(const char *path, int num);
Packit c4476c
 int RAND_egd(const char *path);
Packit c4476c
Packit c4476c
 int RAND_query_egd_bytes(const char *path, unsigned char *buf, int num);
Packit c4476c
Packit c4476c
=head1 DESCRIPTION
Packit c4476c
Packit c4476c
On older platforms without a good source of randomness such as C</dev/urandom>,
Packit c4476c
it is possible to query an Entropy Gathering Daemon (EGD) over a local
Packit c4476c
socket to obtain randomness and seed the OpenSSL RNG.
Packit c4476c
The protocol used is defined by the EGDs available at
Packit c4476c
L<http://egd.sourceforge.net/> or L<http://prngd.sourceforge.net>.
Packit c4476c
Packit c4476c
RAND_egd_bytes() requests B<num> bytes of randomness from an EGD at the
Packit c4476c
specified socket B<path>, and passes the data it receives into RAND_add().
Packit c4476c
RAND_egd() is equivalent to RAND_egd_bytes() with B<num> set to 255.
Packit c4476c
Packit c4476c
RAND_query_egd_bytes() requests B<num> bytes of randomness from an EGD at
Packit c4476c
the specified socket B<path>, where B<num> must be less than 256.
Packit c4476c
If B<buf> is B<NULL>, it is equivalent to RAND_egd_bytes().
Packit c4476c
If B<buf> is not B<NULL>, then the data is copied to the buffer and
Packit c4476c
RAND_add() is not called.
Packit c4476c
Packit c4476c
OpenSSL can be configured at build time to try to use the EGD for seeding
Packit c4476c
automatically.
Packit c4476c
Packit c4476c
=head1 RETURN VALUES
Packit c4476c
Packit c4476c
RAND_egd() and RAND_egd_bytes() return the number of bytes read from the
Packit c4476c
daemon on success, or -1 if the connection failed or the daemon did not
Packit c4476c
return enough data to fully seed the PRNG.
Packit c4476c
Packit c4476c
RAND_query_egd_bytes() returns the number of bytes read from the daemon on
Packit c4476c
success, or -1 if the connection failed.
Packit c4476c
Packit c4476c
=head1 SEE ALSO
Packit c4476c
Packit c4476c
L<RAND_add(3)>,
Packit c4476c
L<RAND_bytes(3)>,
Packit c4476c
L<RAND(7)>
Packit c4476c
Packit c4476c
=head1 COPYRIGHT
Packit c4476c
Packit c4476c
Copyright 2000-2018 The OpenSSL Project Authors. All Rights Reserved.
Packit c4476c
Packit c4476c
Licensed under the OpenSSL license (the "License").  You may not use
Packit c4476c
this file except in compliance with the License.  You can obtain a copy
Packit c4476c
in the file LICENSE in the source distribution or at
Packit c4476c
L<https://www.openssl.org/source/license.html>.
Packit c4476c
Packit c4476c
=cut