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