public inbox for openembedded-core@lists.openembedded.org
 help / color / mirror / Atom feed
* [PATCH v1 1/2] gpg-sign: Add parameters to gpg signature function
@ 2022-03-22 21:19 Ferry Toth
  2022-03-22 21:19 ` [PATCH v1 2/2] package_manager: sign DEB package feeds Ferry Toth
  2022-03-23 18:34 ` [PATCH v1 1/2] gpg-sign: Add parameters to gpg signature function Ferry Toth
  0 siblings, 2 replies; 13+ messages in thread
From: Ferry Toth @ 2022-03-22 21:19 UTC (permalink / raw)
  To: openembedded-core; +Cc: Richard Purdie, Xavier Berger, Ferry Toth

From: Xavier Berger <xavier.berger@bio-logic.net>

output_suffix: If defined, add output_suffix as file name extension.
use_sha256: If True, use sha256 for gpg as digest algorithm

Signed-off-by: Xavier Berger <xavier.berger@bio-logic.net>
Signed-off-by: Ferry Toth <ftoth@exalondelft.nl>
---
 meta/lib/oe/gpg_sign.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

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):
         for i in range(0, len(files), sign_chunk):
             subprocess.check_output(shlex.split(cmd + ' '.join(files[i:i+sign_chunk])), stderr=subprocess.STDOUT)
 
-    def detach_sign(self, input_file, keyid, passphrase_file, passphrase=None, armor=True):
+    def detach_sign(self, input_file, keyid, passphrase_file, passphrase=None, armor=True, output_suffix=None, use_sha256=False):
         """Create a detached signature of a file"""
 
         if passphrase_file and passphrase:
@@ -71,6 +71,10 @@ class LocalSigner(object):
             cmd += ['--homedir', self.gpg_path]
         if armor:
             cmd += ['--armor']
+        if output_suffix:
+            cmd += ['-o', input_file + "." + output_suffix]
+        if use_sha256:
+            cmd += ['--digest-algo', "SHA256"]
 
         #gpg > 2.1 supports password pipes only through the loopback interface
         #gpg < 2.1 errors out if given unknown parameters
-- 
2.32.0



^ permalink raw reply related	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2022-03-28 14:04 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-03-22 21:19 [PATCH v1 1/2] gpg-sign: Add parameters to gpg signature function Ferry Toth
2022-03-22 21:19 ` [PATCH v1 2/2] package_manager: sign DEB package feeds Ferry Toth
2022-03-23 18:34 ` [PATCH v1 1/2] gpg-sign: Add parameters to gpg signature function Ferry Toth
2022-03-24  8:12   ` Richard Purdie
2022-03-24 11:23     ` Ferry Toth
2022-03-24 12:03       ` Richard Purdie
2022-03-24 15:36         ` Ferry Toth
2022-03-24 22:11           ` Ferry Toth
2022-03-24 22:20             ` Richard Purdie
2022-03-28 14:04               ` Ferry Toth
2022-03-25 11:28             ` Ferry Toth
2022-03-25 11:51               ` [OE-core] " Alexander Kanavin
2022-03-25 21:57                 ` Ferry Toth

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox