Commit 3626ed03 authored by Dr. Stephen Henson's avatar Dr. Stephen Henson Committed by Matt Caswell
Browse files

Add and use function test_pem to work out test filenames.

parent 6fc37bee
Loading
Loading
Loading
Loading
+6 −8
Original line number Diff line number Diff line
@@ -19,8 +19,6 @@ push @is_disabled, anydisabled("ssl3", "tls1", "tls1_1", "tls1_2");

our @tests = ();

my $dir_sep = $^O ne "VMS" ? "/" : "";

sub generate_tests() {

    foreach (0..$#protocols) {
@@ -68,7 +66,7 @@ sub generate_tests() {
                server => {
                    "MinProtocol" => $protocol,
                    "MaxProtocol" => $protocol,
                    "VerifyCAFile" => "\${ENV::TEST_CERTS_DIR}${dir_sep}root-cert.pem",
                    "VerifyCAFile" => test_pem("root-cert.pem"),
                    "VerifyMode" => "Require",
                },
                client => {
@@ -87,14 +85,14 @@ sub generate_tests() {
                server => {
                    "MinProtocol" => $protocol,
                    "MaxProtocol" => $protocol,
                    "VerifyCAFile" => "\${ENV::TEST_CERTS_DIR}${dir_sep}root-cert.pem",
                    "VerifyCAFile" => test_pem("root-cert.pem"),
                    "VerifyMode" => "Request",
                },
                client => {
                    "MinProtocol" => $protocol,
                    "MaxProtocol" => $protocol,
                    "Certificate" => "\${ENV::TEST_CERTS_DIR}${dir_sep}ee-client-chain.pem",
                    "PrivateKey"  => "\${ENV::TEST_CERTS_DIR}${dir_sep}ee-key.pem",
                    "Certificate" => test_pem("ee-client-chain.pem"),
                    "PrivateKey"  => test_pem("ee-key.pem"),
                },
                test   => { "ExpectedResult" => "Success" },
            };
@@ -110,8 +108,8 @@ sub generate_tests() {
                client => {
                    "MinProtocol" => $protocol,
                    "MaxProtocol" => $protocol,
                    "Certificate" => "\${ENV::TEST_CERTS_DIR}${dir_sep}ee-client-chain.pem",
                    "PrivateKey"  => "\${ENV::TEST_CERTS_DIR}${dir_sep}ee-key.pem",
                    "Certificate" => test_pem("ee-client-chain.pem"),
                    "PrivateKey"  => test_pem("ee-key.pem"),
                },
                test   => {
                    "ExpectedResult" => "ServerFail",
+6 −8
Original line number Diff line number Diff line
@@ -15,8 +15,6 @@ use warnings;
package ssltests;
use OpenSSL::Test::Utils;

my $dir_sep = $^O ne "VMS" ? "/" : "";

our @tests = (
    {
        name => "renegotiate-client-no-resume",
@@ -71,12 +69,12 @@ our @tests = (
        server => {
            "Options" => "NoResumptionOnRenegotiation",
            "MaxProtocol" => "TLSv1.2",
            "VerifyCAFile" => "\${ENV::TEST_CERTS_DIR}${dir_sep}root-cert.pem",
            "VerifyCAFile" => test_pem("root-cert.pem"),
            "VerifyMode" => "Require",
        },
        client => {
            "Certificate" => "\${ENV::TEST_CERTS_DIR}${dir_sep}ee-client-chain.pem",
            "PrivateKey"  => "\${ENV::TEST_CERTS_DIR}${dir_sep}ee-key.pem"
            "Certificate" => test_pem("ee-client-chain.pem"),
            "PrivateKey"  => test_pem("ee-key.pem"),
        },
        test => {
            "Method" => "TLS",
@@ -90,12 +88,12 @@ our @tests = (
        server => {
            "Options" => "NoResumptionOnRenegotiation",
            "MaxProtocol" => "TLSv1.2",
            "VerifyCAFile" => "\${ENV::TEST_CERTS_DIR}${dir_sep}root-cert.pem",
            "VerifyCAFile" => test_pem("root-cert.pem"),
            "VerifyMode" => "Once",
        },
        client => {
            "Certificate" => "\${ENV::TEST_CERTS_DIR}${dir_sep}ee-client-chain.pem",
            "PrivateKey"  => "\${ENV::TEST_CERTS_DIR}${dir_sep}ee-key.pem"
            "Certificate" => test_pem("ee-client-chain.pem"),
            "PrivateKey"  => test_pem("ee-key.pem"),
        },
        test => {
            "Method" => "TLS",
+6 −8
Original line number Diff line number Diff line
@@ -15,8 +15,6 @@ use warnings;
package ssltests;
use OpenSSL::Test::Utils;

my $dir_sep = $^O ne "VMS" ? "/" : "";

our @tests = (
    {
        name => "renegotiate-client-no-resume",
@@ -65,12 +63,12 @@ our @tests = (
    {
        name => "renegotiate-client-auth-require",
        server => {
            "VerifyCAFile" => "\${ENV::TEST_CERTS_DIR}${dir_sep}root-cert.pem",
            "VerifyCAFile" => test_pem("root-cert.pem"),
            "VerifyMode" => "Require",
        },
        client => {
            "Certificate" => "\${ENV::TEST_CERTS_DIR}${dir_sep}ee-client-chain.pem",
            "PrivateKey"  => "\${ENV::TEST_CERTS_DIR}${dir_sep}ee-key.pem"
            "Certificate" => test_pem("ee-client-chain.pem"),
            "PrivateKey"  => test_pem("ee-key.pem"),
        },
        test => {
            "Method" => "DTLS",
@@ -82,12 +80,12 @@ our @tests = (
    {
        name => "renegotiate-client-auth-once",
        server => {
            "VerifyCAFile" => "\${ENV::TEST_CERTS_DIR}${dir_sep}root-cert.pem",
            "VerifyCAFile" => test_pem("root-cert.pem"),
            "VerifyMode" => "Once",
        },
        client => {
            "Certificate" => "\${ENV::TEST_CERTS_DIR}${dir_sep}ee-client-chain.pem",
            "PrivateKey"  => "\${ENV::TEST_CERTS_DIR}${dir_sep}ee-key.pem"
            "Certificate" => test_pem("ee-client-chain.pem"),
            "PrivateKey"  => test_pem("ee-key.pem"),
        },
        test => {
            "Method" => "DTLS",
+9 −4
Original line number Diff line number Diff line
@@ -10,16 +10,21 @@

package ssltests;

sub test_pem
{
    my ($file) = @_;
    my $dir_sep = $^O ne "VMS" ? "/" : "";
    return "\${ENV::TEST_CERTS_DIR}" . $dir_sep . $file,
}

our %base_server = (
    "Certificate" => "\${ENV::TEST_CERTS_DIR}${dir_sep}servercert.pem",
    "PrivateKey"  => "\${ENV::TEST_CERTS_DIR}${dir_sep}serverkey.pem",
    "Certificate" => test_pem("servercert.pem"),
    "PrivateKey"  => test_pem("serverkey.pem"),
    "CipherString" => "DEFAULT",
);

our %base_client = (
    "VerifyCAFile" => "\${ENV::TEST_CERTS_DIR}${dir_sep}rootcert.pem",
    "VerifyCAFile" => test_pem("rootcert.pem"),
    "VerifyMode" => "Peer",
    "CipherString" => "DEFAULT",
);