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:
parent
f466cdb5e0
commit
e3843d41b9
@ -3396,7 +3396,9 @@ 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,9 +4185,11 @@ func addStateMachineCoverageTests(config stateMachineTestConfig) {
|
|||||||
flags: []string{"-check-close-notify"},
|
flags: []string{"-check-close-notify"},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
if !config.implicitHandshake {
|
||||||
// Bidirectional shutdown with the shim initiating. The runner,
|
// Bidirectional shutdown with the shim initiating. The runner,
|
||||||
// in the meantime, sends garbage before the close_notify which
|
// in the meantime, sends garbage before the close_notify which
|
||||||
// the shim must ignore.
|
// the shim must ignore. This test is disabled under implicit
|
||||||
|
// handshake tests because the shim never reads or writes.
|
||||||
tests = append(tests, testCase{
|
tests = append(tests, testCase{
|
||||||
name: "Shutdown-Shim",
|
name: "Shutdown-Shim",
|
||||||
config: Config{
|
config: Config{
|
||||||
@ -4227,6 +4203,7 @@ func addStateMachineCoverageTests(config stateMachineTestConfig) {
|
|||||||
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)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user