Home GnuPG

Remove partial crypto states and supporting code

Description

Remove partial crypto states and supporting code

Remove KMMsgPartiallyEncrypted and KMMsgPartiallySigned, which would
only ever be returned for TextMessagePart's with inline PGP blocks.
This distinction was not actually being used, anywhere, but added
complexity, and introduced various semantic problems:

  • Other parts with some encrypted subparts would never return KMMsgPartiallyEncrypted/Signed -> inconsistent
  • Other parts with all (separately) encrypted subparts would not return KMMsgFullEncrypted/Signed -> inconsistent
  • The detection logic in TextMessagePart::parseContent() (ignoring any trailing non-crypto block) was very questionable in the first place
  • TextMessagePart::signatureState() never worked as intended, as signatures are not available until verified, i.e. not during initialization, so would always fall back to MessagePart:signatureState()
  • If it had ever worked, we'd have then hit an assert in signatureFromMessagePart() (partmodel.cpp), as signatures() would still be empty in that case
  • Similar assumptions WRT non-empty encryptions() would also have been violated, but apparently did not exist in the codebase

Now that OTP::collectContentParts() returns the leaf nodes, rather than
the TextMessagePart, I cannot see any remaining need for the special
casing of TextMessagePart. Should we discover any use case for
KMMsgPartially(Encrypted/Signed), I rather suggest to add a new
(recursive) MessagePart::hasSignedSubParts().

Details

Provenance
Thomas Friedrichsmeier <thomas.friedrichsmeier@kdemail.net>Authored on Wed, Jul 1, 3:10 PM
Parents
rMTP818f0bf38746: Fix logic for detecting sibling parts
Branches
Unknown
Tags
Unknown

Event Timeline

Thomas Friedrichsmeier <thomas.friedrichsmeier@kdemail.net> committed rMTP0d33e2e7a930: Remove partial crypto states and supporting code (authored by Thomas Friedrichsmeier <thomas.friedrichsmeier@kdemail.net>).Wed, Jul 8, 4:20 PM