diff options
author | Nikos Mavrogiannopoulos <nmav@redhat.com> | 2017-11-07 16:09:12 +0100 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@redhat.com> | 2018-02-19 15:29:36 +0100 |
commit | 395db8ece1e12664937bbca37c29a246e59d27f4 (patch) | |
tree | 1870e6dfd3df95e9e7497b9d0cefe7b88627034c /lib | |
parent | ab839c29bcc774642b1dc6d8ed95ccbf12f8ac01 (diff) | |
download | gnutls-395db8ece1e12664937bbca37c29a246e59d27f4.tar.gz |
handshake: false start flag merged with hsk_flags
Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gnutls_int.h | 3 | ||||
-rw-r--r-- | lib/handshake.c | 4 | ||||
-rw-r--r-- | lib/state.c | 2 |
3 files changed, 3 insertions, 6 deletions
diff --git a/lib/gnutls_int.h b/lib/gnutls_int.h index 68ca48dcc3..750da73ad6 100644 --- a/lib/gnutls_int.h +++ b/lib/gnutls_int.h @@ -1145,6 +1145,7 @@ typedef struct { #define HSK_CRT_REQ_SENT (1<<5) #define HSK_CRT_REQ_GOT_SIG_ALGO (1<<6) #define HSK_KEY_UPDATE_ASKED (1<<7) /* flag is not used during handshake */ +#define HSK_FALSE_START_USED (1<<8) /* TLS1.2 only */ unsigned hsk_flags; time_t last_key_update; @@ -1195,8 +1196,6 @@ typedef struct { char saved_username[MAX_USERNAME_SIZE+1]; bool saved_username_set; - bool false_start_used; /* non-zero if false start was used for appdata */ - /* Needed for TCP Fast Open (TFO), set by gnutls_transport_set_fastopen() */ tfo_st tfo; diff --git a/lib/handshake.c b/lib/handshake.c index 559e115528..d1a249f30b 100644 --- a/lib/handshake.c +++ b/lib/handshake.c @@ -2726,7 +2726,7 @@ static int handshake_client(gnutls_session_t session) case STATE17: STATE = STATE17; if (session->internals.resumed == RESUME_FALSE && (session->internals.flags & GNUTLS_ENABLE_FALSE_START) && can_send_false_start(session)) { - session->internals.false_start_used = 1; + session->internals.hsk_flags |= HSK_FALSE_START_USED; session->internals.recv_state = RECV_STATE_FALSE_START; /* complete this phase of the handshake. We * should be called again by gnutls_record_recv() @@ -2735,8 +2735,6 @@ static int handshake_client(gnutls_session_t session) gnutls_assert(); return 0; - } else { - session->internals.false_start_used = 0; } /* fall through */ case STATE18: diff --git a/lib/state.c b/lib/state.c index 09fd478494..8bd81b8c48 100644 --- a/lib/state.c +++ b/lib/state.c @@ -1294,7 +1294,7 @@ unsigned gnutls_session_get_flags(gnutls_session_t session) flags |= GNUTLS_SFLAGS_HB_LOCAL_SEND; if (gnutls_heartbeat_allowed(session, GNUTLS_HB_PEER_ALLOWED_TO_SEND)) flags |= GNUTLS_SFLAGS_HB_PEER_SEND; - if (session->internals.false_start_used) + if (session->internals.hsk_flags & HSK_FALSE_START_USED) flags |= GNUTLS_SFLAGS_FALSE_START; if (session->internals.used_ffdhe) flags |= GNUTLS_SFLAGS_RFC7919; |