Fixing TLS 1.3 Go Handshake Bugs.
Change-Id: I2f5c45e0e491f9dd25c2463710697599fea708ed
Reviewed-on: https://boringssl-review.googlesource.com/8794
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>
diff --git a/ssl/test/runner/handshake_server.go b/ssl/test/runner/handshake_server.go
index f6bf0db..2cdfbee 100644
--- a/ssl/test/runner/handshake_server.go
+++ b/ssl/test/runner/handshake_server.go
@@ -324,6 +324,10 @@
}
hs.hello.cipherSuite = hs.suite.id
+ if c.config.Bugs.SendCipherSuite != 0 {
+ hs.hello.cipherSuite = c.config.Bugs.SendCipherSuite
+ }
+
hs.finishedHash = newFinishedHash(c.vers, hs.suite)
hs.finishedHash.discardHandshakeBuffer()
hs.writeClientHash(hs.clientHello.marshal())
@@ -367,8 +371,17 @@
return err
}
hs.hello.hasKeyShare = true
+
+ curveID := selectedKeyShare.group
+ if c.config.Bugs.SendCurve != 0 {
+ curveID = config.Bugs.SendCurve
+ }
+ if c.config.Bugs.InvalidECDHPoint {
+ publicKey[0] ^= 0xff
+ }
+
hs.hello.keyShare = keyShareEntry{
- group: selectedKeyShare.group,
+ group: curveID,
keyExchange: publicKey,
}
} else {
@@ -460,6 +473,10 @@
return err
}
+ if config.Bugs.SendSignatureAlgorithm != 0 {
+ certVerify.signatureAlgorithm = config.Bugs.SendSignatureAlgorithm
+ }
+
hs.writeServerHash(certVerify.marshal())
c.writeRecord(recordTypeHandshake, certVerify.marshal())
}