X-Git-Url: https://git.openssl.org/?a=blobdiff_plain;f=test%2Fgenerate_ssl_tests.pl;h=fd785b7bc687bc1c8ff987fec8669db54c14cadf;hb=7ee8627f6eb7cf63b34d2701d76bb66f6db811e5;hp=713fb3f7c2269043cc37f9526d6b813f4de63bbf;hpb=453dfd8d5ee0893146e0fb61a5978ab59ba95c01;p=openssl.git diff --git a/test/generate_ssl_tests.pl b/test/generate_ssl_tests.pl index 713fb3f7c2..fd785b7bc6 100644 --- a/test/generate_ssl_tests.pl +++ b/test/generate_ssl_tests.pl @@ -1,5 +1,10 @@ -#! /usr/bin/perl -# -*- mode: perl; -*- +#! /usr/bin/env perl +# Copyright 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 ## SSL testcase generator @@ -38,7 +43,40 @@ sub print_templates { # Add the implicit base configuration. foreach my $test (@ssltests::tests) { $test->{"server"} = { (%ssltests::base_server, %{$test->{"server"}}) }; + if (defined $test->{"server2"}) { + $test->{"server2"} = { (%ssltests::base_server, %{$test->{"server2"}}) }; + } else { + if ($test->{"server"}->{"extra"} && + defined $test->{"server"}->{"extra"}->{"ServerNameCallback"}) { + # Default is the same as server. + $test->{"reuse_server2"} = 1; + } + # Do not emit an empty/duplicate "server2" section. + $test->{"server2"} = { }; + } + if (defined $test->{"resume_server"}) { + $test->{"resume_server"} = { (%ssltests::base_server, %{$test->{"resume_server"}}) }; + } else { + if (defined $test->{"test"}->{"HandshakeMode"} && + $test->{"test"}->{"HandshakeMode"} eq "Resume") { + # Default is the same as server. + $test->{"reuse_resume_server"} = 1; + } + # Do not emit an empty/duplicate "resume-server" section. + $test->{"resume_server"} = { }; + } $test->{"client"} = { (%ssltests::base_client, %{$test->{"client"}}) }; + if (defined $test->{"resume_client"}) { + $test->{"resume_client"} = { (%ssltests::base_client, %{$test->{"resume_client"}}) }; + } else { + if (defined $test->{"test"}->{"HandshakeMode"} && + $test->{"test"}->{"HandshakeMode"} eq "Resume") { + # Default is the same as client. + $test->{"reuse_resume_client"} = 1; + } + # Do not emit an empty/duplicate "resume-client" section. + $test->{"resume_client"} = { }; + } } # ssl_test expects to find a @@ -87,8 +125,7 @@ sub print_templates { # Shamelessly copied from Configure. sub read_config { my $fname = shift; - open(INPUT, "< $fname") - or die "Can't open input file '$fname'!\n"; + open(INPUT, "< $fname") or die "Can't open input file '$fname'!\n"; local $/ = undef; my $content = ; close(INPUT);