Re: [PATCH 2/4] util/crypto: identify and repair "Mixed Up" mangled messages

Subject: Re: [PATCH 2/4] util/crypto: identify and repair "Mixed Up" mangled messages

Date: Thu, 30 May 2019 02:18:57 +0000

To: Daniel Kahn Gillmor, Notmuch Mail


From: Rollins, Jameson

On Tue, May 28 2019, Daniel Kahn Gillmor <> wrote:
> This patch implements a functional identification and repair process
> for "Mixed Up" MIME messages as described in
> The detection test is not entirely complete, in that it does not
> verify the contents of the latter two message subparts, but this is
> probably safe to skip, because those two parts are unlikely to be
> readable anyway, and the only part we are effectively omitting (the
> first subpart) is guaranteed to be empty anyway, so its removal can be
> reversed if you want to do so.  I've left FIXMEs in the code so that
> anyone excited about adding these additional checks can see where to
> put them in.
> I'll use this functionality in the next two patches.
> Signed-off-by: Daniel Kahn Gillmor <>
> ---
>  util/crypto.c | 80 +++++++++++++++++++++++++++++++++++++++++++++++++++
>  util/crypto.h |  9 ++++++
>  2 files changed, 89 insertions(+)

I understand that this fix is for multipart/encrypted messages, but I'm
not sure I would call the repair function itself a "crypto function".
Given that I can imagine more repair functions in the future, would it
make sense to break them out into their own library?

notmuch mailing list