List certifiers only once (closes MS # 2573)
authorDaniel Kahn Gillmor <dkg@fifthhorseman.net>
Mon, 20 Dec 2010 07:36:42 +0000 (02:36 -0500)
committerDaniel Kahn Gillmor <dkg@fifthhorseman.net>
Mon, 20 Dec 2010 07:36:42 +0000 (02:36 -0500)
Changelog
Crypt/Monkeysphere/MSVA/MarginalUI.pm

index 7e9e0e40ccb9e67f25ac54662c13b73455978c43..aa282b388d313b6f092bb7d2f9538e1fa9d31f6e 100644 (file)
--- a/Changelog
+++ b/Changelog
@@ -7,9 +7,10 @@ msva-perl (0.8~pre) upstream;
   * allow the use of ports in hostnames (closes MS # 2665)
   * Do not report self-sigs as other certifiers (but report valid,
     non-matching identities independently) (closes MS # 2569)
+  * List certifiers only once (closes MS # 2573)
+
+ -- Daniel Kahn Gillmor <dkg@fifthhorseman.net>  Mon, 20 Dec 2010 02:35:54 -0500
 
- -- Daniel Kahn Gillmor <dkg@fifthhorseman.net>  Mon, 20 Dec 2010 01:53:48 -0500
-  
 msva-perl (0.7) upstream;
 
   * udpated msva-query-agent documentation
index e03f838c4a9f0c5a7fb16825a8677fc6715caaff..c386a98854edfcca7e2786f061e9737cc9a880ac 100755 (executable)
                       # grab the first full or ultimate user ID on
                       # this certifier's key:
                       if ($cuid->validity =~ /^[fu]$/) {
-                        push(@vcertifiers, { key_id => $cert->hex_id,
-                                                  user_id => $cuid->as_string,
-                                                } );
-                        $valid_cuid = 1;
+                        if (0 == grep { $_->{key_id} eq $cert->hex_id && $_->{user_id} eq $cuid->as_string ; } @vcertifiers) {
+                          push(@vcertifiers, { key_id => $cert->hex_id,
+                                               user_id => $cuid->as_string,
+                                             } );
+                          $valid_cuid = 1;
+                        };
                         last;
-                      } elsif ($cuid->validity =~ /^[m]$/) {
-                        $marginal = { key_id => $cert->hex_id,
-                                      user_id => $cuid->as_string,
-                                    };
+                      } elsif ((!defined ($marginal)) &&
+                               $cuid->validity =~ /^[m]$/) {
+                        if (0 == grep { $_->{key_id} eq $cert->hex_id && $_->{user_id} eq $cuid->as_string ; } @mcertifiers) {
+                          $marginal = { key_id => $cert->hex_id,
+                                        user_id => $cuid->as_string,
+                                      };
+                        }
                       }
                     }
                     push(@mcertifiers, $marginal)