]>
Commit | Line | Data |
---|---|---|
c1497b4d LJ |
1 | =pod |
2 | ||
3 | =head1 NAME | |
4 | ||
0c3eb279 DDO |
5 | SSL_want, SSL_want_nothing, SSL_want_read, SSL_want_write, |
6 | SSL_want_x509_lookup, SSL_want_retry_verify, SSL_want_async, SSL_want_async_job, | |
7 | SSL_want_client_hello_cb - obtain state information TLS/SSL I/O operation | |
c1497b4d LJ |
8 | |
9 | =head1 SYNOPSIS | |
10 | ||
11 | #include <openssl/ssl.h> | |
12 | ||
c3e64028 NL |
13 | int SSL_want(const SSL *ssl); |
14 | int SSL_want_nothing(const SSL *ssl); | |
15 | int SSL_want_read(const SSL *ssl); | |
16 | int SSL_want_write(const SSL *ssl); | |
17 | int SSL_want_x509_lookup(const SSL *ssl); | |
0c3eb279 | 18 | int SSL_want_retry_verify(const SSL *ssl); |
fc7f190c MC |
19 | int SSL_want_async(const SSL *ssl); |
20 | int SSL_want_async_job(const SSL *ssl); | |
a9c0d8be | 21 | int SSL_want_client_hello_cb(const SSL *ssl); |
c1497b4d LJ |
22 | |
23 | =head1 DESCRIPTION | |
24 | ||
25 | SSL_want() returns state information for the SSL object B<ssl>. | |
26 | ||
27 | The other SSL_want_*() calls are shortcuts for the possible states returned | |
28 | by SSL_want(). | |
29 | ||
30 | =head1 NOTES | |
31 | ||
32 | SSL_want() examines the internal state information of the SSL object. Its | |
9b86974e RS |
33 | return values are similar to that of L<SSL_get_error(3)>. |
34 | Unlike L<SSL_get_error(3)>, which also evaluates the | |
c1497b4d LJ |
35 | error queue, the results are obtained by examining an internal state flag |
36 | only. The information must therefore only be used for normal operation under | |
490c8711 | 37 | nonblocking I/O. Error conditions are not handled and must be treated |
9b86974e | 38 | using L<SSL_get_error(3)>. |
c1497b4d LJ |
39 | |
40 | The result returned by SSL_want() should always be consistent with | |
9b86974e | 41 | the result of L<SSL_get_error(3)>. |
c1497b4d LJ |
42 | |
43 | =head1 RETURN VALUES | |
44 | ||
45 | The following return values can currently occur for SSL_want(): | |
46 | ||
47 | =over 4 | |
48 | ||
49 | =item SSL_NOTHING | |
50 | ||
51 | There is no data to be written or to be read. | |
52 | ||
53 | =item SSL_WRITING | |
54 | ||
55 | There are data in the SSL buffer that must be written to the underlying | |
56 | B<BIO> layer in order to complete the actual SSL_*() operation. | |
0c3eb279 | 57 | A call to L<SSL_get_error(3)> should return B<SSL_ERROR_WANT_WRITE>. |
c1497b4d LJ |
58 | |
59 | =item SSL_READING | |
60 | ||
61 | More data must be read from the underlying B<BIO> layer in order to | |
62 | complete the actual SSL_*() operation. | |
0c3eb279 | 63 | A call to L<SSL_get_error(3)> should return B<SSL_ERROR_WANT_READ>. |
c1497b4d LJ |
64 | |
65 | =item SSL_X509_LOOKUP | |
66 | ||
67 | The operation did not complete because an application callback set by | |
68 | SSL_CTX_set_client_cert_cb() has asked to be called again. | |
0c3eb279 DDO |
69 | A call to L<SSL_get_error(3)> should return B<SSL_ERROR_WANT_X509_LOOKUP>. |
70 | ||
71 | =item SSL_RETRY_VERIFY | |
72 | ||
dfb39f73 TM |
73 | The operation did not complete because a certificate verification callback |
74 | has asked to be called again via L<SSL_set_retry_verify(3)>. | |
0c3eb279 | 75 | A call to L<SSL_get_error(3)> should return B<SSL_ERROR_WANT_RETRY_VERIFY>. |
c1497b4d | 76 | |
fc7f190c MC |
77 | =item SSL_ASYNC_PAUSED |
78 | ||
79 | An asynchronous operation partially completed and was then paused. See | |
80 | L<SSL_get_all_async_fds(3)>. A call to L<SSL_get_error(3)> should return | |
0c3eb279 | 81 | B<SSL_ERROR_WANT_ASYNC>. |
fc7f190c MC |
82 | |
83 | =item SSL_ASYNC_NO_JOBS | |
84 | ||
85 | The asynchronous job could not be started because there were no async jobs | |
86 | available in the pool (see ASYNC_init_thread(3)). A call to L<SSL_get_error(3)> | |
0c3eb279 | 87 | should return B<SSL_ERROR_WANT_ASYNC_JOB>. |
fc7f190c | 88 | |
a9c0d8be | 89 | =item SSL_CLIENT_HELLO_CB |
6b1bb98f BK |
90 | |
91 | The operation did not complete because an application callback set by | |
a9c0d8be | 92 | SSL_CTX_set_client_hello_cb() has asked to be called again. |
0c3eb279 | 93 | A call to L<SSL_get_error(3)> should return B<SSL_ERROR_WANT_CLIENT_HELLO_CB>. |
6b1bb98f | 94 | |
c1497b4d LJ |
95 | =back |
96 | ||
0c3eb279 DDO |
97 | SSL_want_nothing(), SSL_want_read(), SSL_want_write(), |
98 | SSL_want_x509_lookup(), SSL_want_retry_verify(), | |
99 | SSL_want_async(), SSL_want_async_job(), and SSL_want_client_hello_cb() | |
100 | return 1 when the corresponding condition is true or 0 otherwise. | |
c1497b4d LJ |
101 | |
102 | =head1 SEE ALSO | |
103 | ||
73fb82b7 | 104 | L<ssl(7)>, L<SSL_get_error(3)> |
c1497b4d | 105 | |
6b1bb98f BK |
106 | =head1 HISTORY |
107 | ||
fc5ecadd DMSP |
108 | The SSL_want_client_hello_cb() function and the SSL_CLIENT_HELLO_CB return value |
109 | were added in OpenSSL 1.1.1. | |
6b1bb98f | 110 | |
e2f92610 RS |
111 | =head1 COPYRIGHT |
112 | ||
fecb3aae | 113 | Copyright 2001-2022 The OpenSSL Project Authors. All Rights Reserved. |
e2f92610 | 114 | |
4746f25a | 115 | Licensed under the Apache License 2.0 (the "License"). You may not use |
e2f92610 RS |
116 | this file except in compliance with the License. You can obtain a copy |
117 | in the file LICENSE in the source distribution or at | |
118 | L<https://www.openssl.org/source/license.html>. | |
119 | ||
120 | =cut |