Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
Cranspasswords
Manage
Activity
Members
Labels
Plan
Issues
2
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Daniel Stan
Cranspasswords
Commits
5263206f
Commit
5263206f
authored
11 years ago
by
Vincent Le gallic
Browse files
Options
Downloads
Patches
Plain Diff
--check-keys -v plus verbeux
parent
a97aa5ee
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
client.py
+10
-2
10 additions, 2 deletions
client.py
with
10 additions
and
2 deletions
client.py
+
10
−
2
View file @
5263206f
...
...
@@ -187,6 +187,8 @@ def update_keys():
def
check_keys
():
"""
Vérifie les clés existantes
"""
if
VERB
:
print
(
"
M : l
'
uid correspond au mail du fingerprint
\n
C : confiance OK (inclu la vérification de non expiration).
\n
"
)
keys
=
all_keys
()
gpg
=
gnupg
.
GPG
(
gnupghome
=
'
~/.gnupg
'
)
localkeys
=
gpg
.
list_keys
()
...
...
@@ -194,24 +196,30 @@ def check_keys():
for
(
mail
,
fpr
)
in
keys
.
values
():
if
fpr
:
if
VERB
:
print
((
u
"
Checking %s
"
%
(
mail
)).
encode
(
"
utf-8
"
))
print
((
u
"
Checking %s
…
"
%
(
mail
)).
encode
(
"
utf-8
"
)
,
end
=
""
)
corresponds
=
[
key
for
key
in
localkeys
if
key
[
"
fingerprint
"
]
==
fpr
]
# On vérifie qu'on possède la clé…
if
len
(
corresponds
)
==
1
:
correspond
=
corresponds
[
0
]
# …qu'elle correspond au mail…
if
mail
.
lower
()
in
sum
([
re
.
findall
(
"
<(.*)>
"
,
uid
.
lower
())
for
uid
in
correspond
[
"
uids
"
]],
[]):
if
VERB
:
print
(
"
M
"
,
end
=
""
)
meaning
,
trustvalue
=
GPG_TRUSTLEVELS
[
correspond
[
"
trust
"
]]
# … et qu'on lui fait confiance
if
not
trustvalue
:
print
((
u
"
--> Fail on %s:%s
\n
La confiance en la clé est : %s
"
%
(
meaning
,)).
encode
(
"
utf-8
"
))
print
((
u
"
--> Fail on %s:%s
\n
La confiance en la clé est : %s
"
%
(
fpr
,
mail
,
meaning
,)).
encode
(
"
utf-8
"
))
failed
=
True
elif
VERB
:
print
(
"
C
"
,
end
=
""
)
else
:
print
((
u
"
--> Fail on %s:%s
\n
!! Le fingerprint et le mail ne correspondent pas !
"
%
(
fpr
,
mail
)).
encode
(
"
utf-8
"
))
failed
=
True
else
:
print
((
u
"
--> Fail on %s:%s
\n
Pas (ou trop) de clé avec ce fingerprint.
"
%
(
fpr
,
mail
)).
encode
(
"
utf-8
"
))
failed
=
True
if
VERB
:
print
(
""
)
return
not
failed
def
get_recipients_of_roles
(
roles
):
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment