summaryrefslogtreecommitdiffstats
path: root/ssl/statem/statem.c
diff options
context:
space:
mode:
authorMatt Caswell <matt@openssl.org>2017-02-27 20:54:39 +0000
committerMatt Caswell <matt@openssl.org>2017-03-02 17:44:16 +0000
commit3eaa4170956dc7ca2a0c9fc9414dc42cac7b426e (patch)
treef6bf071d3d4d4b493810a8f38e463d1112cd15c5 /ssl/statem/statem.c
parent5f9820380ff82fc07e93e430b97da516997d3771 (diff)
Make SSL_write_early_finish() an internal only function
Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/2737)
Diffstat (limited to 'ssl/statem/statem.c')
-rw-r--r--ssl/statem/statem.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/ssl/statem/statem.c b/ssl/statem/statem.c
index 8a251ea1e7..11cbe551a6 100644
--- a/ssl/statem/statem.c
+++ b/ssl/statem/statem.c
@@ -168,9 +168,21 @@ int ossl_statem_skip_early_data(SSL *s)
return 1;
}
+/*
+ * Called when we are in SSL_read*(), SSL_write*(), or SSL_accept()
+ * /SSL_connect()/SSL_do_handshake(). Used to test whether we are in an early
+ * data state and whether we should attempt to move the handshake on if so.
+ * |send| is 1 if we are attempting to send data (SSL_write*()), 0 if we are
+ * attempting to read data (SSL_read*()), or -1 if we are in SSL_do_handshake()
+ * or similar.
+ */
void ossl_statem_check_finish_init(SSL *s, int send)
{
- if (!s->server) {
+ if (send == -1) {
+ if (s->statem.hand_state == TLS_ST_PENDING_EARLY_DATA_END
+ || s->statem.hand_state == TLS_ST_EARLY_DATA)
+ ossl_statem_set_in_init(s, 1);
+ } else if (!s->server) {
if ((send && s->statem.hand_state == TLS_ST_PENDING_EARLY_DATA_END
&& s->early_data_state != SSL_EARLY_DATA_WRITING)
|| (!send && s->statem.hand_state == TLS_ST_EARLY_DATA))