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/SSL_set0_rbio.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>SSL_set_bio</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="#history">HISTORY</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>SSL_set_bio, SSL_set0_rbio, SSL_set0_wbio - connect the SSL object with a BIO</p> <p> </p> <hr /> <h1><a name="synopsis">SYNOPSIS</a></h1> <pre> #include <openssl/ssl.h></pre> <pre> void SSL_set_bio(SSL *ssl, BIO *rbio, BIO *wbio); void SSL_set0_rbio(SSL *s, BIO *rbio); void SSL_set0_wbio(SSL *s, BIO *wbio);</pre> <p> </p> <hr /> <h1><a name="description">DESCRIPTION</a></h1> <p>SSL_set0_rbio() connects the BIO <strong>rbio</strong> for the read operations of the <strong>ssl</strong> object. The SSL engine inherits the behaviour of <strong>rbio</strong>. If the BIO is nonblocking then the <strong>ssl</strong> object will also have nonblocking behaviour. This function transfers ownership of <strong>rbio</strong> to <strong>ssl</strong>. It will be automatically freed using <em>BIO_free_all(3)</em> when the <strong>ssl</strong> is freed. On calling this function, any existing <strong>rbio</strong> that was previously set will also be freed via a call to <em>BIO_free_all(3)</em> (this includes the case where the <strong>rbio</strong> is set to the same value as previously).</p> <p>SSL_set0_wbio() works in the same as SSL_set0_rbio() except that it connects the BIO <strong>wbio</strong> for the write operations of the <strong>ssl</strong> object. Note that if the rbio and wbio are the same then SSL_set0_rbio() and SSL_set0_wbio() each take ownership of one reference. Therefore, it may be necessary to increment the number of references available using <em>BIO_up_ref(3)</em> before calling the set0 functions.</p> <p><code>SSL_set_bio()</code> is similar to SSL_set0_rbio() and SSL_set0_wbio() except that it connects both the <strong>rbio</strong> and the <strong>wbio</strong> at the same time, and transfers the ownership of <strong>rbio</strong> and <strong>wbio</strong> to <strong>ssl</strong> according to the following set of rules:</p> <ul> <li> <p>If neither the <strong>rbio</strong> or <strong>wbio</strong> have changed from their previous values then nothing is done.</p> </li> <li> <p>If the <strong>rbio</strong> and <strong>wbio</strong> parameters are different and both are different to their previously set values then one reference is consumed for the rbio and one reference is consumed for the wbio.</p> </li> <li> <p>If the <strong>rbio</strong> and <strong>wbio</strong> parameters are the same and the <strong>rbio</strong> is not the same as the previously set value then one reference is consumed.</p> </li> <li> <p>If the <strong>rbio</strong> and <strong>wbio</strong> parameters are the same and the <strong>rbio</strong> is the same as the previously set value, then no additional references are consumed.</p> </li> <li> <p>If the <strong>rbio</strong> and <strong>wbio</strong> parameters are different and the <strong>rbio</strong> is the same as the previously set value then one reference is consumed for the <strong>wbio</strong> and no references are consumed for the <strong>rbio</strong>.</p> </li> <li> <p>If the <strong>rbio</strong> and <strong>wbio</strong> parameters are different and the <strong>wbio</strong> is the same as the previously set value and the old <strong>rbio</strong> and <strong>wbio</strong> values were the same as each other then one reference is consumed for the <strong>rbio</strong> and no references are consumed for the <strong>wbio</strong>.</p> </li> <li> <p>If the <strong>rbio</strong> and <strong>wbio</strong> parameters are different and the <strong>wbio</strong> is the same as the previously set value and the old <strong>rbio</strong> and <strong>wbio</strong> values were different to each other then one reference is consumed for the <strong>rbio</strong> and one reference is consumed for the <strong>wbio</strong>.</p> </li> </ul> <p>Because of this complexity, this function should be avoided; use SSL_set0_rbio() and SSL_set0_wbio() instead.</p> <p> </p> <hr /> <h1><a name="return_values">RETURN VALUES</a></h1> <p><code>SSL_set_bio()</code>, SSL_set0_rbio() and SSL_set0_wbio() cannot fail.</p> <p> </p> <hr /> <h1><a name="see_also">SEE ALSO</a></h1> <p><em>SSL_get_rbio(3)</em>, <em>SSL_connect(3)</em>, <em>SSL_accept(3)</em>, <em>SSL_shutdown(3)</em>, <em>ssl(7)</em>, <em>bio(7)</em></p> <p> </p> <hr /> <h1><a name="history">HISTORY</a></h1> <p>SSL_set0_rbio() and SSL_set0_wbio() were added in OpenSSL 1.1.0.</p> <p> </p> <hr /> <h1><a name="copyright">COPYRIGHT</a></h1> <p>Copyright 2000-2020 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>