aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKonstantin Ryabitsev <konstantin@linuxfoundation.org>2022-08-25 15:59:07 -0400
committerKonstantin Ryabitsev <konstantin@linuxfoundation.org>2022-08-25 16:02:22 -0400
commit7b43b64f669b7304253d67d3eff239828047dc26 (patch)
treeba817de23c4560874f12d925d69ff08f15f630e6
parentdee7eb1a2db35da5bc6fd97e5fb4484c6690c4d0 (diff)
downloadpatatt-7b43b64f669b7304253d67d3eff239828047dc26.tar.gz
Use NamedTemporaryFile for gpg keyring creation
When we create the temporary keyring, use a NamedTemporaryFile so we don't have to handle the cases where HOME or GNUPGHOME aren't writable. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
-rw-r--r--patatt/__init__.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/patatt/__init__.py b/patatt/__init__.py
index af92091..7f6cbe2 100644
--- a/patatt/__init__.py
+++ b/patatt/__init__.py
@@ -394,7 +394,7 @@ class DevsigHeader:
bsigdata = base64.b64decode(sigdata)
vrfyargs = ['--verify', '--output', '-', '--status-fd=2']
if pubkey:
- with tempfile.TemporaryFile(suffix='.patch-attest-poc') as temp_keyring:
+ with tempfile.NamedTemporaryFile(suffix='.patatt.gpg') as temp_keyring:
keyringargs = ['--no-default-keyring', f'--keyring={temp_keyring.name}']
if pubkey in KEYCACHE:
logger.debug('Reusing cached keyring')