[tor-commits] [tor-browser-build/master] Bug 33535: Patch openssl to use SOURCE_DATE_EPOCH for copyright year

sysrqb at torproject.org sysrqb at torproject.org
Sat Mar 7 19:15:44 UTC 2020


commit b5e9b4ad94be85ec581b8e7a8aaec42696519dc1
Author: Nicolas Vigier <boklm at torproject.org>
Date:   Thu Mar 5 20:19:48 2020 +0100

    Bug 33535: Patch openssl to use SOURCE_DATE_EPOCH for copyright year
---
 projects/openssl/build                       |  1 +
 projects/openssl/config                      |  2 ++
 projects/openssl/use-SOURCE_DATE_EPOCH.patch | 25 +++++++++++++++++++++++++
 3 files changed, 28 insertions(+)

diff --git a/projects/openssl/build b/projects/openssl/build
index 3ee3571..5851ff8 100644
--- a/projects/openssl/build
+++ b/projects/openssl/build
@@ -15,6 +15,7 @@ export CC='gcc -m32'
 [% END -%]
 [% IF c("var/windows") -%]
   patch -p1 < $rootdir/escape-openssldir.patch
+  patch -p1 < $rootdir/use-SOURCE_DATE_EPOCH.patch
 [% END -%]
 export SOURCE_DATE_EPOCH='[% c("timestamp") %]'
 ./Configure [% c('var/configure_opts') %]
diff --git a/projects/openssl/config b/projects/openssl/config
index 0a60c24..450c4c9 100644
--- a/projects/openssl/config
+++ b/projects/openssl/config
@@ -31,3 +31,5 @@ input_files:
     sha256sum: 1e3a91bc1f9dfce01af26026f856e064eab4c8ee0a8f457b5ae30b40b8b711f2
   - filename: escape-openssldir.patch
     enable: '[% c("var/windows") %]'
+  - filename: use-SOURCE_DATE_EPOCH.patch
+    enable: '[% c("var/windows") %]'
diff --git a/projects/openssl/use-SOURCE_DATE_EPOCH.patch b/projects/openssl/use-SOURCE_DATE_EPOCH.patch
new file mode 100644
index 0000000..65533bb
--- /dev/null
+++ b/projects/openssl/use-SOURCE_DATE_EPOCH.patch
@@ -0,0 +1,25 @@
+From a1625535fc5127ab8e94043280ef7a983bcfc161 Mon Sep 17 00:00:00 2001
+From: Nicolas Vigier <boklm at torproject.org>
+Date: Thu, 5 Mar 2020 20:39:05 +0100
+Subject: [PATCH] If SOURCE_DATE_EPOCH is defined, use it for copyright year
+
+Using the date from SOURCE_DATE_EPOCH instead of the current date makes
+it possible to reproduce a build that was built on a different year:
+https://reproducible-builds.org/specs/source-date-epoch/
+---
+ util/mkrc.pl | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/util/mkrc.pl b/util/mkrc.pl
+index 6762bc4a56..e15c071af7 100755
+--- a/util/mkrc.pl
++++ b/util/mkrc.pl
+@@ -46,7 +46,7 @@ if ( $filename =~ /openssl/i ) {
+     $vft = "VFT_APP";
+ }
+ 
+-my $YEAR = [localtime()]->[5] + 1900;
++my $YEAR = [localtime($ENV{SOURCE_DATE_EPOCH} || time())]->[5] + 1900;
+ print <<___;
+ #include <winver.h>
+ 



More information about the tor-commits mailing list