Subject: Re: MIME media type literal packet in OpenPGP
From: Jon Callas <[email-masked]>
To: IETF OpenPGP Working Group <[email-masked]>
Date: Mon, 14 Mar 2011 11:13:41 -0700
List-Id: <ietf-openpgp.imc.org>

> I have two complaints about this proposal:
> 
> 1. There is an already widely used way of encapsulating MIME content
> into PGP messages, PGP/MIME (a.k.a. RFC 3156), and this proposal is not
> compatible with it.
> 
> 2. In this proposal, mime type would not be part of the hashed content
> for digital signatures, meaning that it can be changed without breaking
> the digital signature. This is dangerous. PGP/MIME does not have this
> weakness.

Comments on your comments, Daniel.

I think the word MIME is a misnomer, because it has nothing to do content. It has to do with data typing only. It's a way to say that a PGP blob in (e.g. a web page) is of a certain type. Without it, you have to infer type from the file name, which is suboptimal. All that it does is let you say that a PGP output has a certain media type explicitly.

If you're doing a MIME mail message, then yes, that's a much better way to express things. But if you're doing secured web content, especially dynamic content (think Web 2.0 etc.), then it's much better to put the exact media type in the blob, so it can be handled properly when the higher levels get it.

You're absolutely right that it's unsigned. That's unfortunate. It is also what we have to work with. It is, at least, covered by an MDC packet, which is better than nothing and likely good enough. On the other side of it, you don't have to get into trust issues, either, which is a plus. 

This grew out of some fantastic work that Vinnie did for secure Web 2.0 content using OpenPGP as the encryption framework. It let you do things like Facebook messages and lists that Facebook couldn't read itself.

	Jon

Date: Fri, 11 Mar 2011 17:03:42 -0700
From: Aaron Toponce <[email-masked]>
To: IETF OpenPGP Working Group <[email-masked]>
Subject: Re: MIME media type literal packet in OpenPGP
Sender: [email-masked]

This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
--------------enig93FEF70D7CDFBF4AC772717F
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

On 03/11/2011 11:39 AM, Vinnie Moscaritolo wrote:
> * PGP Signed: 03/11/2011 at 10:39:52 AM

Curious, but I can't find the signature, even though your email says
that it is signed. Am I missing something?

--=20
=2E o .   o . o   . . o   o . .   . o .
=2E . o   . o o   o . o   . o o   . . o
o o o   . o .   . o o   o o .   o o o

--------------enig93FEF70D7CDFBF4AC772717F
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

--------------enig93FEF70D7CDFBF4AC772717F--

Date: Fri, 11 Mar 2011 22:24:42 +0100
From: "Daniel A. Nagy" <[email-masked]>
Organization: ePoint Systems Ltd.
To: Vinnie Moscaritolo <[email-masked]>
CC: IETF OpenPGP Working Group <[email-masked]>
Subject: Re: MIME media type literal packet in OpenPGP
Sender: [email-masked]

This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
--------------enig421BC3F78EEA878DA8B36444
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

On 03/11/2011 07:39 PM, Vinnie Moscaritolo wrote:
> * PGP Signed: 03/11/2011 at 10:39:52 AM
> Greating;
>=20
> I just posted an informational draft about some minor changes that the
> PGP sdk
> is now supporting.   comments and complaints are welcome.

Hello,

I have two complaints about this proposal:

1. There is an already widely used way of encapsulating MIME content
into PGP messages, PGP/MIME (a.k.a. RFC 3156), and this proposal is not
compatible with it.

2. In this proposal, mime type would not be part of the hashed content
for digital signatures, meaning that it can be changed without breaking
the digital signature. This is dangerous. PGP/MIME does not have this
weakness.

--=20
Daniel

--------------enig421BC3F78EEA878DA8B36444
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

--------------enig421BC3F78EEA878DA8B36444--

Subject: Re: MIME media type literal packet in OpenPGP
From: David Shaw <[email-masked]>
Date: Fri, 11 Mar 2011 14:49:15 -0500
Cc: IETF OpenPGP Working Group <[email-masked]>
To: Vinnie Moscaritolo <[email-masked]>
Sender: [email-masked]

On Mar 11, 2011, at 1:39 PM, Vinnie Moscaritolo wrote:

> * PGP Signed: 03/11/2011 at 10:39:52 AM
> Greating;
> 
> I just posted an informational draft about some minor changes that the PGP sdk
> is now supporting.   comments and complaints are welcome.
> 
> be kind, this is my first time doing this.
> 
> http://www.ietf.org/id/draft-moscaritolo-openpgp-literal-00.txt

This looks reasonable enough to me.

I'd add a note to the Security Considerations section that when using this method on a signed document, the MIME type is changeable without invalidating the signature (since the signature hash does not cover the literal packet metadata).  This could allow an attacker to force a particular content handler to run (say, by changing text/plain to image/jpeg).  When encrypting (or signing+encrypting) the MDC helps you here, but for a signed (only) document, there is an opening for mischief.

Also, a minor typo:

   By providing more information beyond the existing binary and text
   formats this extension and can enable the automated selection of an
   appropriate media viewer for the decoded content.

"...and can enable..." should probably be "...can enable...".

I like this bit:

   o  The MIME media type MAY have an OPTIONAL null byte termination.
      Any data that follows such a null byte should be discarded and not
      considered part of the MIME media type.

That effectively leaves open a possibility of having a third (hopefully small) string in that field, which may be useful someday.

Implementation-wise, there is a minor gotcha here as GPG actually allows nulls in the filename.  By default, GPG ignores the filename field, but there is an option (--use-embedded-filename) which tells GPG to actually use that field for the filename, and it will interpret a null as a literal "\0" (i.e. backslash plus zero).  I wouldn't worry terribly much about it, but if this draft is adopted we'll have to update GPG to handle it.

David

From: Vinnie Moscaritolo <[email-masked]>
Subject: MIME media type literal packet in OpenPGP
Date: Fri, 11 Mar 2011 10:39:40 -0800
To: IETF OpenPGP Working Group <[email-masked]>
Sender: [email-masked]

--Apple-Mail-58--560966435
Content-Transfer-Encoding: 7BIT
Content-Type: text/plain;
	charset="us-ascii"

* PGP Signed: 03/11/2011 at 10:39:52 AM

Greating;

I just posted an informational draft about some minor changes that the PGP sdk
is now supporting.   comments and complaints are welcome.

be kind, this is my first time doing this.

http://www.ietf.org/id/draft-moscaritolo-openpgp-literal-00.txt

 This document describes an extension to the OpenPGP Message Format
   that allows a Multipurpose Internet Mail Extension (MIME) Media Type
   (aka Intenet Media type) to be associated with the encoded content.
   By providing more information beyond the existing binary and text
   formats this extension and can enable the automated selection of an
   appropriate media viewer for the decoded content.

-------------------------------------------------------

Vinnie Moscaritolo
Principal Cryptographic Engineer
PGP, now a part of Symantec Corporation
PGP Fingerprint:
7E64 B73D 55AB CEF5 B3BB  E501 E985 A429 9CFE ACEC

* Vinnie Moscaritolo <[email-masked]>
* 0x9CFEACEC:0xBAD29397

--Apple-Mail-58--560966435
Content-Transfer-Encoding: QUOTED-PRINTABLE
Content-Type: text/html;
	charset=us-ascii

<html><head></head><body style=3D"word-wrap: break-word; -webkit-nbsp-mode:=
 space; -webkit-line-break: after-white-space; "><DiV style=3D'background: =
#DAE5F2; font-family: Franklin Gothic Medium, Lucida Grande, Lucida Sans Un=
icode, Arial, Helvetica, sans-serif; color: black; font-size: smaller; ; pa=
dding: .3em; border-style: solid; border-width: 2 2 1 2; border-color: #C3D=
4E5'>
* PGP Signed: 03/11/2011 at 10:39:52 AM<BR>
</DiV><DIv style=3D'border-style: solid; border-width: 1 2 1 2; border-colo=
r: #C3D4E5; padding: 1.2em 1.2em 1.2em 1.4em'>
<div>Greating;</div><div><br></div><div>I just posted an informational draf=
t about some minor changes that the PGP sdk</div><div>is now supporting. &n=
bsp; comments and complaints are welcome.</div><div><br></div><div>be kind,=
 this is my first time doing this.</div><div><br></div><a href=3D"http://ww=
w.ietf.org/id/draft-moscaritolo-openpgp-literal-00.txt">http://www.ietf.org=
/id/draft-moscaritolo-openpgp-literal-00.txt</a><div><br></div><div><div>&n=
bsp;This document describes an extension to the OpenPGP Message Format</div=
><div>&nbsp;&nbsp; that allows a Multipurpose Internet Mail Extension (MIME=
) Media Type</div><div>&nbsp;&nbsp; (aka Intenet Media type) to be associat=
ed with the encoded content.</div><div>&nbsp;&nbsp; By providing more infor=
mation beyond the existing binary and text</div><div>&nbsp;&nbsp; formats t=
his extension and can enable the automated selection of an</div><div>&nbsp;=
&nbsp; appropriate media viewer for the decoded content.</div><br class=3D"=
Apple-interchange-newline"><br></div><div><br><div>
<div><div style=3D"font-size: 11px; ">-------------------------------------=
------------------</div><div style=3D"font-size: 11px; "><br class=3D"khtml=
-block-placeholder"></div><div style=3D"font-size: 11px; ">Vinnie Moscarito=
lo</div><div style=3D"font-size: 11px; ">Principal Cryptographic Engineer</=
div><div style=3D"font-size: 11px; ">PGP, now a part of Symantec&nbsp;Corpo=
ration</div><div style=3D"font-size: 11px; ">PGP Fingerprint:</div><div sty=
le=3D"font-size: 11px; ">7E64 B73D 55AB CEF5 B3BB&nbsp; E501 E985 A429 9CFE=
 ACEC</div><div style=3D"font-size: 11px; "><br class=3D"khtml-block-placeh=
older"></div></div><br class=3D"Apple-interchange-newline">
</div>
<br></div></DIv><dIV style=3D'background: #DAE5F2; font-family: Franklin Go=
thic Medium, Lucida Grande, Lucida Sans Unicode, Arial, Helvetica, sans-ser=
if; color: black; font-size: smaller; ; padding: .3em; border-style: solid;=
 border-width: 1 2 2 2; border-color: #C3D4E5'>
* Vinnie Moscaritolo &lt;[email-masked]&gt;<BR>
* 0x9CFEACEC:0xBAD29397<BR>
</dIV>&nbsp;</body></html>
--Apple-Mail-58--560966435--