1*2175Sjp161948=pod 2*2175Sjp161948 3*2175Sjp161948=head1 NAME 4*2175Sjp161948 5*2175Sjp161948SSL_want, SSL_want_nothing, SSL_want_read, SSL_want_write, SSL_want_x509_lookup - obtain state information TLS/SSL I/O operation 6*2175Sjp161948 7*2175Sjp161948=head1 SYNOPSIS 8*2175Sjp161948 9*2175Sjp161948 #include <openssl/ssl.h> 10*2175Sjp161948 11*2175Sjp161948 int SSL_want(const SSL *ssl); 12*2175Sjp161948 int SSL_want_nothing(const SSL *ssl); 13*2175Sjp161948 int SSL_want_read(const SSL *ssl); 14*2175Sjp161948 int SSL_want_write(const SSL *ssl); 15*2175Sjp161948 int SSL_want_x509_lookup(const SSL *ssl); 16*2175Sjp161948 17*2175Sjp161948=head1 DESCRIPTION 18*2175Sjp161948 19*2175Sjp161948SSL_want() returns state information for the SSL object B<ssl>. 20*2175Sjp161948 21*2175Sjp161948The other SSL_want_*() calls are shortcuts for the possible states returned 22*2175Sjp161948by SSL_want(). 23*2175Sjp161948 24*2175Sjp161948=head1 NOTES 25*2175Sjp161948 26*2175Sjp161948SSL_want() examines the internal state information of the SSL object. Its 27*2175Sjp161948return values are similar to that of L<SSL_get_error(3)|SSL_get_error(3)>. 28*2175Sjp161948Unlike L<SSL_get_error(3)|SSL_get_error(3)>, which also evaluates the 29*2175Sjp161948error queue, the results are obtained by examining an internal state flag 30*2175Sjp161948only. The information must therefore only be used for normal operation under 31*2175Sjp161948non-blocking I/O. Error conditions are not handled and must be treated 32*2175Sjp161948using L<SSL_get_error(3)|SSL_get_error(3)>. 33*2175Sjp161948 34*2175Sjp161948The result returned by SSL_want() should always be consistent with 35*2175Sjp161948the result of L<SSL_get_error(3)|SSL_get_error(3)>. 36*2175Sjp161948 37*2175Sjp161948=head1 RETURN VALUES 38*2175Sjp161948 39*2175Sjp161948The following return values can currently occur for SSL_want(): 40*2175Sjp161948 41*2175Sjp161948=over 4 42*2175Sjp161948 43*2175Sjp161948=item SSL_NOTHING 44*2175Sjp161948 45*2175Sjp161948There is no data to be written or to be read. 46*2175Sjp161948 47*2175Sjp161948=item SSL_WRITING 48*2175Sjp161948 49*2175Sjp161948There are data in the SSL buffer that must be written to the underlying 50*2175Sjp161948B<BIO> layer in order to complete the actual SSL_*() operation. 51*2175Sjp161948A call to L<SSL_get_error(3)|SSL_get_error(3)> should return 52*2175Sjp161948SSL_ERROR_WANT_WRITE. 53*2175Sjp161948 54*2175Sjp161948=item SSL_READING 55*2175Sjp161948 56*2175Sjp161948More data must be read from the underlying B<BIO> layer in order to 57*2175Sjp161948complete the actual SSL_*() operation. 58*2175Sjp161948A call to L<SSL_get_error(3)|SSL_get_error(3)> should return 59*2175Sjp161948SSL_ERROR_WANT_READ. 60*2175Sjp161948 61*2175Sjp161948=item SSL_X509_LOOKUP 62*2175Sjp161948 63*2175Sjp161948The operation did not complete because an application callback set by 64*2175Sjp161948SSL_CTX_set_client_cert_cb() has asked to be called again. 65*2175Sjp161948A call to L<SSL_get_error(3)|SSL_get_error(3)> should return 66*2175Sjp161948SSL_ERROR_WANT_X509_LOOKUP. 67*2175Sjp161948 68*2175Sjp161948=back 69*2175Sjp161948 70*2175Sjp161948SSL_want_nothing(), SSL_want_read(), SSL_want_write(), SSL_want_x509_lookup() 71*2175Sjp161948return 1, when the corresponding condition is true or 0 otherwise. 72*2175Sjp161948 73*2175Sjp161948=head1 SEE ALSO 74*2175Sjp161948 75*2175Sjp161948L<ssl(3)|ssl(3)>, L<err(3)|err(3)>, L<SSL_get_error(3)|SSL_get_error(3)> 76*2175Sjp161948 77*2175Sjp161948=cut 78