Regression test for CVE-2015-0291.

This is really just scar tissue with https://crbug.com/468889 being the real
underlying problem. But the test is pretty easy.

Change-Id: I5eca18fdcbde8665c0e6c3ac419a28152647d66f
Reviewed-on: https://boringssl-review.googlesource.com/4052
Reviewed-by: Adam Langley <agl@google.com>
This commit is contained in:
David Benjamin 2015-03-19 15:00:10 -04:00 committed by Adam Langley
parent b85a4c2923
commit 3c9746a6d7
3 changed files with 18 additions and 1 deletions

View File

@ -667,6 +667,10 @@ type ProtocolBugs struct {
// NeverResumeOnRenego, if true, causes renegotiations to always be full
// handshakes.
NeverResumeOnRenego bool
// NoSignatureAlgorithmsOnRenego, if true, causes renegotiations to omit
// the signature_algorithms extension.
NoSignatureAlgorithmsOnRenego bool
}
func (c *Config) serverInit() {

View File

@ -130,7 +130,7 @@ NextCipherSuite:
return errors.New("tls: short read from Rand: " + err.Error())
}
if hello.vers >= VersionTLS12 && !c.config.Bugs.NoSignatureAndHashes {
if hello.vers >= VersionTLS12 && !c.config.Bugs.NoSignatureAndHashes && (c.cipherSuite == 0 || !c.config.Bugs.NoSignatureAlgorithmsOnRenego) {
hello.signatureAndHashes = c.config.signatureAndHashesForClient()
}

View File

@ -2682,6 +2682,19 @@ func addRenegotiationTests() {
},
flags: []string{"-allow-unsafe-legacy-renegotiation"},
})
// Regression test for CVE-2015-0291.
testCases = append(testCases, testCase{
testType: serverTest,
name: "Renegotiate-Server-NoSignatureAlgorithms",
config: Config{
Bugs: ProtocolBugs{
NeverResumeOnRenego: true,
NoSignatureAlgorithmsOnRenego: true,
},
},
flags: []string{"-renegotiate"},
shimWritesFirst: true,
})
// TODO(agl): test the renegotiation info SCSV.
testCases = append(testCases, testCase{
name: "Renegotiate-Client",