runner: Fix writeClientHash and writeRecord ordering.

Per the comment in writeClientHash, we should writeClientHash before
writeRecord to get the sequence numbers right. Some of the client HRR
bits are still wrong, but I'll fix those as part of tidying up the HRR
path in a later commit.

(This doesn't actually matter because only DTLS uses sequence numbers,
and we don't support DTLS 1.3.)

Change-Id: I4cbc671f524d56c7f970b5ec0bceeb2641625d15
Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/46624
Commit-Queue: David Benjamin <davidben@google.com>
Reviewed-by: Adam Langley <agl@google.com>
diff --git a/ssl/test/runner/handshake_client.go b/ssl/test/runner/handshake_client.go
index 4a67693..2f36191 100644
--- a/ssl/test/runner/handshake_client.go
+++ b/ssl/test/runner/handshake_client.go
@@ -1144,13 +1144,13 @@
 		}
 		endOfEarlyData := new(endOfEarlyDataMsg)
 		endOfEarlyData.nonEmpty = c.config.Bugs.NonEmptyEndOfEarlyData
+		hs.writeClientHash(endOfEarlyData.marshal())
 		if c.config.Bugs.PartialEndOfEarlyDataWithClientHello {
 			// The first byte has already been sent.
 			c.writeRecord(recordTypeHandshake, endOfEarlyData.marshal()[1:])
 		} else {
 			c.writeRecord(recordTypeHandshake, endOfEarlyData.marshal())
 		}
-		hs.writeClientHash(endOfEarlyData.marshal())
 	}
 
 	if !c.config.Bugs.SkipChangeCipherSpec && !hs.hello.hasEarlyData {