Add a test for missing end_of_early_data.
BUG=76 Change-Id: I43672ee82a50f8fe706a5d607ef774a6e96db252 Reviewed-on: https://boringssl-review.googlesource.com/14379 Reviewed-by: David Benjamin <davidben@google.com> Commit-Queue: David Benjamin <davidben@google.com> CQ-Verified: CQ bot account: commit-bot@chromium.org <commit-bot@chromium.org>
This commit is contained in:
parent
81a191dc4d
commit
32c8927159
@ -533,6 +533,10 @@ type ProtocolBugs struct {
|
||||
// message.
|
||||
SkipFinished bool
|
||||
|
||||
// SkipEndOfEarlyData causes the implementation to skip the
|
||||
// end_of_early_data alert.
|
||||
SkipEndOfEarlyData bool
|
||||
|
||||
// EarlyChangeCipherSpec causes the client to send an early
|
||||
// ChangeCipherSpec message before the ClientKeyExchange. A value of
|
||||
// zero disables this behavior. One and two configure variants for 0.9.8
|
||||
|
@ -891,7 +891,7 @@ func (hs *clientHandshakeState) doTLS13Handshake() error {
|
||||
|
||||
// Send EndOfEarlyData and then switch write key to handshake
|
||||
// traffic key.
|
||||
if c.out.cipher != nil {
|
||||
if c.out.cipher != nil && !c.config.Bugs.SkipEndOfEarlyData {
|
||||
c.sendAlert(alertEndOfEarlyData)
|
||||
}
|
||||
c.out.useTrafficSecret(c.vers, hs.suite, clientHandshakeTrafficSecret, clientWrite)
|
||||
|
@ -10380,6 +10380,25 @@ func addTLS13HandshakeTests() {
|
||||
},
|
||||
})
|
||||
|
||||
// Test that the server rejects 0-RTT streams without end_of_early_data.
|
||||
// The subsequent records should fail to decrypt.
|
||||
testCases = append(testCases, testCase{
|
||||
testType: serverTest,
|
||||
name: "TLS13-EarlyData-SkipEndOfEarlyData",
|
||||
config: Config{
|
||||
MaxVersion: VersionTLS13,
|
||||
Bugs: ProtocolBugs{
|
||||
SendEarlyData: [][]byte{},
|
||||
ExpectEarlyDataAccepted: true,
|
||||
SkipEndOfEarlyData: true,
|
||||
},
|
||||
},
|
||||
resumeSession: true,
|
||||
flags: []string{"-enable-early-data"},
|
||||
shouldFail: true,
|
||||
expectedLocalError: "remote error: bad record MAC",
|
||||
expectedError: ":BAD_DECRYPT:",
|
||||
})
|
||||
}
|
||||
|
||||
func addTLS13CipherPreferenceTests() {
|
||||
|
Loading…
Reference in New Issue
Block a user