Add and use function test_pem to work out test filenames.
authorDr. Stephen Henson <steve@openssl.org>
Thu, 16 Feb 2017 15:27:49 +0000 (15:27 +0000)
committerMatt Caswell <matt@openssl.org>
Wed, 26 Apr 2017 15:33:41 +0000 (16:33 +0100)
Reviewed-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/3260)

test/ssl-tests/04-client_auth.conf.in
test/ssl-tests/17-renegotiate.conf.in
test/ssl-tests/18-dtls-renegotiate.conf.in
test/ssl-tests/ssltests_base.pm

index cd3d42f41628fa30e1be3d1416fed386fec2737f..8738aaa769662f926f59dfa84bead4efc26c3f9b 100644 (file)
@@ -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",
index c919a16f54abf934a949054eb6d15cd3387c58ea..d0a407437bd25b306eec1bfc791b1c875345ed84 100644 (file)
@@ -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",
index f32ab374807ee495da8d5eadea346f21d13319a3..7a65a85618b5a3e82c1df442e8eebf6145d97c58 100644 (file)
@@ -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",
index 303224a3d92b878499e3afb62e7349d8390dc0ea..dc816429b46a5c001cab29b11666c75bc6f84693 100644 (file)
 
 package ssltests;
 
-my $dir_sep = $^O ne "VMS" ? "/" : "";
+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",
 );