make sure fingerprints and validity get passed through to the marginal UI appropriately
authorDaniel Kahn Gillmor <dkg@fifthhorseman.net>
Thu, 24 Mar 2011 05:09:27 +0000 (01:09 -0400)
committerDaniel Kahn Gillmor <dkg@fifthhorseman.net>
Thu, 24 Mar 2011 05:09:27 +0000 (01:09 -0400)
Crypt/Monkeysphere/MSVA.pm
Crypt/Monkeysphere/MSVA/MarginalUI.pm

index 0b71816bed84a7dee446fc0fd0852dd2577b603f..6442fbbf9b90768ae642e71c4dee5d7650fb6156 100755 (executable)
       $ret->{valid} = JSON::true;
       $ret->{message} = sprintf('Successfully validated "%s" through the OpenPGP Web of Trust.', $uid);
     } else {
-      my @subvalid_key_fprs= map { $_->{fingerprint} }   @{$uid_query->{subvalid_keys}};
-
       my $resp = Crypt::Monkeysphere::MSVA::MarginalUI->ask_the_user($gnupg,
                                                                     $uid,
-                                                                    \@subvalid_key_fprs,
+                                                                    $uid_query->{subvalid_keys},
                                                                     getpidswithsocketinode($clientinfo->{inode}),
                                                                     $logger);
       msvalog('info', "response: %s\n", $resp);
index c386a98854edfcca7e2786f061e9737cc9a880ac..4ccf04870788ffdf79f83f54a5608ebd745259be 100755 (executable)
@@ -46,7 +46,7 @@
     }
 
     foreach my $keyfpr (@subvalid_key_fprs) {
-      my $fprx = sprintf('0x%.40s', $keyfpr->{fpr}->as_hex_string());
+      my $fprx = sprintf('0x%.40s', $keyfpr->{fingerprint}->as_hex_string());
       $logger->log('debug', "checking on %s\n", $fprx);
       foreach my $gpgkey ($gnupg->get_public_keys_with_sigs($fprx)) {
         $logger->log('debug', "found key %.40s\n", $gpgkey->fingerprint->as_hex_string);
@@ -72,7 +72,7 @@
               if ($cert->hex_id =~ /^([A-Fa-f0-9]{16})$/) {
                 my $certid = $1;
                 # disregard self-certifications (see MS # 2569):
-                if (lc($certid) eq lc(substr($keyfpr->{fpr}->as_hex_string(), -16))) {
+                if (lc($certid) eq lc(substr($keyfpr->{fingerprint}->as_hex_string(), -16))) {
                   $logger->log('debug', "found self-sig 0x%.16s\n", $certid);
                   next;
                 }
@@ -159,7 +159,7 @@ Would you like to temporarily accept this certificate for this peer?",
 Peer's OpenPGP key fingerprint: 0x%.40s
 GnuPG calculated validity for the peer: %s",
                             $uid,
-                            $keyfpr->{fpr}->as_hex_string,
+                            $keyfpr->{fingerprint}->as_hex_string,
                             $keyfpr->{val},
                            );
           # FIXME: what about revoked certifications?