Changeset 4129:8c97980f1af1
- 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:
-
Legend:
- Unmodified
- Added
- Removed
-
|
r4108
|
r4129
|
|
| 167 | 167 | { |
| 168 | 168 | /* update crypto information for this message */ |
| | 169 | cur->security &= ~(GOODSIGN|BADSIGN); |
| 169 | 170 | cur->security |= crypt_query (cur->content); |
| 170 | 171 | |
-
|
r4127
|
r4129
|
|
| 376 | 376 | if (rc == -1 || rv) maybe_goodsig = 0; |
| 377 | 377 | |
| 378 | | state_putc ('\n', s); |
| 379 | 378 | state_attach_puts (_("[-- End of PGP output --]\n\n"), s); |
| 380 | 379 | } |
| … |
… |
|
| 388 | 387 | pgp_void_passphrase (); |
| 389 | 388 | |
| 390 | | safe_fclose (&tmpfp); |
| 391 | | mutt_unlink (tmpfname); |
| 392 | | safe_fclose (&pgpout); |
| 393 | | mutt_unlink (outfile); |
| 394 | | return; |
| | 389 | goto out; |
| 395 | 390 | } |
| 396 | 391 | /* |
| … |
… |
|
| 441 | 436 | state_attach_puts (_("[-- END PGP SIGNED MESSAGE --]\n"), s); |
| 442 | 437 | } |
| 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 | | } |
| 454 | 438 | } |
| 455 | 439 | else |
| … |
… |
|
| 462 | 446 | } |
| 463 | 447 | |
| | 448 | out: |
| 464 | 449 | m->goodsig = (maybe_goodsig && have_any_sigs); |
| 465 | 450 | |
| | 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 | |
| 466 | 462 | if (needpass == -1) |
| 467 | 463 | { |
| … |
… |
|
| 745 | 741 | char pgptmpfile[_POSIX_PATH_MAX]; |
| 746 | 742 | pid_t thepid; |
| | 743 | int rv; |
| 747 | 744 | |
| 748 | 745 | mutt_mktemp (pgperrfile); |
| … |
… |
|
| 800 | 797 | |
| 801 | 798 | fclose (pgpout); |
| 802 | | mutt_wait_filter (thepid); |
| | 799 | rv = mutt_wait_filter (thepid); |
| 803 | 800 | mutt_unlink(pgptmpfile); |
| 804 | 801 | |
| … |
… |
|
| 807 | 804 | fflush (pgperr); |
| 808 | 805 | rewind (pgperr); |
| 809 | | if (pgp_copy_checksig (pgperr, s->fpout) == 0 && p) |
| | 806 | if (pgp_copy_checksig (pgperr, s->fpout) == 0 && !rv && p) |
| 810 | 807 | p->goodsig = 1; |
| | 808 | else |
| | 809 | p->goodsig = 0; |
| 811 | 810 | state_attach_puts (_("[-- End of PGP output --]\n\n"), s); |
| 812 | 811 | } |