Re: [Anima] which base64 for RFC8366... original!

Carsten Bormann <cabo@tzi.org> Tue, 22 October 2019 15:39 UTC

Return-Path: <cabo@tzi.org>
X-Original-To: anima@ietfa.amsl.com
Delivered-To: anima@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id DE435120043 for <anima@ietfa.amsl.com>; Tue, 22 Oct 2019 08:39:34 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -4.199
X-Spam-Level:
X-Spam-Status: No, score=-4.199 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
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 ocJm6rAsEbBZ for <anima@ietfa.amsl.com>; Tue, 22 Oct 2019 08:39:32 -0700 (PDT)
Received: from gabriel-vm-2.zfn.uni-bremen.de (gabriel-vm-2.zfn.uni-bremen.de [134.102.50.17]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id A031A120073 for <anima@ietf.org>; Tue, 22 Oct 2019 08:39:32 -0700 (PDT)
Received: from [192.168.217.110] (p5089AE1C.dip0.t-ipconnect.de [80.137.174.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by gabriel-vm-2.zfn.uni-bremen.de (Postfix) with ESMTPSA id 46yHkC0yYRzyYt; Tue, 22 Oct 2019 17:39:31 +0200 (CEST)
Content-Type: text/plain; charset="utf-8"
Mime-Version: 1.0 (Mac OS X Mail 11.5 \(3445.9.1\))
From: Carsten Bormann <cabo@tzi.org>
In-Reply-To: <15459.1571755692@localhost>
Date: Tue, 22 Oct 2019 17:39:33 +0200
Cc: anima@ietf.org
X-Mao-Original-Outgoing-Id: 593451571.933713-c7fe12519f326f54c7c2f7484c07c58c
Content-Transfer-Encoding: quoted-printable
Message-Id: <4C61CD6A-EDFB-4521-8811-858085E84BC4@tzi.org>
References: <15459.1571755692@localhost>
To: Michael Richardson <mcr+ietf@sandelman.ca>
X-Mailer: Apple Mail (2.3445.9.1)
Archived-At: <https://mailarchive.ietf.org/arch/msg/anima/WjNFDr2fk-PXwCASkRLaaU6GyHc>
Subject: Re: [Anima] which base64 for RFC8366... original!
X-BeenThere: anima@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: Autonomic Networking Integrated Model and Approach <anima.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/anima>, <mailto:anima-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/anima/>
List-Post: <mailto:anima@ietf.org>
List-Help: <mailto:anima-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/anima>, <mailto:anima-request@ietf.org?subject=subscribe>
X-List-Received-Date: Tue, 22 Oct 2019 15:39:35 -0000

> On Oct 22, 2019, at 16:48, Michael Richardson <mcr+ietf@sandelman.ca> wrote:
> 
> Signed PGP part
> 
> In answering DISCUSSes on BRSKI, I came up the question of do the
> YANG-serialization-to-JSON rules specify which base64 (original
> or urlsafe) encoding is to be used for “binary" types?

Legacy (RFC 4648 Section 4 = non-URL-safe, with padding).
Look at the examples, which give it away by always ending in == :-)

> RFC8366 only references RFC7950, which only peripherally mentions JSON, but it does say:
> 
> 9.8.2.  Lexical Representation
> 
>   Binary values are encoded with the base64 encoding scheme (see
>   Section 4 in [RFC4648]).

There it is.

The YANG-to-JSON rules are in RFC 7951.

6.6.  The "binary" Type

   A "binary" value is represented as a JSON string -- base64 encoding
   of arbitrary binary data.

   The representation is identical to the lexical representation of the
   “binary" type in XML; see Section 9.8 in [RFC7950].

So this is legacy, too.

> 9.8.3.  Canonical Form
> 
>   The canonical form of a binary value follows the rules of "Base 64
>   Encoding" in [RFC4648].
> 
> but maybe this only applies to XML-serialization.... searching further:
> 
> So, why doesn't RFC8366 reference:
>    https://datatracker.ietf.org/doc/rfc7951/

No idea.

But then, RFC 8366 says

   The voucher artifact is a JSON [RFC8259] document that conforms with
   a data model described by YANG [RFC7950], is encoded using the rules
   defined in [RFC8259], and is signed using (by default) a CMS
   structure [RFC5652].

which is pretty much devoid of meaning.

> I wonder if this is worth an errata clarifying this for RFC8366?

Yes, but maybe the WG should decide first what was intended…

Grüße, Carsten