summaryrefslogtreecommitdiff
path: root/lib/gnutls_int.h
diff options
context:
space:
mode:
authorDaiki Ueno <dueno@redhat.com>2018-10-12 11:45:59 +0200
committerDaiki Ueno <dueno@redhat.com>2018-11-11 07:03:43 +0100
commit957f7537604b21653c0d456e55fabed600052508 (patch)
tree0e818d620669b1efe8f024eb1e4caf3f1d4217bd /lib/gnutls_int.h
parentf39af59c4e7f7062b548c6c97e785bb6b6284371 (diff)
downloadgnutls-957f7537604b21653c0d456e55fabed600052508.tar.gz
handshake: handle early data
This plumbers early data handling in the handshake processes, which consists of: - traffic key updates taking into account of client_early_traffic_secret - early data buffering in both server and client - the EndOfEarlyData message handling - making use of max_early_data_size extension in NewSessionTicket Signed-off-by: Daiki Ueno <dueno@redhat.com>
Diffstat (limited to 'lib/gnutls_int.h')
-rw-r--r--lib/gnutls_int.h18
1 files changed, 14 insertions, 4 deletions
diff --git a/lib/gnutls_int.h b/lib/gnutls_int.h
index 6fc3672f34..7a3ecee958 100644
--- a/lib/gnutls_int.h
+++ b/lib/gnutls_int.h
@@ -169,7 +169,8 @@ typedef enum hs_stage_t {
STAGE_HS,
STAGE_APP,
STAGE_UPD_OURS,
- STAGE_UPD_PEERS
+ STAGE_UPD_PEERS,
+ STAGE_EARLY
} hs_stage_t;
typedef enum record_send_state_t {
@@ -272,7 +273,7 @@ typedef enum handshake_state_t { STATE0 = 0, STATE1, STATE2,
STATE90=90, STATE91, STATE92, STATE93, STATE94, STATE99=99,
STATE100=100, STATE101, STATE102, STATE103, STATE104,
STATE105, STATE106, STATE107, STATE108, STATE109, STATE110,
- STATE111, STATE112, STATE113, STATE114,
+ STATE111, STATE112, STATE113, STATE114, STATE115,
STATE150 /* key update */
} handshake_state_t;
@@ -538,6 +539,7 @@ struct gnutls_key_st {
* early_secret, client_early_traffic_secret, ... */
uint8_t temp_secret[MAX_HASH_SIZE];
unsigned temp_secret_size; /* depends on negotiated PRF size */
+ uint8_t e_ckey[MAX_HASH_SIZE]; /* client_early_traffic_secret */
uint8_t hs_ckey[MAX_HASH_SIZE]; /* client_hs_traffic_secret */
uint8_t hs_skey[MAX_HASH_SIZE]; /* server_hs_traffic_secret */
uint8_t ap_ckey[MAX_HASH_SIZE]; /* client_ap_traffic_secret */
@@ -1160,6 +1162,9 @@ typedef struct {
* send.
*/
+ mbuffer_head_st early_data_recv_buffer;
+ gnutls_buffer_st early_data_presend_buffer;
+
record_send_state_t rsend_state;
/* buffer used temporarily during key update */
gnutls_buffer_st record_key_update_buffer;
@@ -1342,8 +1347,13 @@ typedef struct {
*/
#define HSK_TICKET_RECEIVED (1<<20) /* client: a session ticket was received */
#define HSK_EARLY_START_USED (1<<21)
-#define HSK_EARLY_DATA_IN_FLIGHT (1<<22) /* server: early_data extension was seen in ClientHello */
-#define HSK_RECORD_SIZE_LIMIT_NEGOTIATED (1<<23)
+#define HSK_EARLY_DATA_IN_FLIGHT (1<<22) /* client: sent early_data extension in ClientHello
+ * server: early_data extension was seen in ClientHello
+ */
+#define HSK_EARLY_DATA_ACCEPTED (1<<23) /* client: early_data extension was seen in EncryptedExtensions
+ * server: intend to process early data
+ */
+#define HSK_RECORD_SIZE_LIMIT_NEGOTIATED (1<<24)
/* The hsk_flags are for use within the ongoing handshake;
* they are reset to zero prior to handshake start by gnutls_handshake. */