Configurations/unix-Makefile.tmpl: don't count on -E -P.
[openssl.git] / util / fipslink.pl
index 4a88fc6d77e07d36b25d95fdb7c8f782e7666d79..18a91532be535baebde62b3f2994abe2c9dccb7e 100644 (file)
@@ -1,4 +1,10 @@
-#!/usr/bin/perl
+#! /usr/bin/env perl
+# Copyright 2011-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
 
 sub check_env
        {
@@ -59,7 +65,7 @@ open my $sha1_res, '<', $fips_target.".sha1" or die "Get hash failure";
 $fips_hash=<$sha1_res>;
 close $sha1_res;
 unlink $fips_target.".sha1";
-chomp $fips_hash;
+$fips_hash =~ s|\R$||;          # Better chomp
 die "Get hash failure" if $? != 0;
 
 
@@ -97,8 +103,8 @@ sub check_hash
        $hashfile = <IN>;
        close IN;
        $hashval = `$sha1_exe ${fips_libdir}/$filename`;
-       chomp $hashfile;
-       chomp $hashval;
+       $hashfile =~ s|\R$||;    # Better chomp
+       $hashval =~ s|\R$||;     # Better chomp
        $hashfile =~ s/^.*=\s+//;
        $hashval =~ s/^.*=\s+//;
        die "Invalid hash syntax in file" if (length($hashfile) != 40);