Eike Rathke [Mon, 18 Jun 2018 20:04:47 +0000 (22:04 +0200)]
Allow larger passphrase timeout values
This came up in the comp.mail.mutt newsgroup where a user wasn't
satisfied with the SHORT_MAX seconds ~9 hours limit on passphrase
timeouts.
For the first time made it necessary for the options parser to be
able to parse numbers as long values. Also, introduced
mutt_add_timeout() to detect possible overflow before adding a
timeout to a time_t value and truncate to TIME_T_MAX instead.
Kevin McCarthy [Tue, 5 Jun 2018 04:31:33 +0000 (21:31 -0700)]
Add GnuPG status fd checks for inline pgp.
The difficulty is that "BEGIN PGP MESSAGE" could be a signed and
armored part, so we can't fail hard if it isn't encrypted.
Change pgp_check_decryption_okay() to return more status codes, with
>=0 indicating an actual decryption; -2 and -1 indicating plaintext
found; and -3 indicating an actual DECRYPTION_FAILED status code seen.
Fail hard on -3, but change the message for -2 and -1 to indicate the
message was not encrypted.
Kevin McCarthy [Mon, 4 Jun 2018 22:40:57 +0000 (15:40 -0700)]
Add $pgp_check_gpg_decrypt_status_fd.
If set (the default) mutt performs more thorough checking of the
$pgp_decrypt_command status output for GnuPG result codes.
Ticket #39 revealed that GnuPG (currently) does not protect against
messages that have been manipulated to contain an empty encryption
packet followed by a plaintext packet.
A huge thanks to Marcus Brinkmann for researching this issue, taking
the time to report it to us (and the GnuPG team), and taking even more
time to clarify exactly what needed to be checked for.
Richard Russon [Thu, 14 Jun 2018 18:12:33 +0000 (19:12 +0100)]
fix non-empty buffers
Insert a few `mutt_buffer_reset()`s.
Commit 9d6a2418 replaced a lot of `snprintf()`s with `mutt_buffer_printf()`.
Unfortunately, a few of the original lines were relying on `snprintf()`
writing over the beginning of the buffer.
Richard Russon [Tue, 12 Jun 2018 01:45:59 +0000 (02:45 +0100)]
merge: mass tidy-up of ncrypt
* drop unnec typedefs
* fold CryptModuleFunctions into CryptModuleSpecs
* drop redirect functions
* tidy headers
* doxygen: Document the encryption API
* doxygen: document api implementors
* unify the naming of all the ncrypt API functions
* doxygen: document the ncrypt api wrappers
Richard Russon [Wed, 6 Jun 2018 14:58:24 +0000 (15:58 +0100)]
merge: increase and unify buffer sizes
* adjust the size of some general buffers
* Use sizeof() rather than constants
* Create a large buffer for command strings
* Enlarge buffers from _POSIX_PATH_MAX to PATH_MAX
* Enlarge buffers from LONG_STRING to PATH_MAX
Mehdi ABAAKOUK [Wed, 30 May 2018 14:27:38 +0000 (16:27 +0200)]
pager: index must be rebuilt on MUTT_REOPENED
When we call mx_check_mailbox() and something change
header in Context->hdrs may have been updated.
In case of MUTT_NEW_MAIL, the page rebuild the index, and fixup
rd.index->current/max and extra->hdr. If the extra->hdr change
like when an above the opened one, or the selected one, is deleted, the
pager is closed.
In case of MUTT_REOPENED we do nothing. Making rd.index->current/max
wrong and extra->hdr perhaps pointing to something that doesn't exist
anymore.
This change makes the MUTT_REOPENED behavior similar to MUTT_NEW_MAIL.
Note that we this the pager have good change to be closed with the
mailbox is modified externally, just like the current MUTT_NEW_MAIL
behavior.
Pietro Cerutti [Wed, 30 May 2018 12:44:14 +0000 (13:44 +0100)]
Handle a BAD response in AUTH PLAIN w/o initial response (#1237)
The incorrect assumption was that the first line of an AUTH PLAIN w/o
I-R was always successful, so the client could write the second line and
end up with a readable socket that would be activated by the server
sending the final OK or BAD response.
If however the first line results in a BAD response already, the server
wouldn't write anything else and the client would be left polling for an
additional response that never arrives, effectively hanging the process.
Pietro Cerutti [Tue, 29 May 2018 15:39:23 +0000 (15:39 +0000)]
Avoid regenerating hcache/hcversion.h after building objects in hcache
Specifying the hcache directory asqa dependency for hcache/hcversion.h
means that the latter will be regenerated whenever the hcache directory
is changed, such as when object files are written into it. The net
effect is that "make; make" regenerates hcache/hcversion.h twice.
This commit fixes this problem by explicitely creating the hcache
directory as part of the hcache/hcversion.h target.