2
0

SSL_want.pod 3.8 KB

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