Changeset 4129:8c97980f1af1

Show
Ignore:
Timestamp:
2005-08-01 22:58:18 (3 years ago)
Author:
Brendan Cully <brendan@…>
Branch:
HEAD
Message:

More fiddling with PGP results. When rerunning PGP on a message, clear
old security result bits to avoid confusing messages like 'decrypt failed;
PGP signature successfully verified'.

Files:
2 modified

Legend:

Unmodified
Added
Removed
  • commands.c

    r4108 r4129  
    167167  { 
    168168    /* update crypto information for this message */ 
     169    cur->security &= ~(GOODSIGN|BADSIGN); 
    169170    cur->security |= crypt_query (cur->content); 
    170171   
  • pgp.c

    r4127 r4129  
    376376            if (rc == -1 || rv) maybe_goodsig = 0; 
    377377 
    378             state_putc ('\n', s); 
    379378            state_attach_puts (_("[-- End of PGP output --]\n\n"), s); 
    380379          } 
     
    388387        pgp_void_passphrase (); 
    389388 
    390         safe_fclose (&tmpfp); 
    391         mutt_unlink (tmpfname); 
    392         safe_fclose (&pgpout); 
    393         mutt_unlink (outfile); 
    394         return; 
     389        goto out; 
    395390      } 
    396391      /* 
     
    441436          state_attach_puts (_("[-- END PGP SIGNED MESSAGE --]\n"), s); 
    442437      } 
    443  
    444       if (tmpfp) 
    445       { 
    446         safe_fclose (&tmpfp); 
    447         mutt_unlink (tmpfname); 
    448       } 
    449       if (pgpout) 
    450       { 
    451         safe_fclose (&pgpout); 
    452         mutt_unlink (outfile); 
    453       } 
    454438    } 
    455439    else 
     
    462446  } 
    463447 
     448out: 
    464449  m->goodsig = (maybe_goodsig && have_any_sigs); 
    465450 
     451  if (tmpfp) 
     452  { 
     453    safe_fclose (&tmpfp); 
     454    mutt_unlink (tmpfname); 
     455  } 
     456  if (pgpout) 
     457  { 
     458    safe_fclose (&pgpout); 
     459    mutt_unlink (outfile); 
     460  } 
     461   
    466462  if (needpass == -1) 
    467463  { 
     
    745741  char pgptmpfile[_POSIX_PATH_MAX]; 
    746742  pid_t thepid; 
     743  int rv; 
    747744   
    748745  mutt_mktemp (pgperrfile); 
     
    800797 
    801798  fclose (pgpout); 
    802   mutt_wait_filter (thepid); 
     799  rv = mutt_wait_filter (thepid); 
    803800  mutt_unlink(pgptmpfile); 
    804801   
     
    807804    fflush (pgperr); 
    808805    rewind (pgperr); 
    809     if (pgp_copy_checksig (pgperr, s->fpout) == 0 && p) 
     806    if (pgp_copy_checksig (pgperr, s->fpout) == 0 && !rv && p) 
    810807      p->goodsig = 1; 
     808    else 
     809      p->goodsig = 0; 
    811810    state_attach_puts (_("[-- End of PGP output --]\n\n"), s); 
    812811  }