summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorDr. Stephen Henson <steve@openssl.org>2017-02-16 15:27:49 +0000
committerMatt Caswell <matt@openssl.org>2017-04-26 16:33:41 +0100
commit3626ed03a6d13fa757d3327db2d5523072063132 (patch)
treebf7b94b472a9924187773744909c25db05cd2f90 /test
parent6fc37bee4a5f81d8f00e6ad45865b6b697163f06 (diff)
Add and use function test_pem to work out test filenames.
Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/3260)
Diffstat (limited to 'test')
-rw-r--r--test/ssl-tests/04-client_auth.conf.in14
-rw-r--r--test/ssl-tests/17-renegotiate.conf.in14
-rw-r--r--test/ssl-tests/18-dtls-renegotiate.conf.in14
-rw-r--r--test/ssl-tests/ssltests_base.pm13
4 files changed, 27 insertions, 28 deletions
diff --git a/test/ssl-tests/04-client_auth.conf.in b/test/ssl-tests/04-client_auth.conf.in
index cd3d42f416..8738aaa769 100644
--- a/test/ssl-tests/04-client_auth.conf.in
+++ b/test/ssl-tests/04-client_auth.conf.in
@@ -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",
diff --git a/test/ssl-tests/17-renegotiate.conf.in b/test/ssl-tests/17-renegotiate.conf.in
index c919a16f54..d0a407437b 100644
--- a/test/ssl-tests/17-renegotiate.conf.in
+++ b/test/ssl-tests/17-renegotiate.conf.in
@@ -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",
diff --git a/test/ssl-tests/18-dtls-renegotiate.conf.in b/test/ssl-tests/18-dtls-renegotiate.conf.in
index f32ab37480..7a65a85618 100644
--- a/test/ssl-tests/18-dtls-renegotiate.conf.in
+++ b/test/ssl-tests/18-dtls-renegotiate.conf.in
@@ -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",
diff --git a/test/ssl-tests/ssltests_base.pm b/test/ssl-tests/ssltests_base.pm
index 303224a3d9..dc816429b4 100644
--- a/test/ssl-tests/ssltests_base.pm
+++ b/test/ssl-tests/ssltests_base.pm
@@ -10,16 +10,21 @@
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",
);