summaryrefslogtreecommitdiffstats
path: root/meta/lib/oe
diff options
context:
space:
mode:
authorMarkus Lehtonen <markus.lehtonen@linux.intel.com>2016-02-10 16:15:55 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-02-18 22:55:11 +0000
commit4445c645c71151bd56ff7e133343a6f1e30cc3b3 (patch)
treebcaf69c0e3e7e0d113aab41121511dc0c928cb67 /meta/lib/oe
parentadc53d40932151b4822ce2ac74cb31306684ba95 (diff)
downloadopenembedded-core-4445c645c71151bd56ff7e133343a6f1e30cc3b3.tar.gz
openembedded-core-4445c645c71151bd56ff7e133343a6f1e30cc3b3.tar.bz2
openembedded-core-4445c645c71151bd56ff7e133343a6f1e30cc3b3.zip
oe/gpg_sign: add verify() method
A new method for verifying detached signatures. [YOCTO #9006] Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oe')
-rw-r--r--meta/lib/oe/gpg_sign.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/meta/lib/oe/gpg_sign.py b/meta/lib/oe/gpg_sign.py
index 821787ec7e..a4f310e536 100644
--- a/meta/lib/oe/gpg_sign.py
+++ b/meta/lib/oe/gpg_sign.py
@@ -65,6 +65,16 @@ class LocalSigner(object):
raise bb.build.FuncFailed("Failed to create signature for '%s': %s" %
(input_file, output))
+ def verify(self, sig_file):
+ """Verify signature"""
+ cmd = self.gpg_bin + " --verify "
+ if self.gpg_path:
+ cmd += "--homedir %s " % self.gpg_path
+ cmd += sig_file
+ status, _ = oe.utils.getstatusoutput(cmd)
+ ret = False if status else True
+ return ret
+
def get_signer(d, backend, keyid, passphrase_file):
"""Get signer object for the specified backend"""