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