Show
Ignore:
Timestamp:
2001-02-12 09:21:37 (8 years ago)
Author:
Thomas Roessler <roessler@…>
Branch:
HEAD
Message:

Auto-detect the micalg used with PGP/MIME signatures.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • compose.c

    r2250 r2276  
    122122  clrtoeol (); 
    123123  if (pgp & PGPSIGN) 
    124   { 
    125124    printw ("%s%s", _(" sign as: "), PgpSignAs ? PgpSignAs : _("<default>")); 
    126     mvprintw (HDR_PGPSIGINFO, 40, "%s%s", _("MIC algorithm: "), 
    127               NONULL(PgpSignMicalg)); 
    128   } 
    129125} 
    130126 
     
    133129  pgp_key_t *p; 
    134130  char input_signas[SHORT_STRING]; 
    135   char input_micalg[SHORT_STRING]; 
    136  
    137   switch (mutt_multi_choice (_("(e)ncrypt, (s)ign, sign (a)s, (b)oth, select (m)ic algorithm, or (f)orget it? "), 
    138                              _("esabmf"))) 
     131 
     132  switch (mutt_multi_choice (_("(e)ncrypt, (s)ign, sign (a)s, (b)oth, or (f)orget it? "), 
     133                             _("esabf"))) 
    139134  { 
    140135  case 1: /* (e)ncrypt */ 
     
    154149      snprintf (input_signas, sizeof (input_signas), "0x%s", pgp_keyid (p)); 
    155150      mutt_str_replace (&PgpSignAs, input_signas); 
    156       mutt_str_replace (&PgpSignMicalg, pgp_pkalg_to_mic (p->algorithm)); 
    157151      pgp_free_key (&p); 
    158152       
     
    173167    break; 
    174168 
    175   case 5: /* select (m)ic algorithm */ 
    176     if (!(bits & PGPSIGN)) 
    177       mutt_error _("This doesn't make sense if you don't want to sign the message."); 
    178     else 
    179     { 
    180       /* Copy the existing MIC algorithm into place */ 
    181       strfcpy(input_micalg, NONULL (PgpSignMicalg), sizeof (input_micalg)); 
    182  
    183       if (mutt_get_field (_("MIC algorithm: "), input_micalg, sizeof (input_micalg), 0) == 0) 
    184       { 
    185         if (mutt_strcasecmp (input_micalg, "pgp-md5") && mutt_strcasecmp (input_micalg, "pgp-sha1") 
    186            && mutt_strcasecmp (input_micalg, "pgp-rmd160")) 
    187         { 
    188           mutt_error _("Unknown MIC algorithm, valid ones are: pgp-md5, pgp-sha1, pgp-rmd160"); 
    189         } 
    190         else  
    191           mutt_str_replace (&PgpSignMicalg, input_micalg); 
    192       } 
    193     } 
    194     break; 
    195  
    196   case 6: /* (f)orget it */ 
     169  case 5: /* (f)orget it */ 
    197170    bits = 0; 
    198171    break;