]> git.ipfire.org Git - thirdparty/openssl.git/blame - doc/man3/RAND_egd.pod
Implement EVP_MAC_do_all_ex()
[thirdparty/openssl.git] / doc / man3 / RAND_egd.pod
CommitLineData
4ec2d4d2
UM
1=pod
2
3=head1 NAME
4
aafbe1cc 5RAND_egd, RAND_egd_bytes, RAND_query_egd_bytes - query entropy gathering daemon
4ec2d4d2
UM
6
7=head1 SYNOPSIS
8
9 #include <openssl/rand.h>
10
04256277 11 int RAND_egd_bytes(const char *path, int num);
4ec2d4d2 12 int RAND_egd(const char *path);
420125f9 13
04256277 14 int RAND_query_egd_bytes(const char *path, unsigned char *buf, int num);
4ec2d4d2
UM
15
16=head1 DESCRIPTION
17
04256277
RS
18On older platforms without a good source of randomness such as C</dev/urandom>,
19it is possible to query an Entropy Gathering Daemon (EGD) over a local
20socket to obtain randomness and seed the OpenSSL RNG.
21The protocol used is defined by the EGDs available at
22L<http://egd.sourceforge.net/> or L<http://prngd.sourceforge.net>.
23
24RAND_egd_bytes() requests B<num> bytes of randomness from an EGD at the
25specified socket B<path>, and passes the data it receives into RAND_add().
26RAND_egd() is equivalent to RAND_egd_bytes() with B<num> set to 255.
27
28RAND_query_egd_bytes() requests B<num> bytes of randomness from an EGD at
e0c89df9 29the specified socket B<path>, where B<num> must be less than 256.
04256277
RS
30If B<buf> is B<NULL>, it is equivalent to RAND_egd_bytes().
31If B<buf> is not B<NULL>, then the data is copied to the buffer and
32RAND_add() is not called.
33
34OpenSSL can be configured at build time to try to use the EGD for seeding
35automatically.
466e4249 36
1f13ad31 37=head1 RETURN VALUES
4ec2d4d2 38
420125f9 39RAND_egd() and RAND_egd_bytes() return the number of bytes read from the
04256277 40daemon on success, or -1 if the connection failed or the daemon did not
420125f9
LJ
41return enough data to fully seed the PRNG.
42
43RAND_query_egd_bytes() returns the number of bytes read from the daemon on
04256277 44success, or -1 if the connection failed.
4ec2d4d2
UM
45
46=head1 SEE ALSO
47
a73d990e
DMSP
48L<RAND_add(3)>,
49L<RAND_bytes(3)>,
50L<RAND(7)>
4ec2d4d2 51
e2f92610
RS
52=head1 COPYRIGHT
53
61f805c1 54Copyright 2000-2018 The OpenSSL Project Authors. All Rights Reserved.
e2f92610 55
4746f25a 56Licensed under the Apache License 2.0 (the "License"). You may not use
e2f92610
RS
57this file except in compliance with the License. You can obtain a copy
58in the file LICENSE in the source distribution or at
59L<https://www.openssl.org/source/license.html>.
60
61=cut