get rid of confusing $primarymatch label, and fix matching based on fingerprints
[monkeysphere-validation-agent.git] / Crypt / Monkeysphere / MSVA.pm
index 0133ff49101aeaa94587b08204d78310b8eea94c..74c5b17a96715128976f131edf178a0b0bee3824 100755 (executable)
        }
        # treat primary keys just like subkeys:
        foreach my $subkey ($gpgkey, @{$gpgkey->subkeys}) {
-         my $primarymatch;
-         if (defined $key) {
-           $primarymatch = keycomp($key, $subkey);
-         } else {
-           $primarymatch = 1;
-         }
-         if ($primarymatch) {
+          if ((defined($key) && keycomp($key, $subkey)) ||
+              (defined($fpr) && ($subkey->fingerprint->as_hex_string eq $fpr))) {
            my $iscapable = 0;
            msvalog('verbose', "key 0x%s matches...\n",$subkey->hex_id);
            if ($data->{context} eq 'e-mail') {