diff options
author | Michał Górny <mgorny@gentoo.org> | 2018-01-24 21:45:08 +0000 |
---|---|---|
committer | Michał Górny <mgorny@gentoo.org> | 2018-01-24 21:45:51 +0000 |
commit | 46458c4f9ddf975513af1329cb917d2d8a6d0e7f (patch) | |
tree | d55e8239cd7c8ca719b6a0a356be33c5d74344b2 | |
parent | 94f70553d9cfbf606a0d1838efaafaf0dc9bea7a (diff) | |
download | gemato-46458c4f9ddf975513af1329cb917d2d8a6d0e7f.tar.gz |
openpgp: Fix GnuPG use to report UTC timestamps
-rw-r--r-- | gemato/cli.py | 2 | ||||
-rw-r--r-- | gemato/openpgp.py | 5 | ||||
-rw-r--r-- | tests/test_openpgp.py | 2 |
3 files changed, 7 insertions, 2 deletions
diff --git a/gemato/cli.py b/gemato/cli.py index 5fb6e24..4d8da16 100644 --- a/gemato/cli.py +++ b/gemato/cli.py @@ -86,7 +86,7 @@ def do_verify(args, argp): m.openpgp_signature.primary_key_fingerprint)) logging.info('- subkey: {}'.format( m.openpgp_signature.fingerprint)) - logging.info('- timestamp: {}'.format( + logging.info('- timestamp: {} UTC'.format( m.openpgp_signature.timestamp)) logging.info('Verifying {}...'.format(p)) diff --git a/gemato/openpgp.py b/gemato/openpgp.py index 42b2949..63890f0 100644 --- a/gemato/openpgp.py +++ b/gemato/openpgp.py @@ -5,6 +5,7 @@ import datetime import errno +import os import os.path import shutil import subprocess @@ -139,6 +140,10 @@ class OpenPGPSystemEnvironment(object): outf.write(out.decode('utf8')) def _spawn_gpg(self, options, stdin, env=None): + if env is None: + env = os.environ.copy() + env['TZ'] = 'UTC' + impls = ['gpg2', 'gpg'] if self._impl is not None: impls = [self._impl] diff --git a/tests/test_openpgp.py b/tests/test_openpgp.py index d373e48..4d034bb 100644 --- a/tests/test_openpgp.py +++ b/tests/test_openpgp.py @@ -212,7 +212,7 @@ mkkhTd2Auao4D2K74BePBuiZ9+eDQA== ''' KEY_FINGERPRINT = '81E12C16BD8DCD60BE180845136880E72A7B1384' -SIG_TIMESTAMP = datetime.datetime(2017, 11, 8, 10, 1, 26) +SIG_TIMESTAMP = datetime.datetime(2017, 11, 8, 9, 1, 26) def strip_openpgp(text): |