diff options
author | Markus Lehtonen <markus.lehtonen@linux.intel.com> | 2016-02-10 16:15:55 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-02-19 01:01:25 +0000 |
commit | 03554b77cda6380e9ca49114a3405b7e449498ae (patch) | |
tree | bdb0b6777d2c3c2c16f4b82825497a621e6439de | |
parent | af7e51664034c544d7d7d35c6d968acc36513da3 (diff) | |
download | poky-03554b77cda6380e9ca49114a3405b7e449498ae.tar.gz |
oe/gpg_sign: add verify() method
A new method for verifying detached signatures.
[YOCTO #9006]
(From OE-Core rev: 4445c645c71151bd56ff7e133343a6f1e30cc3b3)
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>
-rw-r--r-- | meta/lib/oe/gpg_sign.py | 10 |
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): | |||
65 | raise bb.build.FuncFailed("Failed to create signature for '%s': %s" % | 65 | raise bb.build.FuncFailed("Failed to create signature for '%s': %s" % |
66 | (input_file, output)) | 66 | (input_file, output)) |
67 | 67 | ||
68 | def verify(self, sig_file): | ||
69 | """Verify signature""" | ||
70 | cmd = self.gpg_bin + " --verify " | ||
71 | if self.gpg_path: | ||
72 | cmd += "--homedir %s " % self.gpg_path | ||
73 | cmd += sig_file | ||
74 | status, _ = oe.utils.getstatusoutput(cmd) | ||
75 | ret = False if status else True | ||
76 | return ret | ||
77 | |||
68 | 78 | ||
69 | def get_signer(d, backend, keyid, passphrase_file): | 79 | def get_signer(d, backend, keyid, passphrase_file): |
70 | """Get signer object for the specified backend""" | 80 | """Get signer object for the specified backend""" |