summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXavier Berger <xavier.berger@bio-logic.net>2022-04-03 21:50:44 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2022-04-05 22:25:13 +0100
commitbd8f1f7787b7017b29ecea5b18a164a39de09e27 (patch)
tree00439839b925639ebae64a93f5de652642eab85b
parentee994c89b68925ad2297b01a840c8ead8ef4a55d (diff)
downloadpoky-bd8f1f7787b7017b29ecea5b18a164a39de09e27.tar.gz
gpg-sign: Add parameters to gpg signature function
output_suffix: If defined, add output_suffix as file name extension. use_sha256: If True, use sha256 for gpg as digest algorithm (From OE-Core rev: cfcaa54dc73925df448099fb60f75b18350b2a3b) Signed-off-by: Xavier Berger <xavier.berger@bio-logic.net> Signed-off-by: Ferry Toth <ftoth@exalondelft.nl> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/lib/oe/gpg_sign.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/meta/lib/oe/gpg_sign.py b/meta/lib/oe/gpg_sign.py
index 1bce6cb792..aa9bb49f2c 100644
--- a/meta/lib/oe/gpg_sign.py
+++ b/meta/lib/oe/gpg_sign.py
@@ -58,7 +58,7 @@ class LocalSigner(object):
58 for i in range(0, len(files), sign_chunk): 58 for i in range(0, len(files), sign_chunk):
59 subprocess.check_output(shlex.split(cmd + ' '.join(files[i:i+sign_chunk])), stderr=subprocess.STDOUT) 59 subprocess.check_output(shlex.split(cmd + ' '.join(files[i:i+sign_chunk])), stderr=subprocess.STDOUT)
60 60
61 def detach_sign(self, input_file, keyid, passphrase_file, passphrase=None, armor=True): 61 def detach_sign(self, input_file, keyid, passphrase_file, passphrase=None, armor=True, output_suffix=None, use_sha256=False):
62 """Create a detached signature of a file""" 62 """Create a detached signature of a file"""
63 63
64 if passphrase_file and passphrase: 64 if passphrase_file and passphrase:
@@ -71,6 +71,10 @@ class LocalSigner(object):
71 cmd += ['--homedir', self.gpg_path] 71 cmd += ['--homedir', self.gpg_path]
72 if armor: 72 if armor:
73 cmd += ['--armor'] 73 cmd += ['--armor']
74 if output_suffix:
75 cmd += ['-o', input_file + "." + output_suffix]
76 if use_sha256:
77 cmd += ['--digest-algo', "SHA256"]
74 78
75 #gpg > 2.1 supports password pipes only through the loopback interface 79 #gpg > 2.1 supports password pipes only through the loopback interface
76 #gpg < 2.1 errors out if given unknown parameters 80 #gpg < 2.1 errors out if given unknown parameters