Skip to content

Commit 04c1634

Browse files
taosodaenney
authored andcommitted
Separate session resumption diagrams
Make it clear that which flights will be used in session resumption. And fix some other comments.
1 parent cf3200f commit 04c1634

4 files changed

Lines changed: 19 additions & 9 deletions

File tree

flight.go

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ package dtls
77
purpose of timeout and retransmission.
88
https://tools.ietf.org/html/rfc4347#section-4.2.4
99
10-
Note: The flight4b and flight5b will be only used in session resumption.
10+
Message flights for full handshake:
1111
1212
Client Server
1313
------ ------
@@ -25,22 +25,32 @@ package dtls
2525
CertificateRequest* /
2626
<-------- ServerHelloDone /
2727
28-
ServerHello \
29-
[ChangeCipherSpec] Flight 4b
30-
<-------- Finished /
31-
3228
Certificate* \
3329
ClientKeyExchange \
3430
CertificateVerify* Flight 5
3531
[ChangeCipherSpec] /
3632
Finished --------> /
3733
34+
[ChangeCipherSpec] \ Flight 6
35+
<-------- Finished /
36+
37+
Message flights for session-resuming handshake (no cookie exchange):
38+
39+
Client Server
40+
------ ------
41+
Waiting Flight 0
42+
43+
ClientHello --------> Flight 1
44+
45+
ServerHello \
46+
[ChangeCipherSpec] Flight 4b
47+
<-------- Finished /
48+
3849
[ChangeCipherSpec] \ Flight 5b
3950
Finished --------> /
4051
4152
[ChangeCipherSpec] \ Flight 6
4253
<-------- Finished /
43-
4454
*/
4555

4656
type flightVal uint8

flight4bhandler.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ func flight4bParse(ctx context.Context, c flightConn, state *State, cache *hands
4545
return 0, &alert.Alert{Level: alert.Fatal, Description: alert.HandshakeFailure}, errVerifyDataMismatch
4646
}
4747

48-
// Other party retransmitted the last flight.
48+
// Other party may re-transmit the last flight. Keep state to be flight4b.
4949
return flight4b, nil, nil
5050
}
5151

flight5bhandler.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ func flight5bParse(ctx context.Context, c flightConn, state *State, cache *hands
2323
return 0, &alert.Alert{Level: alert.Fatal, Description: alert.InternalError}, nil
2424
}
2525

26-
// Other party retransmitted the last flight.
26+
// Other party may re-transmit the last flight. Keep state to be flight5b.
2727
return flight5b, nil, nil
2828
}
2929

flight6handler.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ func flight6Parse(ctx context.Context, c flightConn, state *State, cache *handsh
2323
return 0, &alert.Alert{Level: alert.Fatal, Description: alert.InternalError}, nil
2424
}
2525

26-
// Other party retransmitted the last flight.
26+
// Other party may re-transmit the last flight. Keep state to be flight6.
2727
return flight6, nil, nil
2828
}
2929

0 commit comments

Comments
 (0)