summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaiki Ueno <dueno@redhat.com>2019-01-28 13:03:15 +0100
committerDaiki Ueno <ueno@gnu.org>2019-01-29 14:27:48 +0100
commit2a474e1fe8f4bd8b4ed7622e5cf3b2718a202562 (patch)
tree55e0aab7df448f9b49f29a47d80c4980d4d1436c
parent1ba80c67c492f25581ed97c8c31ffb5f20636d06 (diff)
extract-jks: Prefer _p11_extract_jks_timestamp to SOURCE_DATE_EPOCH
Give _p11_extract_jks_timestamp precedence over SOURCE_DATE_EPOCH so that the test results are not affected by the envvar settings.
-rw-r--r--trust/extract-jks.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/trust/extract-jks.c b/trust/extract-jks.c
index ad8dc35..a6f855f 100644
--- a/trust/extract-jks.c
+++ b/trust/extract-jks.c
@@ -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);
}