#! /usr/bin/env perl
-# Copyright 2000-2020 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2000-2021 The OpenSSL Project Authors. All Rights Reserved.
#
# Licensed under the Apache License 2.0 (the "License"). You may not use
# this file except in compliance with the License. You can obtain a copy
# https://www.openssl.org/source/license.html
use strict;
+use FindBin;
+use lib "$FindBin::Bin/../../util/perl";
+use OpenSSL::copyright;
my ($i, @arr);
# Now generate the C code
# Year the file was generated.
-my $YEAR = [localtime()]->[5] + 1900;
+my $YEAR = OpenSSL::copyright::year_of($0);
+
print <<EOF;
/*
* WARNING: do not edit!
#! /usr/bin/env perl
-# Copyright 1998-2020 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 1998-2021 The OpenSSL Project Authors. All Rights Reserved.
#
# Licensed under the Apache License 2.0 (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;
# The year the output file is generated.
-my $YEAR = [localtime()]->[5] + 1900;
+my $YEAR = OpenSSL::copyright::year_of($0);
+
print <<"EOF";
/*
* WARNING: do not edit!
#! /usr/bin/env perl
-# Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved.
#
# Licensed under the Apache License 2.0 (the "License"). You may not use
# this file except in compliance with the License. You can obtain a copy
use strict;
use warnings;
+use FindBin;
+use lib "$FindBin::Bin/../../util/perl";
+use OpenSSL::copyright;
my $NUMBER = 0x0001;
my $UPPER = 0x0002;
}
# The year the output file is generated.
-my $YEAR = [localtime()]->[5] + 1900;
+my $YEAR = OpenSSL::copyright::year_of($0);
print <<"EOF";
/*
* WARNING: do not edit!
#! /usr/bin/env perl
-# Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved.
#
# Licensed under the Apache License 2.0 (the "License"). You may not use
# this file except in compliance with the License. You can obtain a copy
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
}
# The year the output file is generated.
-my $YEAR = [localtime()]->[5] + 1900;
+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)
# 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');
# The year the output file is generated.
-my $YEAR = [localtime()]->[5] + 1900;
+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;
#! /usr/bin/env perl
-# Copyright 1998-2020 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 1998-2021 The OpenSSL Project Authors. All Rights Reserved.
#
# Licensed under the Apache License 2.0 (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 strict;
+use FindBin;
+use lib "$FindBin::Bin/../../util/perl";
+use OpenSSL::copyright;
my %xref_tbl;
my %oid_tbl;
my ($mac_file, $xref_file) = @ARGV;
# The year the output file is generated.
-my $YEAR = [localtime()]->[5] + 1900;
+my $YEAR = OpenSSL::copyright::latest(($0, $mac_file, $xref_file));
open(IN, $mac_file) || die "Can't open $mac_file, $!\n";
#! /usr/bin/env perl
-# Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved.
#
# Licensed under the Apache License 2.0 (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;
my $obj_dat_h = $ARGV[0];
-
-# The year the output file is generated.
-my $YEAR = [localtime()]->[5] + 1900;
+my $YEAR = OpenSSL::copyright::latest(($0, $obj_dat_h));
+print <<"EOF";
+# WARNING: do not edit!
+# Generated by fuzz/mkfuzzoids.pl
+#
+# Copyright 2020-$YEAR The OpenSSL Project Authors. All Rights Reserved.
+#
+# Licensed under the Apache License 2.0 (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
+EOF
open IN, '<', $obj_dat_h
|| die "Couldn't open $obj_dat_h : $!\n";
+# WARNING: do not edit!
+# Generated by fuzz/mkfuzzoids.pl
+#
+# Copyright 2020-2021 The OpenSSL Project Authors. All Rights Reserved.
+#
+# Licensed under the Apache License 2.0 (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
OBJ_rsadsi="\x2A\x86\x48\x86\xF7\x0D"
OBJ_pkcs="\x2A\x86\x48\x86\xF7\x0D\x01"
OBJ_md2="\x2A\x86\x48\x86\xF7\x0D\x02\x02"
--- /dev/null
+#! /usr/bin/env perl
+# Copyright 2021 The OpenSSL Project Authors. All Rights Reserved.
+#
+# Licensed under the Apache License 2.0 (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 strict;
+use warnings;
+
+package OpenSSL::copyright;
+
+sub year_of {
+ my $file = shift;
+
+ return $ENV{'OSSL_COPYRIGHT_YEAR'} if defined $ENV{'OSSL_COPYRIGHT_YEAR'};
+
+ # Get the current year. We use that as the default because the other
+ # common case is that someone unpacked a tarfile and the file dates
+ # are't properly set on extract.
+ my $YEAR = [localtime()]->[5] + 1900;
+
+ # See if git's available
+ open my $FH,
+ "git log -1 --date=format:%Y --format=format:%ad $file 2>/dev/null|"
+ or return $YEAR;
+ my $LINE = <$FH>;
+ close $FH;
+ chomp($LINE);
+ $YEAR = $LINE if $LINE;
+ return $YEAR;
+}
+
+sub latest {
+ my $l = 0;
+ foreach my $f (@_ ) {
+ my $y = year_of($f);
+ $l = $y if $y > $l;
+ }
+ return $l
+}
+1;