Skip to content

Commit

Permalink
[mms] Cleaner handling of broken S/MIME signed messages.
Browse files Browse the repository at this point in the history
Conflicts:
	imp/docs/CHANGES
	imp/package.xml
  • Loading branch information
slusarz committed Jan 14, 2014
1 parent a639ce5 commit 882818e
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
1 change: 1 addition & 0 deletions imp/docs/CHANGES
Expand Up @@ -42,6 +42,7 @@ v6.2.0-git
v6.1.7
------

[mms] Cleaner handling of broken S/MIME signed messages.
[mms] Fix displaying user-defined message headers when multiple-headers exist
in a single message.
[mjr] Honor recurrence-id range values when deleting recurring events (Bug
Expand Down
13 changes: 12 additions & 1 deletion imp/lib/Mime/Viewer/Smime.php
Expand Up @@ -256,7 +256,8 @@ protected function _parseSignedData($sig_only = false)
{
$partlist = array_keys($this->_mimepart->contentTypeMap());
$base_id = reset($partlist);
$sig_id = Horde_Mime::mimeIdArithmetic(next($partlist), 'next');
$data_id = next($partlist);
$sig_id = Horde_Mime::mimeIdArithmetic($data_id, 'next');

/* Initialize inline data. */
$status = new IMP_Mime_Status(_("The data in this part has been digitally signed via S/MIME."));
Expand All @@ -274,6 +275,16 @@ protected function _parseSignedData($sig_only = false)
return null;
}

/* Sanity checking to make sure MIME structure is correct. */
if (!in_array($sig_id, $partlist)) {
$status->action(IMP_Mime_Status::ERROR);
$cache->smime[$base_id]['wrap'] = 'mimePartWrapInvalid';
$status->addText(_("Invalid S/MIME data."));
/* This will suppress displaying the invalid part. */
$cache->smime[$base_id]['sig'] = $data_id;
return null;
}

$imp_contents = $this->getConfigParam('imp_contents');
$stream = $imp_contents->isEmbedded($base_id)
? $this->_mimepart->getMetadata('imp-smime-decrypt')->stream
Expand Down
1 change: 1 addition & 0 deletions imp/package.xml
Expand Up @@ -3445,6 +3445,7 @@
<date>2013-11-19</date>
<license uri="http://www.horde.org/licenses/gpl">GPL-2.0</license>
<notes>
* [mms] Cleaner handling of broken S/MIME signed messages.
* [mms] Fix displaying user-defined message headers when multiple-headers exist in a single message.
* [mjr] Honor recurrence-id range values when deleting recurring events (Bug #12746).
* [mms] Don&apos;t provide links to view attachments in compose screen unless the attachment can be displayed (Bug #12841).
Expand Down

0 comments on commit 882818e

Please sign in to comment.