forked from openssl/openssl
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SSL tests: port CT tests, add a few more
This commit only ports existing tests, and adds some coverage for resumption. We don't appear to have any handshake tests that cover SCT validation success, and this commit doesn't change that. Reviewed-by: Rich Salz <[email protected]>
- Loading branch information
Showing
10 changed files
with
302 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,135 @@ | ||
# Generated with generate_ssl_tests.pl | ||
|
||
num_tests = 4 | ||
|
||
test-0 = 0-ct-permissive | ||
test-1 = 1-ct-strict | ||
test-2 = 2-ct-permissive-resumption | ||
test-3 = 3-ct-strict-resumption | ||
# =========================================================== | ||
|
||
[0-ct-permissive] | ||
ssl_conf = 0-ct-permissive-ssl | ||
|
||
[0-ct-permissive-ssl] | ||
server = 0-ct-permissive-server | ||
client = 0-ct-permissive-client | ||
|
||
[0-ct-permissive-server] | ||
Certificate = ${ENV::TEST_CERTS_DIR}/servercert.pem | ||
CipherString = DEFAULT | ||
PrivateKey = ${ENV::TEST_CERTS_DIR}/serverkey.pem | ||
|
||
[0-ct-permissive-client] | ||
CipherString = DEFAULT | ||
VerifyCAFile = ${ENV::TEST_CERTS_DIR}/rootcert.pem | ||
VerifyMode = Peer | ||
|
||
[test-0] | ||
ExpectedResult = Success | ||
client = 0-ct-permissive-client-extra | ||
|
||
[0-ct-permissive-client-extra] | ||
CTValidation = Permissive | ||
|
||
|
||
# =========================================================== | ||
|
||
[1-ct-strict] | ||
ssl_conf = 1-ct-strict-ssl | ||
|
||
[1-ct-strict-ssl] | ||
server = 1-ct-strict-server | ||
client = 1-ct-strict-client | ||
|
||
[1-ct-strict-server] | ||
Certificate = ${ENV::TEST_CERTS_DIR}/servercert.pem | ||
CipherString = DEFAULT | ||
PrivateKey = ${ENV::TEST_CERTS_DIR}/serverkey.pem | ||
|
||
[1-ct-strict-client] | ||
CipherString = DEFAULT | ||
VerifyCAFile = ${ENV::TEST_CERTS_DIR}/rootcert.pem | ||
VerifyMode = Peer | ||
|
||
[test-1] | ||
ExpectedClientAlert = HandshakeFailure | ||
ExpectedResult = ClientFail | ||
client = 1-ct-strict-client-extra | ||
|
||
[1-ct-strict-client-extra] | ||
CTValidation = Strict | ||
|
||
|
||
# =========================================================== | ||
|
||
[2-ct-permissive-resumption] | ||
ssl_conf = 2-ct-permissive-resumption-ssl | ||
|
||
[2-ct-permissive-resumption-ssl] | ||
server = 2-ct-permissive-resumption-server | ||
client = 2-ct-permissive-resumption-client | ||
resume-server = 2-ct-permissive-resumption-server | ||
resume-client = 2-ct-permissive-resumption-client | ||
|
||
[2-ct-permissive-resumption-server] | ||
Certificate = ${ENV::TEST_CERTS_DIR}/servercert.pem | ||
CipherString = DEFAULT | ||
PrivateKey = ${ENV::TEST_CERTS_DIR}/serverkey.pem | ||
|
||
[2-ct-permissive-resumption-client] | ||
CipherString = DEFAULT | ||
VerifyCAFile = ${ENV::TEST_CERTS_DIR}/rootcert.pem | ||
VerifyMode = Peer | ||
|
||
[test-2] | ||
ExpectedResult = Success | ||
HandshakeMode = Resume | ||
ResumptionExpected = Yes | ||
client = 2-ct-permissive-resumption-client-extra | ||
resume-client = 2-ct-permissive-resumption-client-extra | ||
|
||
[2-ct-permissive-resumption-client-extra] | ||
CTValidation = Permissive | ||
|
||
|
||
# =========================================================== | ||
|
||
[3-ct-strict-resumption] | ||
ssl_conf = 3-ct-strict-resumption-ssl | ||
|
||
[3-ct-strict-resumption-ssl] | ||
server = 3-ct-strict-resumption-server | ||
client = 3-ct-strict-resumption-client | ||
resume-server = 3-ct-strict-resumption-server | ||
resume-client = 3-ct-strict-resumption-resume-client | ||
|
||
[3-ct-strict-resumption-server] | ||
Certificate = ${ENV::TEST_CERTS_DIR}/servercert.pem | ||
CipherString = DEFAULT | ||
PrivateKey = ${ENV::TEST_CERTS_DIR}/serverkey.pem | ||
|
||
[3-ct-strict-resumption-client] | ||
CipherString = DEFAULT | ||
VerifyCAFile = ${ENV::TEST_CERTS_DIR}/rootcert.pem | ||
VerifyMode = Peer | ||
|
||
[3-ct-strict-resumption-resume-client] | ||
CipherString = DEFAULT | ||
VerifyCAFile = ${ENV::TEST_CERTS_DIR}/rootcert.pem | ||
VerifyMode = Peer | ||
|
||
[test-3] | ||
ExpectedResult = Success | ||
HandshakeMode = Resume | ||
ResumptionExpected = Yes | ||
client = 3-ct-strict-resumption-client-extra | ||
resume-client = 3-ct-strict-resumption-resume-client-extra | ||
|
||
[3-ct-strict-resumption-client-extra] | ||
CTValidation = Permissive | ||
|
||
[3-ct-strict-resumption-resume-client-extra] | ||
CTValidation = Strict | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
# -*- mode: perl; -*- | ||
# Copyright 2016-2016 The OpenSSL Project Authors. All Rights Reserved. | ||
# | ||
# Licensed under the OpenSSL license (the "License"). You may not use | ||
# this file except in compliance with the License. You can obtain a copy | ||
# in the file LICENSE in the source distribution or at | ||
# https://www.openssl.org/source/license.html | ||
|
||
|
||
## Test version negotiation | ||
|
||
use strict; | ||
use warnings; | ||
|
||
package ssltests; | ||
|
||
|
||
our @tests = ( | ||
# Currently only have tests for certs without SCTs. | ||
{ | ||
name => "ct-permissive", | ||
server => { }, | ||
client => { | ||
extra => { | ||
"CTValidation" => "Permissive", | ||
}, | ||
}, | ||
test => { | ||
"ExpectedResult" => "Success", | ||
}, | ||
}, | ||
{ | ||
name => "ct-strict", | ||
server => { }, | ||
client => { | ||
extra => { | ||
"CTValidation" => "Strict", | ||
}, | ||
}, | ||
test => { | ||
"ExpectedResult" => "ClientFail", | ||
"ExpectedClientAlert" => "HandshakeFailure", | ||
}, | ||
}, | ||
{ | ||
name => "ct-permissive-resumption", | ||
server => { }, | ||
client => { | ||
extra => { | ||
"CTValidation" => "Permissive", | ||
}, | ||
}, | ||
test => { | ||
"HandshakeMode" => "Resume", | ||
"ResumptionExpected" => "Yes", | ||
"ExpectedResult" => "Success", | ||
}, | ||
}, | ||
{ | ||
name => "ct-strict-resumption", | ||
server => { }, | ||
client => { | ||
extra => { | ||
"CTValidation" => "Permissive", | ||
}, | ||
}, | ||
# SCTs are not present during resumption, so the resumption | ||
# should succeed. | ||
resume_client => { | ||
extra => { | ||
"CTValidation" => "Strict", | ||
}, | ||
}, | ||
test => { | ||
"HandshakeMode" => "Resume", | ||
"ResumptionExpected" => "Yes", | ||
"ExpectedResult" => "Success", | ||
}, | ||
}, | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.