Re: Bad Armour Headers

David Shaw <dshaw@jabberwocky.com> Thu, 05 January 2006 16:40 UTC

Received: from odin.ietf.org ([132.151.1.176] helo=ietf.org) by megatron.ietf.org with esmtp (Exim 4.32) id 1EuYAE-0007uz-2t for openpgp-archive@megatron.ietf.org; Thu, 05 Jan 2006 11:40:34 -0500
Received: from above.proper.com (above.proper.com [208.184.76.39]) by ietf.org (8.9.1a/8.9.1a) with ESMTP id LAA06369 for <openpgp-archive@lists.ietf.org>; Thu, 5 Jan 2006 11:39:18 -0500 (EST)
Received: from above.proper.com (localhost.vpnc.org [127.0.0.1]) by above.proper.com (8.12.11/8.12.9) with ESMTP id k05GOWpo026010; Thu, 5 Jan 2006 08:24:32 -0800 (PST) (envelope-from owner-ietf-openpgp@mail.imc.org)
Received: (from majordom@localhost) by above.proper.com (8.12.11/8.12.9/Submit) id k05GOWlj026009; Thu, 5 Jan 2006 08:24:32 -0800 (PST)
X-Authentication-Warning: above.proper.com: majordom set sender to owner-ietf-openpgp@mail.imc.org using -f
Received: from foobar.cs.jhu.edu (foobar.cs.jhu.edu [128.220.13.173]) by above.proper.com (8.12.11/8.12.9) with ESMTP id k05GOVPr026000 for <ietf-openpgp@imc.org>; Thu, 5 Jan 2006 08:24:31 -0800 (PST) (envelope-from dshaw@jabberwocky.com)
Received: from walrus.hsd1.ma.comcast.net (walrus.hsd1.ma.comcast.net [24.60.132.70]) by foobar.cs.jhu.edu (8.11.6/8.11.6) with ESMTP id k05GORS10875 for <ietf-openpgp@imc.org>; Thu, 5 Jan 2006 11:24:27 -0500
Received: from grover.jabberwocky.com (grover.jabberwocky.com [172.24.84.28]) by walrus.hsd1.ma.comcast.net (8.12.8/8.12.8) with ESMTP id k05GOWX6026440 for <ietf-openpgp@imc.org>; Thu, 5 Jan 2006 11:24:32 -0500
Received: from grover.jabberwocky.com (grover.jabberwocky.com [127.0.0.1]) by grover.jabberwocky.com (8.13.1/8.13.1) with ESMTP id k05GOLhM024134 for <ietf-openpgp@imc.org>; Thu, 5 Jan 2006 11:24:21 -0500
Received: (from dshaw@localhost) by grover.jabberwocky.com (8.13.1/8.13.1/Submit) id k05GOLph024133 for ietf-openpgp@imc.org; Thu, 5 Jan 2006 11:24:21 -0500
Date: Thu, 05 Jan 2006 11:24:21 -0500
From: David Shaw <dshaw@jabberwocky.com>
To: ietf-openpgp@imc.org
Subject: Re: Bad Armour Headers
Message-ID: <20060105162421.GC24021@jabberwocky.com>
Mail-Followup-To: ietf-openpgp@imc.org
References: <43BD2D04.6020203@algroup.co.uk> <20060105151541.GA12372@epointsystem.org>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Disposition: inline
In-Reply-To: <20060105151541.GA12372@epointsystem.org>
OpenPGP: id=99242560; url=http://www.jabberwocky.com/david/keys.asc
User-Agent: Mutt/1.5.11
Sender: owner-ietf-openpgp@mail.imc.org
Precedence: bulk
List-Archive: <http://www.imc.org/ietf-openpgp/mail-archive/>
List-Unsubscribe: <mailto:ietf-openpgp-request@imc.org?body=unsubscribe>
List-ID: <ietf-openpgp.imc.org>

On Thu, Jan 05, 2006 at 04:15:41PM +0100, Daniel A. Nagy wrote:
> 
> On Thu, Jan 05, 2006 at 02:28:20PM +0000, Ben Laurie wrote:
> > 
> > draft 15 says:
> > 
> > "    The format of an Armor Header is that of a key-value pair.  A colon
> >     (':' 0x38) and a single space (0x20) separate the key and value.
> >     OpenPGP should consider improperly formatted Armor Headers to be
> >     corruption of the ASCII Armor. "
> > 
> > However, I see improperly formatted headers because of word wrapping.
> > There doesn't appear to be a way to wrap a long line, so I must reject
> > these as badly formatted (not that other implementations do, it seems).
> > 
> > This seems less than optimal.
> 
> Armor headers are very similar to MIME headers. In MIME, the solution is
> that non-empty lines are appended to the previous line, if they begin with a
> whitespace. This transformation can be used in OpenPGP too. In order to
> prevent arbitrary wraps, the length of actual lines should be maximized in
> 64 characters, with longer lines broken in the above described fashion (with
> a whitespace in the beginnig of the trailing part).

This would give a valid encoding for long header lines, but does not
fix the problem at hand.  Word wrapping would still result in broken
armor as word wrapping wouldn't know to put whitespace before the
lines it reformats.

I don't think this is something that OpenPGP should try to fix, beyond
perhaps an interoperability note to be careful of line lengths.

David