SSL_in_init.pod 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. =pod
  2. =head1 NAME
  3. SSL_in_before,
  4. SSL_in_init,
  5. SSL_is_init_finished,
  6. SSL_in_connect_init,
  7. SSL_in_accept_init,
  8. SSL_get_state
  9. - retrieve information about the handshake state machine
  10. =head1 SYNOPSIS
  11. #include <openssl/ssl.h>
  12. int SSL_in_init(const SSL *s);
  13. int SSL_in_before(const SSL *s);
  14. int SSL_is_init_finished(const SSL *s);
  15. int SSL_in_connect_init(SSL *s);
  16. int SSL_in_accept_init(SSL *s);
  17. OSSL_HANDSHAKE_STATE SSL_get_state(const SSL *ssl);
  18. =head1 DESCRIPTION
  19. SSL_in_init() returns 1 if the SSL/TLS state machine is currently processing or
  20. awaiting handshake messages, or 0 otherwise.
  21. SSL_in_before() returns 1 if no SSL/TLS handshake has yet been initiated, or 0
  22. otherwise.
  23. SSL_is_init_finished() returns 1 if the SSL/TLS connection is in a state where
  24. fully protected application data can be transferred or 0 otherwise.
  25. Note that in some circumstances (such as when early data is being transferred)
  26. SSL_in_init(), SSL_in_before() and SSL_is_init_finished() can all return 0.
  27. SSL_in_connect_init() returns 1 if B<s> is acting as a client and SSL_in_init()
  28. would return 1, or 0 otherwise.
  29. SSL_in_accept_init() returns 1 if B<s> is acting as a server and SSL_in_init()
  30. would return 1, or 0 otherwise.
  31. SSL_in_connect_init() and SSL_in_accept_init() are implemented as macros.
  32. SSL_get_state() returns a value indicating the current state of the handshake
  33. state machine. OSSL_HANDSHAKE_STATE is an enumerated type where each value
  34. indicates a discrete state machine state. Note that future versions of OpenSSL
  35. may define more states so applications should expect to receive unrecognised
  36. state values. The naming format is made up of a number of elements as follows:
  37. B<protocol>_ST_B<role>_B<message>
  38. B<protocol> is one of TLS or DTLS. DTLS is used where a state is specific to the
  39. DTLS protocol. Otherwise TLS is used.
  40. B<role> is one of CR, CW, SR or SW to indicate "client reading",
  41. "client writing", "server reading" or "server writing" respectively.
  42. B<message> is the name of a handshake message that is being or has been sent, or
  43. is being or has been processed.
  44. Additionally there are some special states that do not conform to the above
  45. format. These are:
  46. =over 4
  47. =item TLS_ST_BEFORE
  48. No handshake messages have yet been been sent or received.
  49. =item TLS_ST_OK
  50. Handshake message sending/processing has completed.
  51. =item TLS_ST_EARLY_DATA
  52. Early data is being processed
  53. =item TLS_ST_PENDING_EARLY_DATA_END
  54. Awaiting the end of early data processing
  55. =back
  56. =head1 RETURN VALUES
  57. SSL_in_init(), SSL_in_before(), SSL_is_init_finished(), SSL_in_connect_init()
  58. and SSL_in_accept_init() return values as indicated above.
  59. SSL_get_state() returns the current handshake state.
  60. =head1 SEE ALSO
  61. L<ssl(7)>,
  62. L<SSL_read_early_data(3)>
  63. =head1 COPYRIGHT
  64. Copyright 2017-2018 The OpenSSL Project Authors. All Rights Reserved.
  65. Licensed under the Apache License 2.0 (the "License"). You may not use
  66. this file except in compliance with the License. You can obtain a copy
  67. in the file LICENSE in the source distribution or at
  68. L<https://www.openssl.org/source/license.html>.
  69. =cut