From 80a1c67a741897ebf6c8bc34f23ff6105461ce27 Mon Sep 17 00:00:00 2001 From: Michał Górny Date: Tue, 30 Jan 2018 18:21:09 +0100 Subject: openpgp: Set trust-model via config file --- gemato/openpgp.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/gemato/openpgp.py b/gemato/openpgp.py index 1f3d72e..c97aeb2 100644 --- a/gemato/openpgp.py +++ b/gemato/openpgp.py @@ -184,6 +184,12 @@ class OpenPGPEnvironment(OpenPGPSystemEnvironment): super(OpenPGPEnvironment, self).__init__() self._home = tempfile.mkdtemp() + with open(os.path.join(self._home, 'gpg.conf'), 'w') as f: + f.write('''# autogenerated by gemato + +# we are using an isolated keyring, so always trust our keys +trust-model always +''') with open(os.path.join(self._home, 'gpg-agent.conf'), 'w') as f: f.write('''# autogenerated by gemato @@ -227,5 +233,4 @@ disable-scdaemon def _spawn_gpg(self, options, stdin): env = {'GNUPGHOME': self.home} - options = ['--trust-model', 'always'] + options return super(OpenPGPEnvironment, self)._spawn_gpg(options, stdin, env) -- cgit v1.2.3