From: Ansgar Burchardt Date: Tue, 10 Sep 2013 21:22:14 +0000 (+0200) Subject: Import only primary key fingerprints from keyring. X-Git-Url: https://git.decadent.org.uk/gitweb/?a=commitdiff_plain;h=d7b3341ac987031468fd7ba8020620d2fecaccd1;p=dak.git Import only primary key fingerprints from keyring. Reference: https://lists.debian.org/debian-project/2013/09/msg00039.html Signed-off-by: Ansgar Burchardt --- diff --git a/daklib/dbconn.py b/daklib/dbconn.py index 31caa902..4d551ad1 100644 --- a/daklib/dbconn.py +++ b/daklib/dbconn.py @@ -1220,7 +1220,7 @@ class Keyring(object): k = os.popen(self.gpg_invocation % keyring, "r") key = None - signingkey = False + need_fingerprint = False for line in k: field = line.split(":") @@ -1231,18 +1231,16 @@ class Keyring(object): if "@" in addr: self.keys[key]["email"] = addr self.keys[key]["name"] = name - self.keys[key]["fingerprints"] = [] - signingkey = True - elif key and field[0] == "sub" and len(field) >= 12: - signingkey = ("s" in field[11]) + need_fingerprint = True elif key and field[0] == "uid": (name, addr) = self.parse_address(field[9]) if "email" not in self.keys[key] and "@" in addr: self.keys[key]["email"] = addr self.keys[key]["name"] = name - elif signingkey and field[0] == "fpr": - self.keys[key]["fingerprints"].append(field[9]) + elif need_fingerprint and field[0] == "fpr": + self.keys[key]["fingerprints"] = [field[9]] self.fpr_lookup[field[9]] = key + need_fingerprint = False def import_users_from_ldap(self, session): import ldap