Skip to content

Commit

Permalink
FIX Unset parent mime part body, not just children
Browse files Browse the repository at this point in the history
The message itself is a MimePart, where the PGP signer will set
the contents as children (and clear existing ones), it wrongly did
not unset the body - meaning that a message as a single body was to
be transmitted as plain text as the message body, then also encrypted
as an attachemnt. This made PGP encryption pointeless, and is a rather
glaring bug.
  • Loading branch information
Dylan Wagstaff committed Nov 25, 2019
1 parent edf6173 commit 0efd0e4
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/SwiftSignerCryptGPG.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ public function signMessage(Swift_Message $message)
// Prepare message final form
$message
->setEncoder($encoder)
->setBody(null)
->setChildren([$pgpmime, $encryptedMessage]);

$type = $message->getHeaders()->get('Content-Type');
Expand Down

0 comments on commit 0efd0e4

Please sign in to comment.