diff options
author | Byron Jones <bjones@mozilla.com> | 2012-03-07 16:50:32 +0100 |
---|---|---|
committer | Byron Jones <bjones@mozilla.com> | 2012-03-07 16:50:32 +0100 |
commit | 4d7d97b3aac40b54ec9b36259710e6ba182a06ae (patch) | |
tree | 27fac65a072a0968ff704ab6675397aa0fac6eba /extensions/SecureMail | |
parent | 2bea3e2abd44e07198199eb9ac86aebc4c3f0f2a (diff) | |
download | bugzilla-4d7d97b3aac40b54ec9b36259710e6ba182a06ae.tar.gz bugzilla-4d7d97b3aac40b54ec9b36259710e6ba182a06ae.tar.xz |
Bug 729558: fix securemail corruption of unicode emails
Diffstat (limited to 'extensions/SecureMail')
-rw-r--r-- | extensions/SecureMail/Extension.pm | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/extensions/SecureMail/Extension.pm b/extensions/SecureMail/Extension.pm index 97722d9ac..4e1bbf237 100644 --- a/extensions/SecureMail/Extension.pm +++ b/extensions/SecureMail/Extension.pm @@ -32,6 +32,7 @@ use Crypt::OpenPGP::Armour; use Crypt::OpenPGP::KeyRing; use Crypt::OpenPGP; use Crypt::SMIME; +use Encode; our $VERSION = '0.4'; @@ -256,11 +257,16 @@ sub _make_secure { ################## # PGP Encryption # ################## - my $body = $email->body; + + # We need to work with the body as a decoded string as we may + # modify it + my $body = $email->body_str; if ($is_bugmail) { # Subject gets placed in the body so it can still be read $body = "Subject: $subject\n\n" . $body; } + # Crypt::OpenPGP requires an encoded string + $body = encode('UTF8', $body); my $pubring = new Crypt::OpenPGP::KeyRing(Data => $key); my $pgp = new Crypt::OpenPGP(PubRing => $pubring); |