1*10e00d17Sschwarze.\" $OpenBSD: SSL_want.3,v 1.5 2018/03/27 17:35:50 schwarze Exp $ 26f246b13Sschwarze.\" OpenSSL 9b86974e Aug 17 15:21:33 2015 -0400 3f1a3c524Sschwarze.\" 46f246b13Sschwarze.\" This file was written by Lutz Jaenicke <jaenicke@openssl.org>. 56f246b13Sschwarze.\" Copyright (c) 2001, 2005 The OpenSSL Project. All rights reserved. 6f1a3c524Sschwarze.\" 76f246b13Sschwarze.\" Redistribution and use in source and binary forms, with or without 86f246b13Sschwarze.\" modification, are permitted provided that the following conditions 96f246b13Sschwarze.\" are met: 106f246b13Sschwarze.\" 116f246b13Sschwarze.\" 1. Redistributions of source code must retain the above copyright 126f246b13Sschwarze.\" notice, this list of conditions and the following disclaimer. 136f246b13Sschwarze.\" 146f246b13Sschwarze.\" 2. Redistributions in binary form must reproduce the above copyright 156f246b13Sschwarze.\" notice, this list of conditions and the following disclaimer in 166f246b13Sschwarze.\" the documentation and/or other materials provided with the 176f246b13Sschwarze.\" distribution. 186f246b13Sschwarze.\" 196f246b13Sschwarze.\" 3. All advertising materials mentioning features or use of this 206f246b13Sschwarze.\" software must display the following acknowledgment: 216f246b13Sschwarze.\" "This product includes software developed by the OpenSSL Project 226f246b13Sschwarze.\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)" 236f246b13Sschwarze.\" 246f246b13Sschwarze.\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to 256f246b13Sschwarze.\" endorse or promote products derived from this software without 266f246b13Sschwarze.\" prior written permission. For written permission, please contact 276f246b13Sschwarze.\" openssl-core@openssl.org. 286f246b13Sschwarze.\" 296f246b13Sschwarze.\" 5. Products derived from this software may not be called "OpenSSL" 306f246b13Sschwarze.\" nor may "OpenSSL" appear in their names without prior written 316f246b13Sschwarze.\" permission of the OpenSSL Project. 326f246b13Sschwarze.\" 336f246b13Sschwarze.\" 6. Redistributions of any form whatsoever must retain the following 346f246b13Sschwarze.\" acknowledgment: 356f246b13Sschwarze.\" "This product includes software developed by the OpenSSL Project 366f246b13Sschwarze.\" for use in the OpenSSL Toolkit (http://www.openssl.org/)" 376f246b13Sschwarze.\" 386f246b13Sschwarze.\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY 396f246b13Sschwarze.\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 406f246b13Sschwarze.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 416f246b13Sschwarze.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR 426f246b13Sschwarze.\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 436f246b13Sschwarze.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 446f246b13Sschwarze.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 456f246b13Sschwarze.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 466f246b13Sschwarze.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 476f246b13Sschwarze.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 486f246b13Sschwarze.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 496f246b13Sschwarze.\" OF THE POSSIBILITY OF SUCH DAMAGE. 506f246b13Sschwarze.\" 51*10e00d17Sschwarze.Dd $Mdocdate: March 27 2018 $ 52f1a3c524Sschwarze.Dt SSL_WANT 3 53f1a3c524Sschwarze.Os 54f1a3c524Sschwarze.Sh NAME 55f1a3c524Sschwarze.Nm SSL_want , 56f1a3c524Sschwarze.Nm SSL_want_nothing , 57f1a3c524Sschwarze.Nm SSL_want_read , 58f1a3c524Sschwarze.Nm SSL_want_write , 59f1a3c524Sschwarze.Nm SSL_want_x509_lookup 60f1a3c524Sschwarze.Nd obtain state information TLS/SSL I/O operation 61f1a3c524Sschwarze.Sh SYNOPSIS 62f1a3c524Sschwarze.In openssl/ssl.h 63f1a3c524Sschwarze.Ft int 64f1a3c524Sschwarze.Fn SSL_want "const SSL *ssl" 65f1a3c524Sschwarze.Ft int 66f1a3c524Sschwarze.Fn SSL_want_nothing "const SSL *ssl" 67f1a3c524Sschwarze.Ft int 68f1a3c524Sschwarze.Fn SSL_want_read "const SSL *ssl" 69f1a3c524Sschwarze.Ft int 70f1a3c524Sschwarze.Fn SSL_want_write "const SSL *ssl" 71f1a3c524Sschwarze.Ft int 72f1a3c524Sschwarze.Fn SSL_want_x509_lookup "const SSL *ssl" 73f1a3c524Sschwarze.Sh DESCRIPTION 74f1a3c524Sschwarze.Fn SSL_want 75f1a3c524Sschwarzereturns state information for the 76f1a3c524Sschwarze.Vt SSL 77f1a3c524Sschwarzeobject 78f1a3c524Sschwarze.Fa ssl . 79f1a3c524Sschwarze.Pp 80f1a3c524SschwarzeThe other 81f1a3c524Sschwarze.Fn SSL_want_* 82f1a3c524Sschwarzecalls are shortcuts for the possible states returned by 83f1a3c524Sschwarze.Fn SSL_want . 846f246b13Sschwarze.Pp 85f1a3c524Sschwarze.Fn SSL_want 86f1a3c524Sschwarzeexamines the internal state information of the 87f1a3c524Sschwarze.Vt SSL 88f1a3c524Sschwarzeobject. 89f1a3c524SschwarzeIts return values are similar to those of 90f1a3c524Sschwarze.Xr SSL_get_error 3 . 91f1a3c524SschwarzeUnlike 92f1a3c524Sschwarze.Xr SSL_get_error 3 , 93f1a3c524Sschwarzewhich also evaluates the error queue, 94f1a3c524Sschwarzethe results are obtained by examining an internal state flag only. 95f1a3c524SschwarzeThe information must therefore only be used for normal operation under 96f1a3c524Sschwarzenon-blocking I/O. 97f1a3c524SschwarzeError conditions are not handled and must be treated using 98f1a3c524Sschwarze.Xr SSL_get_error 3 . 99f1a3c524Sschwarze.Pp 100f1a3c524SschwarzeThe result returned by 101f1a3c524Sschwarze.Fn SSL_want 102f1a3c524Sschwarzeshould always be consistent with the result of 103f1a3c524Sschwarze.Xr SSL_get_error 3 . 104f1a3c524Sschwarze.Sh RETURN VALUES 105f1a3c524SschwarzeThe following return values can currently occur for 106f1a3c524Sschwarze.Fn SSL_want : 107f1a3c524Sschwarze.Bl -tag -width Ds 1086f246b13Sschwarze.It Dv SSL_NOTHING 109f1a3c524SschwarzeThere is no data to be written or to be read. 1106f246b13Sschwarze.It Dv SSL_WRITING 111f1a3c524SschwarzeThere are data in the SSL buffer that must be written to the underlying 112f1a3c524Sschwarze.Vt BIO 113f1a3c524Sschwarzelayer in order to complete the actual 114f1a3c524Sschwarze.Fn SSL_* 115f1a3c524Sschwarzeoperation. 116f1a3c524SschwarzeA call to 117f1a3c524Sschwarze.Xr SSL_get_error 3 118f1a3c524Sschwarzeshould return 119f1a3c524Sschwarze.Dv SSL_ERROR_WANT_WRITE . 120f1a3c524Sschwarze.It Dv SSL_READING 121f1a3c524SschwarzeMore data must be read from the underlying 122f1a3c524Sschwarze.Vt BIO 123f1a3c524Sschwarzelayer in order to 124f1a3c524Sschwarzecomplete the actual 125f1a3c524Sschwarze.Fn SSL_* 126f1a3c524Sschwarzeoperation. 127f1a3c524SschwarzeA call to 128f1a3c524Sschwarze.Xr SSL_get_error 3 129f1a3c524Sschwarzeshould return 130f1a3c524Sschwarze.Dv SSL_ERROR_WANT_READ . 131f1a3c524Sschwarze.It Dv SSL_X509_LOOKUP 132f1a3c524SschwarzeThe operation did not complete because an application callback set by 133f1a3c524Sschwarze.Xr SSL_CTX_set_client_cert_cb 3 134f1a3c524Sschwarzehas asked to be called again. 135f1a3c524SschwarzeA call to 136f1a3c524Sschwarze.Xr SSL_get_error 3 137f1a3c524Sschwarzeshould return 138f1a3c524Sschwarze.Dv SSL_ERROR_WANT_X509_LOOKUP . 139f1a3c524Sschwarze.El 140f1a3c524Sschwarze.Pp 141f1a3c524Sschwarze.Fn SSL_want_nothing , 142f1a3c524Sschwarze.Fn SSL_want_read , 143f1a3c524Sschwarze.Fn SSL_want_write , 144f1a3c524Sschwarzeand 145f1a3c524Sschwarze.Fn SSL_want_x509_lookup 146f1a3c524Sschwarzereturn 1 when the corresponding condition is true or 0 otherwise. 147f1a3c524Sschwarze.Sh SEE ALSO 148f1a3c524Sschwarze.Xr err 3 , 149f1a3c524Sschwarze.Xr ssl 3 , 150f1a3c524Sschwarze.Xr SSL_get_error 3 1518fba1ec8Sschwarze.Sh HISTORY 152*10e00d17Sschwarze.Fn SSL_want , 153*10e00d17Sschwarze.Fn SSL_want_nothing , 154*10e00d17Sschwarze.Fn SSL_want_read , 155*10e00d17Sschwarzeand 156*10e00d17Sschwarze.Fn SSL_want_write 157*10e00d17Sschwarzefirst appeared in SSLeay 0.5.2. 158*10e00d17Sschwarze.Fn SSL_want_x509_lookup 159*10e00d17Sschwarzefirst appeared in SSLeay 0.6.0. 160*10e00d17SschwarzeThese functions have been available since 1618fba1ec8Sschwarze.Ox 2.4 . 162