Re: [netmod] Strictness of Base64classic in RFC 7950/7951

Carsten Bormann <cabo@tzi.org> Mon, 27 February 2023 13:32 UTC

Return-Path: <cabo@tzi.org>
X-Original-To: netmod@ietfa.amsl.com
Delivered-To: netmod@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id BB73AC159495 for <netmod@ietfa.amsl.com>; Mon, 27 Feb 2023 05:32:01 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -4.197
X-Spam-Level:
X-Spam-Status: No, score=-4.197 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_DBL_BLOCKED_OPENDNS=0.001, URIBL_ZEN_BLOCKED_OPENDNS=0.001] autolearn=ham autolearn_force=no
Received: from mail.ietf.org ([50.223.129.194]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 5X_uunLI6qip for <netmod@ietfa.amsl.com>; Mon, 27 Feb 2023 05:31:57 -0800 (PST)
Received: from smtp.zfn.uni-bremen.de (smtp.zfn.uni-bremen.de [134.102.50.15]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 46742C157B45 for <netmod@ietf.org>; Mon, 27 Feb 2023 05:31:55 -0800 (PST)
Received: from [192.168.217.124] (p548dc9a4.dip0.t-ipconnect.de [84.141.201.164]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.zfn.uni-bremen.de (Postfix) with ESMTPSA id 4PQLy13TszzDCdq; Mon, 27 Feb 2023 14:31:53 +0100 (CET)
Content-Type: text/plain; charset="utf-8"
Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.7\))
From: Carsten Bormann <cabo@tzi.org>
In-Reply-To: <877cw3jp7w.fsf@nic.cz>
Date: Mon, 27 Feb 2023 14:31:53 +0100
Cc: netmod@ietf.org
X-Mao-Original-Outgoing-Id: 699197512.975613-eade082a2453f7c4929678c0215c6ff3
Content-Transfer-Encoding: quoted-printable
Message-Id: <0DC09E3A-D200-4C25-BBF9-4CA43FBA2DFD@tzi.org>
References: <C4CA45AE-4294-48FF-9210-16783A4B6FEC@tzi.org> <877cw3jp7w.fsf@nic.cz>
To: Ladislav Lhotka <ladislav.lhotka@nic.cz>
X-Mailer: Apple Mail (2.3608.120.23.2.7)
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/vqjLZjT41RDUGOtleS0LLqxmfG4>
Subject: Re: [netmod] Strictness of Base64classic in RFC 7950/7951
X-BeenThere: netmod@ietf.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: NETMOD WG list <netmod.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/netmod>, <mailto:netmod-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/netmod/>
List-Post: <mailto:netmod@ietf.org>
List-Help: <mailto:netmod-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/netmod>, <mailto:netmod-request@ietf.org?subject=subscribe>
X-List-Received-Date: Mon, 27 Feb 2023 13:32:01 -0000

On 2023-02-27, at 12:57, Ladislav Lhotka <ladislav.lhotka@nic.cz> wrote:
> 
>> I this YANG-JSON valid for a `binary`?
>> 
>> "base64encodedvalue==“
> 
> Strictly speaking it isn't because it's out of range of the base64 encoding function.

Right.

> I think though it is OK to be liberal in what we accept here because "base64encodedvaluQ==" is clearly the canonical value in this case, so there is no ambiguity e.g. regarding string equality.

Well, this is the essence of my question (not sure about the part about string equality, though).

draft-iab-protocol-maintenance [0] takes the position that the Postel principle, while historically a good way to implement protocols and get interoperability going, is not to be misunderstood as a mandate for the evolution of protocol ecosystems — protocols are free to be strict, lest they turn into soup (“Protocol Decay” [1]: “...a chain reaction that can create interoperability problems over time”).

I’d like to know whether, on issues like this, YANG is more on the strict side or on the soup side — what do YANG implementations actually do, and what do we want YANG implementations to do?  Is there an implicit “MAY send invalid last character”, which is no different from a “MUST accept invalid last character”?

Background: I’m proposing to add a few control operators to CDDL, including for handling base64classic [2], and in my PoC implementation was of course implementing a strict interpretation, only to be struck by the first example in an RFC I was pointed to.

Grüße, Carsten

[0]: https://www.ietf.org/archive/id/draft-bormann-cbor-cddl-more-control-00.html#name-byte-strings-base16-hex-bas
[1]: https://www.ietf.org/archive/id/draft-iab-protocol-maintenance-12.html#name-harmful-consequences-of-tol