Slightly simplify V2ClientHello sniffing.

Rather than sniff for ClientHello, just fall through to standard logic
once weird cases are resolved.

This means that garbage will now read as WRONG_VERSION rather than
UNKNOWN_PROTOCOL, but the rules here were slightly odd anyway. This also
means we'll now accept empty records before the ClientHello (up to the
empty record limit), and process records of the wrong type with the
usual codepath during the handshake.

This shouldn't be any more risk as it just makes the ClientHello more
consistent with the rest of the protocol. A TLS implementation that
doesn't parse V2ClientHello would do the same unless it still
special-cased the first record. All newly-exposed states are reachable
by fragmenting ClientHello by one byte and then sending the record in


Change-Id: Ib701ae5d8adb663e158c391639b232a9d9cd1c6e
Reviewed-by: Adam Langley <>
diff --git a/ssl/test/runner/runner.go b/ssl/test/runner/runner.go
index 2c01f15..49ada2a 100644
--- a/ssl/test/runner/runner.go
+++ b/ssl/test/runner/runner.go
@@ -1180,7 +1180,7 @@
 			name:          "Garbage",
 			sendPrefix:    "blah",
 			shouldFail:    true,
-			expectedError: ":UNKNOWN_PROTOCOL:",
+			expectedError: ":WRONG_VERSION_NUMBER:",
 			name: "SkipCipherVersionCheck",