Home GnuPG
Diffusion GpgOL 72e95d2539e2

Improve protected headers handling

Description

Improve protected headers handling

* src/mail.cpp (Mail::updateHeaders_o): New. Handle data from
protected headers.
(Mail::parsing_done): Call updateHeaders.
* src/mimedataprovider.cpp: Check for protected headers
version.
(t2body): Handle that a part with protecteded headers might
also be data.
(MimeDataProvider::collect_input_lines): Collect potential
legacy part into a helper buffer.
(get_header): New helper.
(MimeDataProvider::finalize): Check for legacy part and
handle protected headers.
(MimeDataProvider::get_protected_header): New helper.
* src/oomhelp.cpp (invoke_oom_method_with_string): New helper.
* src/parsecontroller.cpp (get_internal_subject): Replace with
get_protected_header.

This fixes an issue where content might be hidden related
to the protected header parsing as shown by the
"unfortunately complex" test message of the protected
headers corpus. It also does the legacy part
handly as per spec and adds some code for
other headers. Except Date. The setting of the
From Addresses might also not work very well as
my tests have shown that the sender object was not
available at the update headers time.

Details

Provenance
aheineckeAuthored on Jan 16 2020, 1:07 PM
Parents
rOc149b0e6cdd5: Tune down an error message to a warning
Branches
Unknown
Tags
Unknown
Tasks
T4796: GpgOL should hide "legacy display" parts when it encounters them