~ubuntu-dev/ubuntu/lucid/mutt/lucid-201002110857

« back to all changes in this revision

Viewing changes to pgpkey.c

  • Committer: Bazaar Package Importer
  • Author(s): Bhavani Shankar
  • Date: 2009-06-07 17:30:03 UTC
  • mto: (16.2.1 experimental) (2.3.1 squeeze)
  • mto: This revision was merged to the branch mainline in revision 21.
  • Revision ID: james.westby@ubuntu.com-20090607173003-rg37ui3h2bbv7wl0
Tags: upstream-1.5.19
ImportĀ upstreamĀ versionĀ 1.5.19

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
 
 * Copyright (C) 1996,1997 Michael R. Elkins <me@mutt.org>
3
 
 * Copyright (c) 1998,1999 Thomas Roessler <roessler@does-not-exist.org>
 
2
 * Copyright (C) 1996-7,2007 Michael R. Elkins <me@mutt.org>
 
3
 * Copyright (c) 1998-2003 Thomas Roessler <roessler@does-not-exist.org>
4
4
 * 
5
5
 *     This program is free software; you can redistribute it
6
6
 *     and/or modify it under the terms of the GNU General Public
522
522
  mutt_make_help (buf, sizeof (buf), _("Help"), MENU_PGP, OP_HELP);
523
523
  strcat (helpstr, buf);        /* __STRCAT_CHECKED__ */
524
524
 
525
 
  menu = mutt_new_menu ();
 
525
  menu = mutt_new_menu (MENU_PGP);
526
526
  menu->max = i;
527
527
  menu->make_entry = pgp_entry;
528
 
  menu->menu = MENU_PGP;
529
528
  menu->help = helpstr;
530
529
  menu->data = KeyTable;
531
530
 
818
817
  ADDRESS *r, *p;
819
818
  LIST *hints = NULL;
820
819
 
821
 
  int weak    = 0;
822
 
  int invalid = 0;
823
820
  int multi   = 0;
824
 
  int this_key_has_strong;
825
 
  int this_key_has_weak;
826
 
  int this_key_has_invalid;
827
821
  int match;
828
822
 
829
823
  pgp_key_t keys, k, kn;
863
857
      continue;
864
858
    }
865
859
 
866
 
    this_key_has_weak    = 0;   /* weak but valid match   */
867
 
    this_key_has_invalid = 0;   /* invalid match          */
868
 
    this_key_has_strong  = 0;   /* strong and valid match */
869
860
    match                = 0;   /* any match              */
870
861
 
871
862
    for (q = k->address; q; q = q->next)
886
877
          if (the_valid_key && the_valid_key != k)
887
878
            multi             = 1;
888
879
          the_valid_key       = k;
889
 
          this_key_has_strong = 1;
890
880
        }
891
 
        else if ((validity & PGP_KV_MATCH) && !(validity & PGP_KV_VALID))
892
 
          this_key_has_invalid = 1;
893
 
        else if ((validity & PGP_KV_MATCH) 
894
 
                 && (!(validity & PGP_KV_STRONGID) || !(validity & PGP_KV_ADDR)))
895
 
          this_key_has_weak    = 1;
896
881
      }
897
882
 
898
883
      rfc822_free_address (&r);
899
884
    }
900
885
 
901
 
    if (match && !this_key_has_strong && this_key_has_invalid)
902
 
      invalid = 1;
903
 
    if (match && !this_key_has_strong && this_key_has_weak)
904
 
      weak = 1;
905
 
    
906
886
    if (match)
907
887
    {
908
888
      *last  = pgp_principal_key (k);
915
895
  
916
896
  if (matches)
917
897
  {
918
 
    if (the_valid_key && !multi /* && !weak 
919
 
        && !(invalid && option (OPTPGPSHOWUNUSABLE)) */)
 
898
    if (the_valid_key && !multi)
920
899
    {
921
900
      /*
922
901
       * There was precisely one strong match on a valid ID.