]> granicus.if.org Git - p11-kit/commitdiff
extract-jks: Prefer _p11_extract_jks_timestamp to SOURCE_DATE_EPOCH
authorDaiki Ueno <dueno@redhat.com>
Mon, 28 Jan 2019 12:03:15 +0000 (13:03 +0100)
committerDaiki Ueno <ueno@gnu.org>
Tue, 29 Jan 2019 13:27:48 +0000 (14:27 +0100)
Give _p11_extract_jks_timestamp precedence over SOURCE_DATE_EPOCH so
that the test results are not affected by the envvar settings.

trust/extract-jks.c

index ad8dc35b20f4cb5976ff96ad50aa68bef9d91931..a6f855fca93679a29e7aa0f7fd2cd8862daa9b2b 100644 (file)
@@ -250,7 +250,9 @@ prepare_jks_buffer (p11_enumerate *ex,
         * when this was this certificate was added to the keystore, however
         * we don't have that information. Java uses time in milliseconds
         */
-       {
+       if (_p11_extract_jks_timestamp)
+               now = _p11_extract_jks_timestamp;
+       else {
                char *source_date_epoch;
                source_date_epoch = secure_getenv ("SOURCE_DATE_EPOCH");
                if (source_date_epoch) {
@@ -276,9 +278,7 @@ prepare_jks_buffer (p11_enumerate *ex,
                                return false;
                        }
                        now = epoch;
-               } else if (_p11_extract_jks_timestamp)
-                       now = _p11_extract_jks_timestamp;
-               else
+               } else
                        now = time (NULL);
        }