Current Path : /usr/opt/openssl11/share/doc/openssl/html/man3/ |
FreeBSD hs32.drive.ne.jp 9.1-RELEASE FreeBSD 9.1-RELEASE #1: Wed Jan 14 12:18:08 JST 2015 root@hs32.drive.ne.jp:/sys/amd64/compile/hs32 amd64 |
Current File : //usr/opt/openssl11/share/doc/openssl/html/man3/RAND_egd_bytes.html |
<?xml version="1.0" ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>RAND_egd</title> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <link rev="made" href="mailto:root@hsxx.drive.ne.jp" /> </head> <body style="background-color: white"> <!-- INDEX BEGIN --> <div name="index"> <p><a name="__index__"></a></p> <ul> <li><a href="#name">NAME</a></li> <li><a href="#synopsis">SYNOPSIS</a></li> <li><a href="#description">DESCRIPTION</a></li> <li><a href="#return_values">RETURN VALUES</a></li> <li><a href="#see_also">SEE ALSO</a></li> <li><a href="#copyright">COPYRIGHT</a></li> </ul> <hr name="index" /> </div> <!-- INDEX END --> <p> </p> <hr /> <h1><a name="name">NAME</a></h1> <p>RAND_egd, RAND_egd_bytes, RAND_query_egd_bytes - query entropy gathering daemon</p> <p> </p> <hr /> <h1><a name="synopsis">SYNOPSIS</a></h1> <pre> #include <openssl/rand.h></pre> <pre> int RAND_egd_bytes(const char *path, int num); int RAND_egd(const char *path);</pre> <pre> int RAND_query_egd_bytes(const char *path, unsigned char *buf, int num);</pre> <p> </p> <hr /> <h1><a name="description">DESCRIPTION</a></h1> <p>On older platforms without a good source of randomness such as <code>/dev/urandom</code>, 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 <a href="http://egd.sourceforge.net/">http://egd.sourceforge.net/</a> or <a href="http://prngd.sourceforge.net">http://prngd.sourceforge.net</a>.</p> <p><code>RAND_egd_bytes()</code> requests <strong>num</strong> bytes of randomness from an EGD at the specified socket <strong>path</strong>, and passes the data it receives into <code>RAND_add()</code>. <code>RAND_egd()</code> is equivalent to <code>RAND_egd_bytes()</code> with <strong>num</strong> set to 255.</p> <p><code>RAND_query_egd_bytes()</code> requests <strong>num</strong> bytes of randomness from an EGD at the specified socket <strong>path</strong>, where <strong>num</strong> must be less than 256. If <strong>buf</strong> is <strong>NULL</strong>, it is equivalent to <code>RAND_egd_bytes()</code>. If <strong>buf</strong> is not <strong>NULL</strong>, then the data is copied to the buffer and <code>RAND_add()</code> is not called.</p> <p>OpenSSL can be configured at build time to try to use the EGD for seeding automatically.</p> <p> </p> <hr /> <h1><a name="return_values">RETURN VALUES</a></h1> <p><code>RAND_egd()</code> and <code>RAND_egd_bytes()</code> 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.</p> <p><code>RAND_query_egd_bytes()</code> returns the number of bytes read from the daemon on success, or -1 if the connection failed.</p> <p> </p> <hr /> <h1><a name="see_also">SEE ALSO</a></h1> <p><em>RAND_add(3)</em>, <em>RAND_bytes(3)</em>, <em>RAND(7)</em></p> <p> </p> <hr /> <h1><a name="copyright">COPYRIGHT</a></h1> <p>Copyright 2000-2018 The OpenSSL Project Authors. All Rights Reserved.</p> <p>Licensed under the OpenSSL license (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 <a href="https://www.openssl.org/source/license.html">https://www.openssl.org/source/license.html</a>.</p> </body> </html>