Re: RFC 2152 - UTF-7 clarification

Viktor Dukhovni <ietf-dane@dukhovni.org> Fri, 09 October 2015 05:08 UTC

Return-Path: <ietf-dane@dukhovni.org>
X-Original-To: ietf@ietfa.amsl.com
Delivered-To: ietf@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id B1A2E1B346E for <ietf@ietfa.amsl.com>; Thu, 8 Oct 2015 22:08:35 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.6
X-Spam-Level:
X-Spam-Status: No, score=-2.6 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7] autolearn=ham
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id iZFZd_nxkwcE for <ietf@ietfa.amsl.com>; Thu, 8 Oct 2015 22:08:34 -0700 (PDT)
Received: from mournblade.imrryr.org (mournblade.imrryr.org [38.117.134.19]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 179081B3469 for <ietf@ietf.org>; Thu, 8 Oct 2015 22:08:34 -0700 (PDT)
Received: by mournblade.imrryr.org (Postfix, from userid 1034) id 01731284B56; Fri, 9 Oct 2015 05:08:32 +0000 (UTC)
Date: Fri, 09 Oct 2015 05:08:32 +0000
From: Viktor Dukhovni <ietf-dane@dukhovni.org>
To: ietf@ietf.org
Subject: Re: RFC 2152 - UTF-7 clarification
Message-ID: <20151009050832.GL15070@mournblade.imrryr.org>
References: <20151008160600.GA15070@mournblade.imrryr.org> <928132625.2581444329625907.JavaMail.root@shefa>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Disposition: inline
In-Reply-To: <928132625.2581444329625907.JavaMail.root@shefa>
User-Agent: Mutt/1.5.24 (2015-08-30)
Archived-At: <http://mailarchive.ietf.org/arch/msg/ietf/J0-w06qhP_TFLY5cD4wO5t8mATE>
X-BeenThere: ietf@ietf.org
X-Mailman-Version: 2.1.15
Precedence: list
Reply-To: ietf@ietf.org
List-Id: IETF-Discussion <ietf.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/ietf>, <mailto:ietf-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/ietf/>
List-Post: <mailto:ietf@ietf.org>
List-Help: <mailto:ietf-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/ietf>, <mailto:ietf-request@ietf.org?subject=subscribe>
X-List-Received-Date: Fri, 09 Oct 2015 05:08:35 -0000

On Thu, Oct 08, 2015 at 09:40:25PM +0300, A. Rothman wrote:

> Just in case someone missed it (I almost did): Mark added his own
> detailed comments on the test cases, but they got buried within a long
> quote from my original email so may have gone unnoticed. To recap, here
> are the two interpretations:
> 
> +A-             empty + 6 (unnecessary) padding bits
> +AA-            empty + 12 (unnecessary) padding bits
> +AAA-           \U+0000, and 2 (required) padding bits
> +AAAA-          \U+0000, and 8 (6 extra) padding bits
> +AAAAA-         \U+0000, and 14 (12 extra) padding bits
> +AAAAAA-        \U+0000\U+0000, and 4 (required) padding bits
> +AAAAAAA-       \U+0000\U+0000, and 10 (6 extra) padding bits
> 
> 
> +A-             illegal	!modified base64
> +AA-            illegal	!a multiple of 16 bits in modified base64
> +AAA-           legal   0x0000 (last 2 bits zero)
> +AAAA-          illegal !a multiple of 16 bits in modified base64
> +AAAAA-         illegal	!modified base64
> +AAAAAA-        legal   0x0000, 0x0000 (last 4 bits zero)
> +AAAAAAA-       illegal !a multiple of 16 bits in modified base64
> 
> 
> Does anyone else want to vote or comment on the two interpretations above?

Thanks for pointing this out more clearly.  Yes, they disagree.
However, the manner in which they disagree is rather simple.

They agree in all the cases where the padding is *minimal*.

The first variant always tolerates non-minimal padding allowing
anything less than 16 bits per the specification.  The second
variant never tolerates non-minimal padding, because there's no
need to produce it.

It is clear that clients should produce minimal padding, and we
seem to disgree on  wether to apply Postel's principle to the
decoder or not.

This is not a major disagreement, such differences of interpretation
are endemic whether the standard is clear or not.  Many implementors
are lazy, and stop writing code when the expected cases work.

While this is no excuse for ambiguous specifications, in this case
I don't think a revision is warranted.  Encoders that generate
sensibly minimal padding will not run into any friction with
non-broken decoders.  Encoders that get creative might find that
some decoders object whether the standard allows their creativity
or not.

-- 
	Viktor.