2017-01-12 22:52:31 +08:00
|
|
|
# -*- mode: perl; -*-
|
|
|
|
|
|
|
|
## SSL test configurations
|
|
|
|
|
|
|
|
|
|
|
|
use strict;
|
|
|
|
use warnings;
|
|
|
|
|
2017-02-01 21:29:45 +08:00
|
|
|
package ssltests;
|
|
|
|
use OpenSSL::Test::Utils;
|
2017-01-12 22:52:31 +08:00
|
|
|
|
|
|
|
my $dir_sep = $^O ne "VMS" ? "/" : "";
|
|
|
|
|
2017-02-16 06:16:09 +08:00
|
|
|
my $cert_dir = "\${ENV::TEST_CERTS_DIR}${dir_sep}";
|
|
|
|
|
2017-01-12 22:52:31 +08:00
|
|
|
my $server = {
|
2017-02-16 06:16:09 +08:00
|
|
|
"ECDSA.Certificate" => "${cert_dir}server-ecdsa-cert.pem",
|
|
|
|
"ECDSA.PrivateKey" => "${cert_dir}server-ecdsa-key.pem",
|
2017-01-12 22:52:31 +08:00
|
|
|
"MaxProtocol" => "TLSv1.2"
|
|
|
|
};
|
|
|
|
|
|
|
|
our @tests = (
|
|
|
|
{
|
|
|
|
name => "ECDSA CipherString Selection",
|
|
|
|
server => $server,
|
|
|
|
client => {
|
|
|
|
"CipherString" => "aECDSA",
|
|
|
|
},
|
|
|
|
test => {
|
|
|
|
"ExpectedServerCertType" =>, "P-256",
|
2017-01-27 23:56:47 +08:00
|
|
|
"ExpectedServerSignType" =>, "EC",
|
2017-01-12 22:52:31 +08:00
|
|
|
"ExpectedResult" => "Success"
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name => "RSA CipherString Selection",
|
|
|
|
server => $server,
|
|
|
|
client => {
|
|
|
|
"CipherString" => "aRSA",
|
|
|
|
},
|
|
|
|
test => {
|
|
|
|
"ExpectedServerCertType" =>, "RSA",
|
2017-01-27 23:56:47 +08:00
|
|
|
"ExpectedServerSignType" =>, "RSA-PSS",
|
2017-01-12 22:52:31 +08:00
|
|
|
"ExpectedResult" => "Success"
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name => "ECDSA CipherString Selection, no ECDSA certificate",
|
2017-02-02 20:34:22 +08:00
|
|
|
server => {
|
|
|
|
"MaxProtocol" => "TLSv1.2"
|
|
|
|
},
|
2017-01-12 22:52:31 +08:00
|
|
|
client => {
|
|
|
|
"CipherString" => "aECDSA"
|
|
|
|
},
|
|
|
|
test => {
|
|
|
|
"ExpectedResult" => "ServerFail"
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name => "ECDSA Signature Algorithm Selection",
|
|
|
|
server => $server,
|
|
|
|
client => {
|
|
|
|
"SignatureAlgorithms" => "ECDSA+SHA256",
|
|
|
|
},
|
|
|
|
test => {
|
2017-01-15 23:59:48 +08:00
|
|
|
"ExpectedServerCertType" => "P-256",
|
|
|
|
"ExpectedServerSignHash" => "SHA256",
|
2017-01-27 23:56:47 +08:00
|
|
|
"ExpectedServerSignType" => "EC",
|
2017-01-12 22:52:31 +08:00
|
|
|
"ExpectedResult" => "Success"
|
|
|
|
},
|
|
|
|
},
|
2017-02-01 21:29:45 +08:00
|
|
|
{
|
|
|
|
name => "ECDSA Signature Algorithm Selection SHA384",
|
|
|
|
server => $server,
|
|
|
|
client => {
|
|
|
|
"SignatureAlgorithms" => "ECDSA+SHA384",
|
|
|
|
},
|
|
|
|
test => {
|
|
|
|
"ExpectedServerCertType" => "P-256",
|
|
|
|
"ExpectedServerSignHash" => "SHA384",
|
|
|
|
"ExpectedServerSignType" => "EC",
|
|
|
|
"ExpectedResult" => "Success"
|
|
|
|
},
|
|
|
|
},
|
2017-01-12 22:52:31 +08:00
|
|
|
{
|
|
|
|
name => "ECDSA Signature Algorithm Selection, no ECDSA certificate",
|
2017-02-02 20:34:22 +08:00
|
|
|
server => {
|
|
|
|
"MaxProtocol" => "TLSv1.2"
|
|
|
|
},
|
2017-01-12 22:52:31 +08:00
|
|
|
client => {
|
|
|
|
"SignatureAlgorithms" => "ECDSA+SHA256",
|
|
|
|
},
|
|
|
|
test => {
|
|
|
|
"ExpectedResult" => "ServerFail"
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name => "RSA Signature Algorithm Selection",
|
|
|
|
server => $server,
|
|
|
|
client => {
|
|
|
|
"SignatureAlgorithms" => "RSA+SHA256",
|
|
|
|
},
|
|
|
|
test => {
|
2017-01-15 23:59:48 +08:00
|
|
|
"ExpectedServerCertType" => "RSA",
|
|
|
|
"ExpectedServerSignHash" => "SHA256",
|
2017-01-27 23:56:47 +08:00
|
|
|
"ExpectedServerSignType" => "RSA",
|
|
|
|
"ExpectedResult" => "Success"
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name => "RSA-PSS Signature Algorithm Selection",
|
|
|
|
server => $server,
|
|
|
|
client => {
|
|
|
|
"SignatureAlgorithms" => "RSA-PSS+SHA256",
|
|
|
|
},
|
|
|
|
test => {
|
|
|
|
"ExpectedServerCertType" => "RSA",
|
|
|
|
"ExpectedServerSignHash" => "SHA256",
|
|
|
|
"ExpectedServerSignType" => "RSA-PSS",
|
2017-01-12 22:52:31 +08:00
|
|
|
"ExpectedResult" => "Success"
|
|
|
|
},
|
|
|
|
}
|
|
|
|
);
|
2017-02-01 21:29:45 +08:00
|
|
|
|
|
|
|
|
|
|
|
my $server_tls_1_3 = {
|
2017-02-16 06:16:09 +08:00
|
|
|
"ECDSA.Certificate" => "${cert_dir}server-ecdsa-cert.pem",
|
|
|
|
"ECDSA.PrivateKey" => "${cert_dir}server-ecdsa-key.pem",
|
|
|
|
"MinProtocol" => "TLSv1.3",
|
|
|
|
"MaxProtocol" => "TLSv1.3"
|
|
|
|
};
|
|
|
|
|
|
|
|
my $client_tls_1_3 = {
|
|
|
|
"RSA.Certificate" => "${cert_dir}ee-client-chain.pem",
|
|
|
|
"RSA.PrivateKey" => "${cert_dir}ee-key.pem",
|
|
|
|
"ECDSA.Certificate" => "${cert_dir}ee-ecdsa-client-chain.pem",
|
|
|
|
"ECDSA.PrivateKey" => "${cert_dir}ee-ecdsa-key.pem",
|
2017-02-01 21:29:45 +08:00
|
|
|
"MinProtocol" => "TLSv1.3",
|
|
|
|
"MaxProtocol" => "TLSv1.3"
|
|
|
|
};
|
|
|
|
|
|
|
|
my @tests_tls_1_3 = (
|
|
|
|
{
|
|
|
|
name => "TLS 1.3 ECDSA Signature Algorithm Selection",
|
|
|
|
server => $server_tls_1_3,
|
|
|
|
client => {
|
|
|
|
"SignatureAlgorithms" => "ECDSA+SHA256",
|
|
|
|
},
|
|
|
|
test => {
|
|
|
|
"ExpectedServerCertType" => "P-256",
|
|
|
|
"ExpectedServerSignHash" => "SHA256",
|
|
|
|
"ExpectedServerSignType" => "EC",
|
|
|
|
"ExpectedResult" => "Success"
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name => "TLS 1.3 ECDSA Signature Algorithm Selection with PSS",
|
|
|
|
server => $server_tls_1_3,
|
|
|
|
client => {
|
|
|
|
"SignatureAlgorithms" => "ECDSA+SHA256:RSA-PSS+SHA256",
|
|
|
|
},
|
|
|
|
test => {
|
|
|
|
"ExpectedServerCertType" => "P-256",
|
|
|
|
"ExpectedServerSignHash" => "SHA256",
|
|
|
|
"ExpectedServerSignType" => "EC",
|
|
|
|
"ExpectedResult" => "Success"
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name => "TLS 1.3 RSA Signature Algorithm Selection SHA384 with PSS",
|
|
|
|
server => $server_tls_1_3,
|
|
|
|
client => {
|
|
|
|
"SignatureAlgorithms" => "ECDSA+SHA384:RSA-PSS+SHA384",
|
|
|
|
},
|
|
|
|
test => {
|
|
|
|
"ExpectedServerCertType" => "RSA",
|
|
|
|
"ExpectedServerSignHash" => "SHA384",
|
|
|
|
"ExpectedServerSignType" => "RSA-PSS",
|
|
|
|
"ExpectedResult" => "Success"
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name => "TLS 1.3 ECDSA Signature Algorithm Selection, no ECDSA certificate",
|
2017-02-02 20:34:22 +08:00
|
|
|
server => {
|
|
|
|
"MinProtocol" => "TLSv1.3",
|
|
|
|
"MaxProtocol" => "TLSv1.3"
|
|
|
|
},
|
2017-02-01 21:29:45 +08:00
|
|
|
client => {
|
|
|
|
"SignatureAlgorithms" => "ECDSA+SHA256",
|
|
|
|
},
|
|
|
|
test => {
|
|
|
|
"ExpectedResult" => "ServerFail"
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name => "TLS 1.3 RSA Signature Algorithm Selection, no PSS",
|
|
|
|
server => $server_tls_1_3,
|
|
|
|
client => {
|
|
|
|
"SignatureAlgorithms" => "RSA+SHA256",
|
|
|
|
},
|
|
|
|
test => {
|
|
|
|
"ExpectedResult" => "ServerFail"
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name => "TLS 1.3 RSA-PSS Signature Algorithm Selection",
|
|
|
|
server => $server_tls_1_3,
|
|
|
|
client => {
|
|
|
|
"SignatureAlgorithms" => "RSA-PSS+SHA256",
|
|
|
|
},
|
|
|
|
test => {
|
|
|
|
"ExpectedServerCertType" => "RSA",
|
|
|
|
"ExpectedServerSignHash" => "SHA256",
|
|
|
|
"ExpectedServerSignType" => "RSA-PSS",
|
|
|
|
"ExpectedResult" => "Success"
|
|
|
|
},
|
2017-02-16 06:16:09 +08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name => "TLS 1.3 RSA Client Auth Signature Algorithm Selection",
|
|
|
|
server => {
|
|
|
|
"ClientSignatureAlgorithms" => "PSS+SHA256",
|
|
|
|
"VerifyCAFile" => "${cert_dir}root-cert.pem",
|
|
|
|
"VerifyMode" => "Require"
|
|
|
|
},
|
|
|
|
client => $client_tls_1_3,
|
|
|
|
test => {
|
|
|
|
"ExpectedClientCertType" => "RSA",
|
|
|
|
"ExpectedClientSignHash" => "SHA256",
|
|
|
|
"ExpectedClientSignType" => "RSA-PSS",
|
|
|
|
"ExpectedResult" => "Success"
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name => "TLS 1.3 ECDSA Client Auth Signature Algorithm Selection",
|
|
|
|
server => {
|
|
|
|
"ClientSignatureAlgorithms" => "ECDSA+SHA256",
|
|
|
|
"VerifyCAFile" => "${cert_dir}root-cert.pem",
|
|
|
|
"VerifyMode" => "Require"
|
|
|
|
},
|
|
|
|
client => $client_tls_1_3,
|
|
|
|
test => {
|
|
|
|
"ExpectedClientCertType" => "P-256",
|
|
|
|
"ExpectedClientSignHash" => "SHA256",
|
|
|
|
"ExpectedClientSignType" => "EC",
|
|
|
|
"ExpectedResult" => "Success"
|
|
|
|
},
|
|
|
|
},
|
2017-02-01 21:29:45 +08:00
|
|
|
);
|
|
|
|
|
|
|
|
push @tests, @tests_tls_1_3 unless disabled("tls1_3");
|