[openssl-commits] [openssl] master update

Richard Levitte levitte at openssl.org
Tue Aug 15 09:32:17 UTC 2017


The branch master has been updated
       via  8d2214c0a49584044d96b80e846ac8f6df35a0ad (commit)
       via  cb6afcd6ee0c0d66fae62e13fe5966171992f81c (commit)
      from  c4d2e483a39176a476c56d35879423fe6e33c0cd (commit)


- Log -----------------------------------------------------------------
commit 8d2214c0a49584044d96b80e846ac8f6df35a0ad
Author: Richard Levitte <levitte at openssl.org>
Date:   Tue Aug 1 22:43:56 2017 +0200

    File::Glob option ':bsd_glob' doesn't work everywhere, replace w/ a wrapper
    
    Reviewed-by: Andy Polyakov <appro at openssl.org>
    (Merged from https://github.com/openssl/openssl/pull/4069)

commit cb6afcd6ee0c0d66fae62e13fe5966171992f81c
Author: Richard Levitte <levitte at openssl.org>
Date:   Tue Aug 1 22:10:39 2017 +0200

    Consolidate the locations where we have our internal perl modules
    
    Instead of having perl modules under test/testlib, util and util/perl,
    consolidate them all to be inside util/perl.
    
    Reviewed-by: Andy Polyakov <appro at openssl.org>
    (Merged from https://github.com/openssl/openssl/pull/4069)

-----------------------------------------------------------------------

Summary of changes:
 Configure                                          | 11 +++++++----
 test/build.info                                    |  2 +-
 test/generate_ssl_tests.pl                         |  2 +-
 test/recipes/15-test_ecparam.t                     |  2 +-
 test/recipes/40-test_rehash.t                      |  2 +-
 test/recipes/80-test_ssl_new.t                     |  5 ++---
 test/recipes/99-test_fuzz.t                        |  2 +-
 test/recipes/tconversion.pl                        |  1 -
 test/run_tests.pl                                  |  9 +++++----
 util/dofile.pl                                     |  8 ++++++--
 util/mkdef.pl                                      |  4 +++-
 util/perl/OpenSSL/Glob.pm                          | 21 +++++++++++++++++++++
 {test/testlib => util/perl}/OpenSSL/Test.pm        |  0
 {test/testlib => util/perl}/OpenSSL/Test/Simple.pm |  0
 {test/testlib => util/perl}/OpenSSL/Test/Utils.pm  |  0
 util/{ => perl}/TLSProxy/Certificate.pm            |  0
 util/{ => perl}/TLSProxy/CertificateVerify.pm      |  0
 util/{ => perl}/TLSProxy/ClientHello.pm            |  0
 util/{ => perl}/TLSProxy/EncryptedExtensions.pm    |  0
 util/{ => perl}/TLSProxy/HelloRetryRequest.pm      |  0
 util/{ => perl}/TLSProxy/Message.pm                |  0
 util/{ => perl}/TLSProxy/NewSessionTicket.pm       |  0
 util/{ => perl}/TLSProxy/Proxy.pm                  |  0
 util/{ => perl}/TLSProxy/Record.pm                 |  0
 util/{ => perl}/TLSProxy/ServerHello.pm            |  0
 util/{ => perl}/TLSProxy/ServerKeyExchange.pm      |  0
 {test/testlib => util/perl}/checkhandshake.pm      |  0
 util/{ => perl}/with_fallback.pm                   |  3 ++-
 util/process_docs.pl                               |  4 +++-
 29 files changed, 54 insertions(+), 22 deletions(-)
 create mode 100644 util/perl/OpenSSL/Glob.pm
 rename {test/testlib => util/perl}/OpenSSL/Test.pm (100%)
 rename {test/testlib => util/perl}/OpenSSL/Test/Simple.pm (100%)
 rename {test/testlib => util/perl}/OpenSSL/Test/Utils.pm (100%)
 rename util/{ => perl}/TLSProxy/Certificate.pm (100%)
 rename util/{ => perl}/TLSProxy/CertificateVerify.pm (100%)
 rename util/{ => perl}/TLSProxy/ClientHello.pm (100%)
 rename util/{ => perl}/TLSProxy/EncryptedExtensions.pm (100%)
 rename util/{ => perl}/TLSProxy/HelloRetryRequest.pm (100%)
 rename util/{ => perl}/TLSProxy/Message.pm (100%)
 rename util/{ => perl}/TLSProxy/NewSessionTicket.pm (100%)
 rename util/{ => perl}/TLSProxy/Proxy.pm (100%)
 rename util/{ => perl}/TLSProxy/Record.pm (100%)
 rename util/{ => perl}/TLSProxy/ServerHello.pm (100%)
 rename util/{ => perl}/TLSProxy/ServerKeyExchange.pm (100%)
 rename {test/testlib => util/perl}/checkhandshake.pm (100%)
 rename util/{ => perl}/with_fallback.pm (83%)

diff --git a/Configure b/Configure
index 61b86c4..7089362 100755
--- a/Configure
+++ b/Configure
@@ -12,10 +12,12 @@
 use 5.10.0;
 use strict;
 use Config;
+use FindBin;
+use lib "$FindBin::Bin/util/perl";
 use File::Basename;
 use File::Spec::Functions qw/:DEFAULT abs2rel rel2abs/;
 use File::Path qw/mkpath/;
-use if $^O ne "VMS", 'File::Glob' => qw/:bsd_glob/;
+use OpenSSL::Glob;
 
 # see INSTALL for instructions.
 
@@ -1384,7 +1386,6 @@ my %unified_info = ();
 
 my $buildinfo_debug = defined($ENV{CONFIGURE_DEBUG_BUILDINFO});
 if ($builder eq "unified") {
-    use lib catdir(dirname(__FILE__),"util");
     use with_fallback qw(Text::Template);
 
     sub cleandir {
@@ -1512,8 +1513,10 @@ if ($builder eq "unified") {
         my %generate = ();
 
         push @{$config{build_infos}}, catfile(abs2rel($sourced, $blddir), $f);
-        my $template = Text::Template->new(TYPE => 'FILE',
-                                           SOURCE => catfile($sourced, $f));
+        my $template =
+            Text::Template->new(TYPE => 'FILE',
+                                SOURCE => catfile($sourced, $f),
+                                PREPEND => qq{use lib "$FindBin::Bin/util/perl";});
         die "Something went wrong with $sourced/$f: $!\n" unless $template;
         my @text =
             split /^/m,
diff --git a/test/build.info b/test/build.info
index e798260..6abd635 100644
--- a/test/build.info
+++ b/test/build.info
@@ -461,7 +461,7 @@ ENDIF
 {-
    use File::Spec::Functions;
    use File::Basename;
-   use if $^O ne "VMS", 'File::Glob' => qw/:bsd_glob/;
+   use OpenSSL::Glob;
 
    my @nogo_headers = ( "asn1_mac.h",
                         "__decc_include_prologue.h",
diff --git a/test/generate_ssl_tests.pl b/test/generate_ssl_tests.pl
index fd785b7..47a328c 100644
--- a/test/generate_ssl_tests.pl
+++ b/test/generate_ssl_tests.pl
@@ -22,7 +22,7 @@ BEGIN {
     OpenSSL::Test::setup("no_test_here");
 }
 
-use lib srctop_dir("util");  # for with_fallback
+use lib srctop_dir("util", "perl");  # for with_fallback
 use lib srctop_dir("test", "ssl-tests");  # for ssltests_base
 
 use with_fallback qw(Text::Template);
diff --git a/test/recipes/15-test_ecparam.t b/test/recipes/15-test_ecparam.t
index 0f9b70b..47a1a4f 100644
--- a/test/recipes/15-test_ecparam.t
+++ b/test/recipes/15-test_ecparam.t
@@ -11,7 +11,7 @@ use strict;
 use warnings;
 
 use File::Spec;
-use if $^O ne "VMS", 'File::Glob' => qw/:bsd_glob/;
+use OpenSSL::Glob;
 use OpenSSL::Test qw/:DEFAULT data_file/;
 use OpenSSL::Test::Utils;
 
diff --git a/test/recipes/40-test_rehash.t b/test/recipes/40-test_rehash.t
index b374e59..1204f1f 100644
--- a/test/recipes/40-test_rehash.t
+++ b/test/recipes/40-test_rehash.t
@@ -13,7 +13,7 @@ use warnings;
 use File::Spec::Functions;
 use File::Copy;
 use File::Basename;
-use if $^O ne "VMS", 'File::Glob' => qw/:bsd_glob/;
+use OpenSSL::Glob;
 use OpenSSL::Test qw/:DEFAULT srctop_file/;
 
 setup("test_rehash");
diff --git a/test/recipes/80-test_ssl_new.t b/test/recipes/80-test_ssl_new.t
index de35190..1ab8ef8 100644
--- a/test/recipes/80-test_ssl_new.t
+++ b/test/recipes/80-test_ssl_new.t
@@ -12,8 +12,7 @@ use warnings;
 
 use File::Basename;
 use File::Compare qw/compare_text/;
-use if $^O ne "VMS", 'File::Glob' => qw/:bsd_glob/;
-
+use OpenSSL::Glob;
 use OpenSSL::Test qw/:DEFAULT srctop_dir srctop_file/;
 use OpenSSL::Test::Utils qw/disabled alldisabled available_protocols/;
 
@@ -120,7 +119,7 @@ sub test_conf {
 
       skip 'failure', 2 unless
         ok(run(perltest(["generate_ssl_tests.pl", $input_file],
-                        interpreter_args => [ "-I", srctop_dir("test", "testlib")],
+                        interpreter_args => [ "-I", srctop_dir("util", "perl")],
                         stdout => $tmp_file)),
            "Getting output from generate_ssl_tests.pl.");
 
diff --git a/test/recipes/99-test_fuzz.t b/test/recipes/99-test_fuzz.t
index a0493a5..9322ff7 100644
--- a/test/recipes/99-test_fuzz.t
+++ b/test/recipes/99-test_fuzz.t
@@ -9,7 +9,7 @@
 use strict;
 use warnings;
 
-use if $^O ne "VMS", 'File::Glob' => qw/:bsd_glob/;
+use OpenSSL::Glob;
 use OpenSSL::Test qw/:DEFAULT srctop_file/;
 use OpenSSL::Test::Utils;
 
diff --git a/test/recipes/tconversion.pl b/test/recipes/tconversion.pl
index 1a308e2..fb0b766 100644
--- a/test/recipes/tconversion.pl
+++ b/test/recipes/tconversion.pl
@@ -12,7 +12,6 @@ use warnings;
 
 use File::Compare qw/compare_text/;
 use File::Copy;
-use lib 'testlib';
 use OpenSSL::Test qw/:DEFAULT/;
 
 my %conversionforms = (
diff --git a/test/run_tests.pl b/test/run_tests.pl
index 1695729..9f517da 100644
--- a/test/run_tests.pl
+++ b/test/run_tests.pl
@@ -16,7 +16,9 @@ BEGIN {
 
 use File::Spec::Functions qw/catdir catfile curdir abs2rel rel2abs/;
 use File::Basename;
-use if $^O ne "VMS", 'File::Glob' => qw/:bsd_glob/;
+use FindBin;
+use lib "$FindBin::Bin/../util/perl";
+use OpenSSL::Glob;
 use Module::Load::Conditional qw(can_load);
 
 my $TAP_Harness = can_load(modules => { 'TAP::Harness' => undef }) 
@@ -25,12 +27,11 @@ my $TAP_Harness = can_load(modules => { 'TAP::Harness' => undef })
 my $srctop = $ENV{SRCTOP} || $ENV{TOP};
 my $bldtop = $ENV{BLDTOP} || $ENV{TOP};
 my $recipesdir = catdir($srctop, "test", "recipes");
-my $testlib = catdir($srctop, "test", "testlib");
-my $utillib = catdir($srctop, "util");
+my $libdir = rel2abs(catdir($srctop, "util", "perl"));
 
 my %tapargs =
     ( verbosity => $ENV{VERBOSE} || $ENV{V} || $ENV{HARNESS_VERBOSE} ? 1 : 0,
-      lib       => [ $testlib, $utillib ],
+      lib       => [ $libdir ],
       switches  => '-w',
       merge     => 1
     );
diff --git a/util/dofile.pl b/util/dofile.pl
index 0d05574..36827e3 100644
--- a/util/dofile.pl
+++ b/util/dofile.pl
@@ -14,6 +14,7 @@
 use strict;
 use warnings;
 
+use FindBin;
 use Getopt::Std;
 
 # We actually expect to get the following hash tables from configdata:
@@ -38,7 +39,7 @@ package OpenSSL::Template;
 # a fallback in case it's not installed on the system
 use File::Basename;
 use File::Spec::Functions;
-use lib catdir(dirname(__FILE__));
+use lib "$FindBin::Bin/perl";
 use with_fallback qw(Text::Template);
 
 #use parent qw/Text::Template/;
@@ -175,7 +176,10 @@ my $text =
 # Load the full template (combination of files) into Text::Template
 # and fill it up with our data.  Output goes directly to STDOUT
 
-my $template = OpenSSL::Template->new(TYPE => 'STRING', SOURCE => $text );
+my $template =
+    OpenSSL::Template->new(TYPE => 'STRING',
+                           SOURCE => $text,
+                           PREPEND => qq{use lib "$FindBin::Bin/perl";});
 
 sub output_reset_on {
     $template->output_reset_on();
diff --git a/util/mkdef.pl b/util/mkdef.pl
index 7a85e80..d7baf8a 100755
--- a/util/mkdef.pl
+++ b/util/mkdef.pl
@@ -49,7 +49,9 @@ use lib ".";
 use configdata;
 use File::Spec::Functions;
 use File::Basename;
-use if $^O ne "VMS", 'File::Glob' => qw/:bsd_glob/;
+use FindBin;
+use lib "$FindBin::Bin/perl";
+use OpenSSL::Glob;
 
 my $debug=0;
 
diff --git a/util/perl/OpenSSL/Glob.pm b/util/perl/OpenSSL/Glob.pm
new file mode 100644
index 0000000..ec87da4
--- /dev/null
+++ b/util/perl/OpenSSL/Glob.pm
@@ -0,0 +1,21 @@
+package OpenSSL::Glob;
+
+use strict;
+use warnings;
+
+use File::Glob;
+
+use Exporter;
+use vars qw($VERSION @ISA @EXPORT);
+
+$VERSION = '0.1';
+ at ISA = qw(Exporter);
+ at EXPORT = qw(glob);
+
+sub glob {
+    goto &File::Glob::bsd_glob if $^O ne "VMS";
+    goto &CORE::glob;
+}
+
+1;
+__END__
diff --git a/test/testlib/OpenSSL/Test.pm b/util/perl/OpenSSL/Test.pm
similarity index 100%
rename from test/testlib/OpenSSL/Test.pm
rename to util/perl/OpenSSL/Test.pm
diff --git a/test/testlib/OpenSSL/Test/Simple.pm b/util/perl/OpenSSL/Test/Simple.pm
similarity index 100%
rename from test/testlib/OpenSSL/Test/Simple.pm
rename to util/perl/OpenSSL/Test/Simple.pm
diff --git a/test/testlib/OpenSSL/Test/Utils.pm b/util/perl/OpenSSL/Test/Utils.pm
similarity index 100%
rename from test/testlib/OpenSSL/Test/Utils.pm
rename to util/perl/OpenSSL/Test/Utils.pm
diff --git a/util/TLSProxy/Certificate.pm b/util/perl/TLSProxy/Certificate.pm
similarity index 100%
rename from util/TLSProxy/Certificate.pm
rename to util/perl/TLSProxy/Certificate.pm
diff --git a/util/TLSProxy/CertificateVerify.pm b/util/perl/TLSProxy/CertificateVerify.pm
similarity index 100%
rename from util/TLSProxy/CertificateVerify.pm
rename to util/perl/TLSProxy/CertificateVerify.pm
diff --git a/util/TLSProxy/ClientHello.pm b/util/perl/TLSProxy/ClientHello.pm
similarity index 100%
rename from util/TLSProxy/ClientHello.pm
rename to util/perl/TLSProxy/ClientHello.pm
diff --git a/util/TLSProxy/EncryptedExtensions.pm b/util/perl/TLSProxy/EncryptedExtensions.pm
similarity index 100%
rename from util/TLSProxy/EncryptedExtensions.pm
rename to util/perl/TLSProxy/EncryptedExtensions.pm
diff --git a/util/TLSProxy/HelloRetryRequest.pm b/util/perl/TLSProxy/HelloRetryRequest.pm
similarity index 100%
rename from util/TLSProxy/HelloRetryRequest.pm
rename to util/perl/TLSProxy/HelloRetryRequest.pm
diff --git a/util/TLSProxy/Message.pm b/util/perl/TLSProxy/Message.pm
similarity index 100%
rename from util/TLSProxy/Message.pm
rename to util/perl/TLSProxy/Message.pm
diff --git a/util/TLSProxy/NewSessionTicket.pm b/util/perl/TLSProxy/NewSessionTicket.pm
similarity index 100%
rename from util/TLSProxy/NewSessionTicket.pm
rename to util/perl/TLSProxy/NewSessionTicket.pm
diff --git a/util/TLSProxy/Proxy.pm b/util/perl/TLSProxy/Proxy.pm
similarity index 100%
rename from util/TLSProxy/Proxy.pm
rename to util/perl/TLSProxy/Proxy.pm
diff --git a/util/TLSProxy/Record.pm b/util/perl/TLSProxy/Record.pm
similarity index 100%
rename from util/TLSProxy/Record.pm
rename to util/perl/TLSProxy/Record.pm
diff --git a/util/TLSProxy/ServerHello.pm b/util/perl/TLSProxy/ServerHello.pm
similarity index 100%
rename from util/TLSProxy/ServerHello.pm
rename to util/perl/TLSProxy/ServerHello.pm
diff --git a/util/TLSProxy/ServerKeyExchange.pm b/util/perl/TLSProxy/ServerKeyExchange.pm
similarity index 100%
rename from util/TLSProxy/ServerKeyExchange.pm
rename to util/perl/TLSProxy/ServerKeyExchange.pm
diff --git a/test/testlib/checkhandshake.pm b/util/perl/checkhandshake.pm
similarity index 100%
rename from test/testlib/checkhandshake.pm
rename to util/perl/checkhandshake.pm
diff --git a/util/with_fallback.pm b/util/perl/with_fallback.pm
similarity index 83%
rename from util/with_fallback.pm
rename to util/perl/with_fallback.pm
index b6deb20..2af1d5f 100644
--- a/util/with_fallback.pm
+++ b/util/perl/with_fallback.pm
@@ -13,7 +13,8 @@ sub import {
     foreach (@_) {
 	eval "require $_";
 	if ($@) {
-	    unshift @INC, catdir(dirname(__FILE__), "..", "external", "perl");
+	    unshift @INC, catdir(dirname(__FILE__),
+                                 "..", "..", "external", "perl");
 	    my $transfer = "transfer::$_";
 	    eval "require $transfer";
 	    shift @INC;
diff --git a/util/process_docs.pl b/util/process_docs.pl
index 49176ad..2b7f322 100644
--- a/util/process_docs.pl
+++ b/util/process_docs.pl
@@ -13,7 +13,9 @@ use File::Spec::Functions;
 use File::Basename;
 use File::Copy;
 use File::Path;
-use if $^O ne "VMS", 'File::Glob' => qw/:bsd_glob/;
+use FindBin;
+use lib "$FindBin::Bin/perl";
+use OpenSSL::Glob;
 use Getopt::Long;
 use Pod::Usage;
 


More information about the openssl-commits mailing list