]> git.ipfire.org Git - people/ms/ipfire-3.x.git/blob - pakfire/patches/0017-Warn-if-the-host-key-is-not-in-the-key-store.patch
python: Update to 2.7.5.
[people/ms/ipfire-3.x.git] / pakfire / patches / 0017-Warn-if-the-host-key-is-not-in-the-key-store.patch
1 From 60c7a320b14c490487ae4105ccb125a190de828d Mon Sep 17 00:00:00 2001
2 From: Michael Tremer <michael.tremer@ipfire.org>
3 Date: Mon, 24 Jun 2013 21:24:49 +0000
4 Subject: [PATCH 17/19] Warn if the host key is not in the key store.
5
6 ---
7 python/pakfire/keyring.py | 8 +++++---
8 1 file changed, 5 insertions(+), 3 deletions(-)
9
10 diff --git a/python/pakfire/keyring.py b/python/pakfire/keyring.py
11 index 8fe052e..7bd54fb 100644
12 --- a/python/pakfire/keyring.py
13 +++ b/python/pakfire/keyring.py
14 @@ -71,15 +71,17 @@ class Keyring(object):
15 os.chmod(filename, 600)
16
17 def dump_key(self, keyfp):
18 - ret = []
19 -
20 key = self.get_key(keyfp, secret=False)
21 - key_priv = self.get_key(keyfp, secret=True)
22 + if not key:
23 + return [" " + _("Not in key store: %s") % keyfp, ""]
24
25 + ret = []
26 for uid in key.uids:
27 ret.append(uid.uid)
28
29 ret.append(" " + _("Fingerprint: %s") % keyfp)
30 +
31 + key_priv = self.get_key(keyfp, secret=True)
32 if key_priv:
33 ret.append(" " + _("Private key available!"))
34 ret.append("")
35 --
36 1.8.1.4
37