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