Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enigma: Mail containing text + PGP encrypted part is not decrypted #5149

Closed
rcubetrac opened this issue Jan 5, 2016 · 8 comments
Closed

Comments

@rcubetrac
Copy link

Reported by devotedmystic on 5 Jan 2016 07:16 UTC as Trac ticket #1490633

If there is other text before

-----BEGIN PGP MESSAGE-----

or after

-----END PGP MESSAGE-----

decryption fails. It seems Roundcube cannot extract/handle correctly the PGP part.

I tested the same message in Gmail with Mailvelope and it works. So, it's a Roundcube decryption error.

Migrated-From: http://trac.roundcube.net/ticket/1490633

@rcubetrac
Copy link
Author

Severity changed by devotedmystic on 5 Jan 2016 07:18 UTC

normal => critical

@rcubetrac
Copy link
Author

Comment by @alecpl on 5 Jan 2016 07:48 UTC

Are you using Enigma plugin or Mailvelope? What client creates such messages? Could you provide a sample (at least the structure) message?

@rcubetrac
Copy link
Author

Severity changed by @alecpl on 5 Jan 2016 07:48 UTC

critical => major

@rcubetrac
Copy link
Author

Milestone changed by @alecpl on 5 Jan 2016 07:48 UTC

later => 1.2-RC

@rcubetrac
Copy link
Author

Comment by devotedmystic on 5 Jan 2016 08:17 UTC

I removed the "^" (check the symbol, because it is not displaying correctly in this page) in this line (enigma_engine.php):

else if (preg_match('/"^"-----BEGIN PGP MESSAGE-----/', $body)) {

And it works. But the text before is not displayed after decryption.

    function parse_plain(&$p)
    {
        $part = $p[       // exit, if we're already inside a decrypted message
        if (in_array($part->mime_id, $this->encrypted_parts)) {
            return;
        }
        // Get message body from IMAP server
        $body = $this->get_part_body($p['object']('structure'];
), $part->mime_id);
        // @TODO: big message body could be a file resource
        // PGP signed message
        if (preg_match('/"^"-----BEGIN PGP SIGNED MESSAGE-----/', $body)) {
            $this->parse_plain_signed($p, $body);
        }

        // PGP encrypted message
//        else if (preg_match('/"^"-----BEGIN PGP MESSAGE-----/', $body)) {
        else if (preg_match('/-----BEGIN PGP MESSAGE-----/', $body)) { // Extra text was impeding decryption
            $this->parse_plain_encrypted($p, $body);
        }
    }

@rcubetrac
Copy link
Author

Comment by @alecpl on 27 Jan 2016 08:59 UTC

I couldn't find any standard for this, but e.g. Enigmail can handle such messages (with warning that only part of the body was encrypted). So, we should support this too, I suppose.

@rcubetrac
Copy link
Author

Summary changed by @alecpl on 27 Jan 2016 08:59 UTC

Mail containing text + PGP encrypted part is not decrypted

Enigma: Mail containing text + PGP encrypted part is not decrypted

@alecpl
Copy link
Member

alecpl commented Mar 30, 2016

Fixed.

@alecpl alecpl closed this as completed Mar 30, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants