Aleksander Machniak
2016-01-20 c7af660bfc2d100117d0d5e7da16ab62d27595ba
Fix boundary separator in signed messages
1 files modified
12 ■■■■■ changed files
plugins/enigma/lib/enigma_mime_message.php 12 ●●●●● patch | view | raw | blame | history
plugins/enigma/lib/enigma_mime_message.php
@@ -142,6 +142,8 @@
    public function addPGPSignature($body)
    {
        $this->signature = $body;
        // Reset Content-Type to be overwritten with valid boundary
        unset($this->headers['Content-Type']);
    }
    /**
@@ -152,6 +154,8 @@
    public function setPGPEncryptedBody($body)
    {
        $this->encrypted = $body;
        // Reset Content-Type to be overwritten with valid boundary
        unset($this->headers['Content-Type']);
    }
    /**
@@ -177,13 +181,13 @@
        $this->checkParams();
        if ($this->type == self::PGP_SIGNED) {
            $body   = "This is an OpenPGP/MIME signed message (RFC 4880 and 3156)";
            $params = array(
                'preamble'     => "This is an OpenPGP/MIME signed message (RFC 4880 and 3156)",
                'content_type' => "multipart/signed; micalg=pgp-sha1; protocol=\"application/pgp-signature\"",
                'eol'          => $this->build_params['eol'],
            );
            $message = new Mail_mimePart($body, $params);
            $message = new Mail_mimePart('', $params);
            if (!empty($this->body)) {
                $headers = $this->message->headers();
@@ -206,13 +210,13 @@
            }
        }
        else if ($this->type == self::PGP_ENCRYPTED) {
            $body   = "This is an OpenPGP/MIME encrypted message (RFC 4880 and 3156)";
            $params = array(
                'preamble'     => "This is an OpenPGP/MIME encrypted message (RFC 4880 and 3156)",
                'content_type' => "multipart/encrypted; protocol=\"application/pgp-encrypted\"",
                'eol'          => $this->build_params['eol'],
            );
            $message = new Mail_mimePart($body, $params);
            $message = new Mail_mimePart('', $params);
            $message->addSubpart('Version: 1', array(
                    'content_type' => 'application/pgp-encrypted',