[Pkg-privacy-commits] [msva-perl] 131/356: Simplify keyserver-checking logic
Ximin Luo
infinity0 at moszumanska.debian.org
Mon Aug 24 07:41:48 UTC 2015
This is an automated email from the git hooks/post-receive script.
infinity0 pushed a commit to branch debian
in repository msva-perl.
commit 66607d0300028503c95845fe3ac3c88f987d0328
Author: Matthew James Goins <mjgoins at openflows.com>
Date: Sun Oct 3 00:42:25 2010 -0400
Simplify keyserver-checking logic
---
msva-perl | 29 ++++++++++++-----------------
1 file changed, 12 insertions(+), 17 deletions(-)
diff --git a/msva-perl b/msva-perl
index ffe981b..020a8e1 100755
--- a/msva-perl
+++ b/msva-perl
@@ -19,7 +19,6 @@
use warnings;
use strict;
-
{ package MSVA;
use Data::Dumper;
@@ -457,37 +456,28 @@ use Data::Dumper;
$ret->{message} = sprintf('public key size is less than 1000 bits (was: %d bits)', $cert->pubkey_size());
} else {
$ret->{message} = sprintf('Failed to validate "%s" through the OpenPGP Web of Trust.', $uid);
- my $ks_checked = 0;
+ my $lastloop = 0;
if (get_keyserver_policy() eq 'always') {
fetch_uid_from_keyserver($uid);
- $ks_checked = 1;
+ $lastloop = 1;
+ } elsif (get_keyserver_policy() eq 'never') {
+ $lastloop = 1;
}
- my $afterlocalpass = 0;
my $foundvalid = 0;
# needed because $gnupg spawns child processes
$ENV{PATH} = '/usr/local/bin:/usr/bin:/bin';
+
while (1) {
- if ($afterlocalpass) {
- # while loop termination condition:
- last if ($foundvalid || $ks_checked || get_keyserver_policy() eq 'never');
- fetch_uid_from_keyserver($uid);
- $ks_checked = 1;
- }
foreach my $gpgkey ($gnupg->get_public_keys('='.$uid)) {
my $notvalid = 1;
- my $marginal = 0;
foreach my $tryuid ($gpgkey->user_ids) {
if ($tryuid->as_string eq $uid) {
$notvalid = 0
if ($tryuid->validity eq 'f' ||
$tryuid->validity eq 'u');
- $marginal = 1
- if ($tryuid->validity eq 'm');
}
}
- if ($marginal and $notvalid) {
- # MJGOINS
- } elsif ($notvalid) {
+ if ($notvalid) {
msvalog('verbose', "got a key that was not fully-valid for UID %s\n", $uid);
msvalog('debug', Dumper($gpgkey));
} else {
@@ -510,7 +500,12 @@ use Data::Dumper;
}
}
}
- $afterlocalpass = 1;
+ if ($lastloop) {
+ last;
+ } else {
+ fetch_uid_from_keyserver($uid);
+ $lastloop = 1;
+ }
}
}
} else {
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-privacy/packages/msva-perl.git
More information about the Pkg-privacy-commits
mailing list