1 |
commit: bacec7da1e7ff446f232d48dcf34b71966df7068 |
2 |
Author: aeroniero33 <justthisthing <AT> gmail <DOT> com> |
3 |
AuthorDate: Tue Apr 12 23:49:05 2016 +0000 |
4 |
Commit: Brian Dolbec <dolsen <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Jun 1 15:13:48 2016 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/gentoo-keys.git/commit/?id=bacec7da |
7 |
|
8 |
Count Incorrect Qualified IDs and present them in the speccheck summary. |
9 |
|
10 |
Changed the names of Qualified_IDs |
11 |
|
12 |
Changed Qualified_Id position |
13 |
|
14 |
gkeys/gkeys/actions.py | 12 +++++++++++- |
15 |
1 file changed, 11 insertions(+), 1 deletion(-) |
16 |
|
17 |
diff --git a/gkeys/gkeys/actions.py b/gkeys/gkeys/actions.py |
18 |
index d61b415..ef8a30e 100644 |
19 |
--- a/gkeys/gkeys/actions.py |
20 |
+++ b/gkeys/gkeys/actions.py |
21 |
@@ -407,6 +407,8 @@ class Actions(ActionBase): |
22 |
'encrypts': [], |
23 |
'authens': [], |
24 |
'final': False, |
25 |
+ 'qualified_id_checks': [], |
26 |
+ 'qualified_id_passed': False |
27 |
} |
28 |
if key.key is "SUB": |
29 |
if key.sign_capable and key.passed_spec: |
30 |
@@ -419,6 +421,9 @@ class Actions(ActionBase): |
31 |
pub_pass['authens'].append(key.passed_spec) |
32 |
if key.passed_spec: |
33 |
pub_pass['auth'] = True |
34 |
+ if key.id: |
35 |
+ pub_pass['qualified_id_checks'].append(key.id) |
36 |
+ pub_pass['qualified_id_passed'] = True |
37 |
validity = key.validity.split(',')[0] |
38 |
if not key.expire and not 'r' in validity: |
39 |
failed['expired'].append(_unicode("%s <%s>: %s") |
40 |
@@ -446,6 +451,9 @@ class Actions(ActionBase): |
41 |
if not pub_pass['sign']: |
42 |
failed['sign'].append(_unicode("%s <%s>: %s") |
43 |
% (gkey.name, gkey.nick, pub_pass['key'].fingerprint)) |
44 |
+ if not pub_pass['qualified_id_passed']: |
45 |
+ failed['qualified_id'].append(_unicode("%s <%s>: %s") |
46 |
+ % (gkey.name, gkey.nick, pub_pass['key'].fingerprint)) |
47 |
if not pub_pass['encrypt']: |
48 |
failed['encrypt'].append(_unicode("%s <%s>: %s") |
49 |
% (gkey.name, gkey.nick, pub_pass['key'].fingerprint)) |
50 |
@@ -483,6 +491,8 @@ class Actions(ActionBase): |
51 |
self.output([sorted(set(failed['expired']))], '\n Expiry keys:') |
52 |
if failed['warn']: |
53 |
self.output([sorted(set(failed['warn']))], '\n Expiry Warnings:') |
54 |
+ if failed['qualified_id']: |
55 |
+ self.output([sorted(set(failed['qualified_id']))], '\n Qualified IDs:') |
56 |
if failed['spec']: |
57 |
self.output([sorted(set(failed['spec']))], '\n Failed to pass SPEC requirements:') |
58 |
if failed['spec-approved']: |
59 |
@@ -496,6 +506,7 @@ class Actions(ActionBase): |
60 |
'No Encryption subkey...: %d' % len(set(failed['encrypt'])), |
61 |
'Algorithm..............: %d' % len(set(failed['algo'])), |
62 |
'Bit length.............: %d' % len(set(failed['bits'])), |
63 |
+ 'Qualified IDs..........: %d' % len(set(failed['qualified_id'])), |
64 |
'Expiry.................: %d' % len(set(failed['expired'])), |
65 |
'Expiry Warnings........: %d' % len(set(failed['warn'])), |
66 |
'SPEC requirements......: %d' % len(set(failed['spec'])), |
67 |
@@ -889,4 +900,3 @@ class Actions(ActionBase): |
68 |
msgs.append(keys[cat]) |
69 |
del keys |
70 |
return (True, msgs) |
71 |
- |