Run record padding tests in DTLS 1.3 as well Other than the outer record layer, this applies to DTLS as well. Bug: 42290594 Change-Id: I2c4ab6950e82aa1bbd4997f56de60f23309280c2 Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/73887 Reviewed-by: Nick Harper <nharper@chromium.org> Commit-Queue: David Benjamin <davidben@google.com>
diff --git a/ssl/test/runner/runner.go b/ssl/test/runner/runner.go index f6b545a..4577118 100644 --- a/ssl/test/runner/runner.go +++ b/ssl/test/runner/runner.go
@@ -13845,56 +13845,64 @@ } func addTLS13RecordTests() { - testCases = append(testCases, testCase{ - name: "TLS13-RecordPadding", - config: Config{ - MaxVersion: VersionTLS13, - MinVersion: VersionTLS13, - Bugs: ProtocolBugs{ - RecordPadding: 10, + for _, protocol := range []protocol{tls, dtls} { + testCases = append(testCases, testCase{ + protocol: protocol, + name: "TLS13-RecordPadding-" + protocol.String(), + config: Config{ + MaxVersion: VersionTLS13, + MinVersion: VersionTLS13, + Bugs: ProtocolBugs{ + RecordPadding: 10, + }, }, - }, - }) + }) - testCases = append(testCases, testCase{ - name: "TLS13-EmptyRecords", - config: Config{ - MaxVersion: VersionTLS13, - MinVersion: VersionTLS13, - Bugs: ProtocolBugs{ - OmitRecordContents: true, + testCases = append(testCases, testCase{ + protocol: protocol, + name: "TLS13-EmptyRecords-" + protocol.String(), + config: Config{ + MaxVersion: VersionTLS13, + MinVersion: VersionTLS13, + Bugs: ProtocolBugs{ + OmitRecordContents: true, + }, }, - }, - shouldFail: true, - expectedError: ":DECRYPTION_FAILED_OR_BAD_RECORD_MAC:", - }) + shouldFail: true, + expectedError: ":DECRYPTION_FAILED_OR_BAD_RECORD_MAC:", + }) - testCases = append(testCases, testCase{ - name: "TLS13-OnlyPadding", - config: Config{ - MaxVersion: VersionTLS13, - MinVersion: VersionTLS13, - Bugs: ProtocolBugs{ - OmitRecordContents: true, - RecordPadding: 10, + testCases = append(testCases, testCase{ + protocol: protocol, + name: "TLS13-OnlyPadding-" + protocol.String(), + config: Config{ + MaxVersion: VersionTLS13, + MinVersion: VersionTLS13, + Bugs: ProtocolBugs{ + OmitRecordContents: true, + RecordPadding: 10, + }, }, - }, - shouldFail: true, - expectedError: ":DECRYPTION_FAILED_OR_BAD_RECORD_MAC:", - }) + shouldFail: true, + expectedError: ":DECRYPTION_FAILED_OR_BAD_RECORD_MAC:", + }) - testCases = append(testCases, testCase{ - name: "TLS13-WrongOuterRecord", - config: Config{ - MaxVersion: VersionTLS13, - MinVersion: VersionTLS13, - Bugs: ProtocolBugs{ - OuterRecordType: recordTypeHandshake, - }, - }, - shouldFail: true, - expectedError: ":INVALID_OUTER_RECORD_TYPE:", - }) + if protocol == tls { + testCases = append(testCases, testCase{ + protocol: protocol, + name: "TLS13-WrongOuterRecord-" + protocol.String(), + config: Config{ + MaxVersion: VersionTLS13, + MinVersion: VersionTLS13, + Bugs: ProtocolBugs{ + OuterRecordType: recordTypeHandshake, + }, + }, + shouldFail: true, + expectedError: ":INVALID_OUTER_RECORD_TYPE:", + }) + } + } } func addSessionTicketTests() {