xref: /netbsd-src/crypto/external/bsd/openssl/lib/libcrypto/man/RAND_egd.3 (revision 7d9ffdb3e9da593a05c5e2169f72fc7bada08bc9)
$NetBSD: RAND_egd.3,v 1.25 2024/09/08 13:08:29 christos Exp $

-*- mode: troff; coding: utf-8 -*-
Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43)

Standard preamble:
========================================================================
..
..
.. \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>.
. ds C` "" . ds C' "" 'br\} . ds C` . ds C' 'br\}
Escape single quotes in literal strings from groff's Unicode transform.

If the F register is >0, we'll generate index entries on stderr for
titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
entries marked with X<> in POD. Of course, you'll have to process the
output yourself in some meaningful fashion.

Avoid warning from groff about undefined register 'F'.
.. .nr rF 0 . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF ========================================================================

Title "RAND_egd 3"
RAND_egd 3 2024-09-03 3.0.15 OpenSSL
For nroff, turn off justification. Always turn off hyphenation; it makes
way too many mistakes in technical documents.
NAME
RAND_egd, RAND_egd_bytes, RAND_query_egd_bytes - query entropy gathering daemon
SYNOPSIS
Header "SYNOPSIS" .Vb 1 #include <openssl/rand.h> \& int RAND_egd_bytes(const char *path, int num); int RAND_egd(const char *path); \& int RAND_query_egd_bytes(const char *path, unsigned char *buf, int num); .Ve
DESCRIPTION
Header "DESCRIPTION" On older platforms without a good source of randomness such as \*(C`/dev/urandom\*(C', it is possible to query an Entropy Gathering Daemon (EGD) over a local socket to obtain randomness and seed the OpenSSL RNG. The protocol used is defined by the EGDs available at <http://egd.sourceforge.net/> or <http://prngd.sourceforge.net>.

\fBRAND_egd_bytes() requests num bytes of randomness from an EGD at the specified socket path, and passes the data it receives into RAND_add(). \fBRAND_egd() is equivalent to RAND_egd_bytes() with num set to 255.

\fBRAND_query_egd_bytes() requests num bytes of randomness from an EGD at the specified socket path, where num must be less than 256. If buf is NULL, it is equivalent to RAND_egd_bytes(). If buf is not NULL, then the data is copied to the buffer and \fBRAND_add() is not called.

OpenSSL can be configured at build time to try to use the EGD for seeding automatically.

"RETURN VALUES"
Header "RETURN VALUES" \fBRAND_egd() and RAND_egd_bytes() return the number of bytes read from the daemon on success, or -1 if the connection failed or the daemon did not return enough data to fully seed the PRNG.

\fBRAND_query_egd_bytes() returns the number of bytes read from the daemon on success, or -1 if the connection failed.

"SEE ALSO"
Header "SEE ALSO" \fBRAND_add\|(3), \fBRAND_bytes\|(3), \fBRAND\|(7)
COPYRIGHT
Header "COPYRIGHT" Copyright 2000-2018 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 <https://www.openssl.org/source/license.html>.