summaryrefslogtreecommitdiffstats
path: root/crypto
diff options
context:
space:
mode:
authorBernd Edlinger <bernd.edlinger@hotmail.de>2022-01-05 17:25:02 +0100
committerBernd Edlinger <bernd.edlinger@hotmail.de>2022-07-30 12:23:26 +0200
commit26cfeb76cfda55ba5248219f40252af7c2b22be1 (patch)
treec8bb147764d9bc6de10932c59b9b29c3a125fd5d /crypto
parent7dfe4aa2b08d1c3111b0861e26cac0246e3e8f58 (diff)
Fix copyright year issues
Fixes: #13765 Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/17706)
Diffstat (limited to 'crypto')
-rw-r--r--crypto/asn1/charmap.pl9
-rw-r--r--crypto/bn/bn_prime.pl9
-rw-r--r--crypto/conf/keysets.pl10
-rw-r--r--crypto/objects/obj_dat.pl9
-rw-r--r--crypto/objects/objects.pl11
-rw-r--r--crypto/objects/objxref.pl11
6 files changed, 33 insertions, 26 deletions
diff --git a/crypto/asn1/charmap.pl b/crypto/asn1/charmap.pl
index dadd8df774..52fa5a7900 100644
--- a/crypto/asn1/charmap.pl
+++ b/crypto/asn1/charmap.pl
@@ -1,5 +1,5 @@
#! /usr/bin/env perl
-# Copyright 2000-2019 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2000-2022 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
@@ -7,6 +7,9 @@
# https://www.openssl.org/source/license.html
use strict;
+use FindBin;
+use lib "$FindBin::Bin/../../util/perl";
+use OpenSSL::copyright;
my ($i, @arr);
@@ -82,8 +85,8 @@ $arr[ord("?")] |= $PSTRING_CHAR;
# Now generate the C code
-# Output year depends on the year of the script.
-my $YEAR = [localtime([stat($0)]->[9])]->[5] + 1900;
+# Year the file was generated.
+my $YEAR = OpenSSL::copyright::year_of($0);
print <<EOF;
/*
* WARNING: do not edit!
diff --git a/crypto/bn/bn_prime.pl b/crypto/bn/bn_prime.pl
index b0b1608742..d2eaac6564 100644
--- a/crypto/bn/bn_prime.pl
+++ b/crypto/bn/bn_prime.pl
@@ -1,13 +1,16 @@
#! /usr/bin/env perl
-# Copyright 1998-2019 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 1998-2022 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
+use FindBin;
+use lib "$FindBin::Bin/../../util/perl";
+use OpenSSL::copyright;
-# Output year depends on the year of the script.
-my $YEAR = [localtime([stat($0)]->[9])]->[5] + 1900;
+# The year the output file is generated.
+my $YEAR = OpenSSL::copyright::year_of($0);
print <<"EOF";
/*
* WARNING: do not edit!
diff --git a/crypto/conf/keysets.pl b/crypto/conf/keysets.pl
index 27a7214cc5..9c9a00dea8 100644
--- a/crypto/conf/keysets.pl
+++ b/crypto/conf/keysets.pl
@@ -1,5 +1,5 @@
#! /usr/bin/env perl
-# Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 1995-2022 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
@@ -8,6 +8,9 @@
use strict;
use warnings;
+use FindBin;
+use lib "$FindBin::Bin/../../util/perl";
+use OpenSSL::copyright;
my $NUMBER = 0x0001;
my $UPPER = 0x0002;
@@ -54,9 +57,8 @@ foreach (0 .. 127) {
push(@V_w32, $v);
}
-# Output year depends on the year of the script.
-my $YEAR = [localtime([stat($0)]->[9])]->[5] + 1900;
-
+# The year the output file is generated.
+my $YEAR = OpenSSL::copyright::year_of($0);
print <<"EOF";
/*
* WARNING: do not edit!
diff --git a/crypto/objects/obj_dat.pl b/crypto/objects/obj_dat.pl
index e5d38147ec..6ae13b9416 100644
--- a/crypto/objects/obj_dat.pl
+++ b/crypto/objects/obj_dat.pl
@@ -9,6 +9,9 @@
use integer;
use strict;
use warnings;
+use FindBin;
+use lib "$FindBin::Bin/../../util/perl";
+use OpenSSL::copyright;
# Generate the DER encoding for the given OID.
sub der_it
@@ -36,10 +39,8 @@ sub der_it
return $ret;
}
-# Output year depends on the year of the script and the input file.
-my $YEAR = [localtime([stat($0)]->[9])]->[5] + 1900;
-my $iYEAR = [localtime([stat($ARGV[0])]->[9])]->[5] + 1900;
-$YEAR = $iYEAR if $iYEAR > $YEAR;
+# The year the output file is generated.
+my $YEAR = OpenSSL::copyright::latest(($0, $ARGV[0]));
# Read input, parse all #define's into OID name and value.
# Populate %ln and %sn with long and short names (%dupln and %dupsn)
diff --git a/crypto/objects/objects.pl b/crypto/objects/objects.pl
index d7d1962c99..10a115f692 100644
--- a/crypto/objects/objects.pl
+++ b/crypto/objects/objects.pl
@@ -7,16 +7,15 @@
# https://www.openssl.org/source/license.html
use Getopt::Std;
+use FindBin;
+use lib "$FindBin::Bin/../../util/perl";
+use OpenSSL::copyright;
our($opt_n);
getopts('n');
-# Output year depends on the year of the script and the input file.
-my $YEAR = [localtime([stat($0)]->[9])]->[5] + 1900;
-my $iYEAR = [localtime([stat($ARGV[0])]->[9])]->[5] + 1900;
-$YEAR = $iYEAR if $iYEAR > $YEAR;
-$iYEAR = [localtime([stat($ARGV[1])]->[9])]->[5] + 1900;
-$YEAR = $iYEAR if $iYEAR > $YEAR;
+# The year the output file is generated.
+my $YEAR = OpenSSL::copyright::latest(($0, $ARGV[1], $ARGV[0]));
open (NUMIN,"$ARGV[1]") || die "Can't open number file $ARGV[1]";
$max_nid=0;
diff --git a/crypto/objects/objxref.pl b/crypto/objects/objxref.pl
index ce76cadae3..168d4be9f8 100644
--- a/crypto/objects/objxref.pl
+++ b/crypto/objects/objxref.pl
@@ -8,18 +8,17 @@
use strict;
+use FindBin;
+use lib "$FindBin::Bin/../../util/perl";
+use OpenSSL::copyright;
my %xref_tbl;
my %oid_tbl;
my ($mac_file, $xref_file) = @ARGV;
-# Output year depends on the year of the script and the input file.
-my $YEAR = [localtime([stat($0)]->[9])]->[5] + 1900;
-my $iYEAR = [localtime([stat($mac_file)]->[9])]->[5] + 1900;
-$YEAR = $iYEAR if $iYEAR > $YEAR;
-$iYEAR = [localtime([stat($xref_file)]->[9])]->[5] + 1900;
-$YEAR = $iYEAR if $iYEAR > $YEAR;
+# The year the output file is generated.
+my $YEAR = OpenSSL::copyright::latest(($0, $mac_file, $xref_file));
open(IN, $mac_file) || die "Can't open $mac_file, $!\n";