Run all state machine coverage tests on implicit handshake.

The tests all work fine under it except for tests where the shim shuts
down. (In those the shim calls SSL_shutdown as the first function, so it
wouldn't do anything useful.)

Change-Id: Ia2e811bb3c553a690df38d1fd7d3107ae7c9aa12
Reviewed-on: https://boringssl-review.googlesource.com/14366
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:
David Benjamin 2017-03-25 18:00:56 -05:00 committed by CQ bot account: commit-bot@chromium.org
parent f466cdb5e0
commit e3843d41b9

View File

@ -3394,9 +3394,11 @@ func addExtendedMasterSecretTests() {
} }
type stateMachineTestConfig struct { type stateMachineTestConfig struct {
protocol protocol protocol protocol
async bool async bool
splitHandshake, packHandshakeFlight bool splitHandshake bool
packHandshakeFlight bool
implicitHandshake bool
} }
// Adds tests that try to cover the range of the handshake state machine, under // Adds tests that try to cover the range of the handshake state machine, under
@ -3409,6 +3411,11 @@ func addAllStateMachineCoverageTests() {
protocol: protocol, protocol: protocol,
async: async, async: async,
}) })
addStateMachineCoverageTests(stateMachineTestConfig{
protocol: protocol,
async: async,
implicitHandshake: true,
})
addStateMachineCoverageTests(stateMachineTestConfig{ addStateMachineCoverageTests(stateMachineTestConfig{
protocol: protocol, protocol: protocol,
async: async, async: async,
@ -3459,14 +3466,6 @@ func addStateMachineCoverageTests(config stateMachineTestConfig) {
}, },
resumeSession: true, resumeSession: true,
}) })
tests = append(tests, testCase{
name: "Basic-Client-Implicit",
config: Config{
MaxVersion: VersionTLS12,
},
flags: []string{"-implicit-handshake"},
resumeSession: true,
})
tests = append(tests, testCase{ tests = append(tests, testCase{
testType: serverTest, testType: serverTest,
name: "Basic-Server", name: "Basic-Server",
@ -3489,15 +3488,6 @@ func addStateMachineCoverageTests(config stateMachineTestConfig) {
resumeSession: true, resumeSession: true,
flags: []string{"-expect-session-id"}, flags: []string{"-expect-session-id"},
}) })
tests = append(tests, testCase{
testType: serverTest,
name: "Basic-Server-Implicit",
config: Config{
MaxVersion: VersionTLS12,
},
flags: []string{"-implicit-handshake"},
resumeSession: true,
})
tests = append(tests, testCase{ tests = append(tests, testCase{
testType: serverTest, testType: serverTest,
name: "Basic-Server-EarlyCallback", name: "Basic-Server-EarlyCallback",
@ -4062,22 +4052,6 @@ func addStateMachineCoverageTests(config stateMachineTestConfig) {
resumeSession: true, resumeSession: true,
}) })
// Client does False Start but doesn't explicitly call
// SSL_connect.
tests = append(tests, testCase{
name: "FalseStart-Implicit",
config: Config{
MaxVersion: VersionTLS12,
CipherSuites: []uint16{TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256},
NextProtos: []string{"foo"},
},
flags: []string{
"-implicit-handshake",
"-false-start",
"-advertise-alpn", "\x03foo",
},
})
// False Start without session tickets. // False Start without session tickets.
tests = append(tests, testCase{ tests = append(tests, testCase{
name: "FalseStart-SessionTicketsDisabled", name: "FalseStart-SessionTicketsDisabled",
@ -4211,22 +4185,25 @@ func addStateMachineCoverageTests(config stateMachineTestConfig) {
flags: []string{"-check-close-notify"}, flags: []string{"-check-close-notify"},
}) })
// Bidirectional shutdown with the shim initiating. The runner, if !config.implicitHandshake {
// in the meantime, sends garbage before the close_notify which // Bidirectional shutdown with the shim initiating. The runner,
// the shim must ignore. // in the meantime, sends garbage before the close_notify which
tests = append(tests, testCase{ // the shim must ignore. This test is disabled under implicit
name: "Shutdown-Shim", // handshake tests because the shim never reads or writes.
config: Config{ tests = append(tests, testCase{
MaxVersion: VersionTLS12, name: "Shutdown-Shim",
Bugs: ProtocolBugs{ config: Config{
ExpectCloseNotify: true, MaxVersion: VersionTLS12,
Bugs: ProtocolBugs{
ExpectCloseNotify: true,
},
}, },
}, shimShutsDown: true,
shimShutsDown: true, sendEmptyRecords: 1,
sendEmptyRecords: 1, sendWarningAlerts: 1,
sendWarningAlerts: 1, flags: []string{"-check-close-notify"},
flags: []string{"-check-close-notify"}, })
}) }
} else { } else {
// TODO(davidben): DTLS 1.3 will want a similar thing for // TODO(davidben): DTLS 1.3 will want a similar thing for
// HelloRetryRequest. // HelloRetryRequest.
@ -4264,6 +4241,10 @@ func addStateMachineCoverageTests(config stateMachineTestConfig) {
test.name += "-PackHandshakeFlight" test.name += "-PackHandshakeFlight"
test.config.Bugs.PackHandshakeFlight = true test.config.Bugs.PackHandshakeFlight = true
} }
if config.implicitHandshake {
test.name += "-ImplicitHandshake"
test.flags = append(test.flags, "-implicit-handshake")
}
testCases = append(testCases, test) testCases = append(testCases, test)
} }
} }