SSL_in_init.3ossl 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. .\" -*- mode: troff; coding: utf-8 -*-
  2. .\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43)
  3. .\"
  4. .\" Standard preamble:
  5. .\" ========================================================================
  6. .de Sp \" Vertical space (when we can't use .PP)
  7. .if t .sp .5v
  8. .if n .sp
  9. ..
  10. .de Vb \" Begin verbatim text
  11. .ft CW
  12. .nf
  13. .ne \\$1
  14. ..
  15. .de Ve \" End verbatim text
  16. .ft R
  17. .fi
  18. ..
  19. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>.
  20. .ie n \{\
  21. . ds C` ""
  22. . ds C' ""
  23. 'br\}
  24. .el\{\
  25. . ds C`
  26. . ds C'
  27. 'br\}
  28. .\"
  29. .\" Escape single quotes in literal strings from groff's Unicode transform.
  30. .ie \n(.g .ds Aq \(aq
  31. .el .ds Aq '
  32. .\"
  33. .\" If the F register is >0, we'll generate index entries on stderr for
  34. .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
  35. .\" entries marked with X<> in POD. Of course, you'll have to process the
  36. .\" output yourself in some meaningful fashion.
  37. .\"
  38. .\" Avoid warning from groff about undefined register 'F'.
  39. .de IX
  40. ..
  41. .nr rF 0
  42. .if \n(.g .if rF .nr rF 1
  43. .if (\n(rF:(\n(.g==0)) \{\
  44. . if \nF \{\
  45. . de IX
  46. . tm Index:\\$1\t\\n%\t"\\$2"
  47. ..
  48. . if !\nF==2 \{\
  49. . nr % 0
  50. . nr F 2
  51. . \}
  52. . \}
  53. .\}
  54. .rr rF
  55. .\" ========================================================================
  56. .\"
  57. .IX Title "SSL_IN_INIT 3ossl"
  58. .TH SSL_IN_INIT 3ossl 2025-01-17 3.4.0 OpenSSL
  59. .\" For nroff, turn off justification. Always turn off hyphenation; it makes
  60. .\" way too many mistakes in technical documents.
  61. .if n .ad l
  62. .nh
  63. .SH NAME
  64. SSL_in_before,
  65. SSL_in_init,
  66. SSL_is_init_finished,
  67. SSL_in_connect_init,
  68. SSL_in_accept_init,
  69. SSL_get_state
  70. \&\- retrieve information about the handshake state machine
  71. .SH SYNOPSIS
  72. .IX Header "SYNOPSIS"
  73. .Vb 1
  74. \& #include <openssl/ssl.h>
  75. \&
  76. \& int SSL_in_init(const SSL *s);
  77. \& int SSL_in_before(const SSL *s);
  78. \& int SSL_is_init_finished(const SSL *s);
  79. \&
  80. \& int SSL_in_connect_init(SSL *s);
  81. \& int SSL_in_accept_init(SSL *s);
  82. \&
  83. \& OSSL_HANDSHAKE_STATE SSL_get_state(const SSL *ssl);
  84. .Ve
  85. .SH DESCRIPTION
  86. .IX Header "DESCRIPTION"
  87. \&\fBSSL_in_init()\fR returns 1 if the SSL/TLS state machine is currently processing or
  88. awaiting handshake messages, or 0 otherwise.
  89. .PP
  90. \&\fBSSL_in_before()\fR returns 1 if no SSL/TLS handshake has yet been initiated, or 0
  91. otherwise.
  92. .PP
  93. \&\fBSSL_is_init_finished()\fR returns 1 if the SSL/TLS connection is in a state where
  94. fully protected application data can be transferred or 0 otherwise.
  95. .PP
  96. Note that in some circumstances (such as when early data is being transferred)
  97. \&\fBSSL_in_init()\fR, \fBSSL_in_before()\fR and \fBSSL_is_init_finished()\fR can all return 0.
  98. .PP
  99. \&\fBSSL_in_connect_init()\fR returns 1 if \fBs\fR is acting as a client and \fBSSL_in_init()\fR
  100. would return 1, or 0 otherwise.
  101. .PP
  102. \&\fBSSL_in_accept_init()\fR returns 1 if \fBs\fR is acting as a server and \fBSSL_in_init()\fR
  103. would return 1, or 0 otherwise.
  104. .PP
  105. \&\fBSSL_in_connect_init()\fR and \fBSSL_in_accept_init()\fR are implemented as macros.
  106. .PP
  107. \&\fBSSL_get_state()\fR returns a value indicating the current state of the handshake
  108. state machine. OSSL_HANDSHAKE_STATE is an enumerated type where each value
  109. indicates a discrete state machine state. Note that future versions of OpenSSL
  110. may define more states so applications should expect to receive unrecognised
  111. state values. The naming format is made up of a number of elements as follows:
  112. .PP
  113. \&\fBprotocol\fR_ST_\fBrole\fR_\fBmessage\fR
  114. .PP
  115. \&\fBprotocol\fR is one of TLS or DTLS. DTLS is used where a state is specific to the
  116. DTLS protocol. Otherwise TLS is used.
  117. .PP
  118. \&\fBrole\fR is one of CR, CW, SR or SW to indicate "client reading",
  119. "client writing", "server reading" or "server writing" respectively.
  120. .PP
  121. \&\fBmessage\fR is the name of a handshake message that is being or has been sent, or
  122. is being or has been processed.
  123. .PP
  124. Additionally there are some special states that do not conform to the above
  125. format. These are:
  126. .IP TLS_ST_BEFORE 4
  127. .IX Item "TLS_ST_BEFORE"
  128. No handshake messages have yet been been sent or received.
  129. .IP TLS_ST_OK 4
  130. .IX Item "TLS_ST_OK"
  131. Handshake message sending/processing has completed.
  132. .IP TLS_ST_EARLY_DATA 4
  133. .IX Item "TLS_ST_EARLY_DATA"
  134. Early data is being processed
  135. .IP TLS_ST_PENDING_EARLY_DATA_END 4
  136. .IX Item "TLS_ST_PENDING_EARLY_DATA_END"
  137. Awaiting the end of early data processing
  138. .SH "RETURN VALUES"
  139. .IX Header "RETURN VALUES"
  140. \&\fBSSL_in_init()\fR, \fBSSL_in_before()\fR, \fBSSL_is_init_finished()\fR, \fBSSL_in_connect_init()\fR
  141. and \fBSSL_in_accept_init()\fR return values as indicated above.
  142. .PP
  143. \&\fBSSL_get_state()\fR returns the current handshake state.
  144. .SH "SEE ALSO"
  145. .IX Header "SEE ALSO"
  146. \&\fBssl\fR\|(7),
  147. \&\fBSSL_read_early_data\fR\|(3)
  148. .SH COPYRIGHT
  149. .IX Header "COPYRIGHT"
  150. Copyright 2017\-2018 The OpenSSL Project Authors. All Rights Reserved.
  151. .PP
  152. Licensed under the Apache License 2.0 (the "License"). You may not use
  153. this file except in compliance with the License. You can obtain a copy
  154. in the file LICENSE in the source distribution or at
  155. <https://www.openssl.org/source/license.html>.