Re: [saag] ASN.1 vs. DER Encoding

Sean Leonard <dev+ietf@seantek.com> Wed, 27 March 2019 16:14 UTC

Return-Path: <dev+ietf@seantek.com>
X-Original-To: saag@ietfa.amsl.com
Delivered-To: saag@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 2D50612032A for <saag@ietfa.amsl.com>; Wed, 27 Mar 2019 09:14:32 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.598
X-Spam-Level:
X-Spam-Status: No, score=-2.598 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-0.7, 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 7hZX9N_40tIc for <saag@ietfa.amsl.com>; Wed, 27 Mar 2019 09:14:29 -0700 (PDT)
Received: from relay12.mail.gandi.net (relay12.mail.gandi.net [217.70.178.232]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 3307C1203A4 for <saag@ietf.org>; Wed, 27 Mar 2019 09:14:17 -0700 (PDT)
Received: from dhcp-8a20.meeting.ietf.org (dhcp-8a20.meeting.ietf.org [31.133.138.32]) (Authenticated sender: sean@seantek.org) by relay12.mail.gandi.net (Postfix) with ESMTPSA id 0B22720000E; Wed, 27 Mar 2019 16:14:12 +0000 (UTC)
From: Sean Leonard <dev+ietf@seantek.com>
Message-Id: <BC810910-8A30-4758-AE2E-2D2E2F3068D7@seantek.com>
Content-Type: multipart/alternative; boundary="Apple-Mail=_1B24F828-F197-4A05-8DB8-AC6AED8E7B23"
Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.8\))
Date: Wed, 27 Mar 2019 17:14:11 +0100
In-Reply-To: <20190327151545.GG4211@localhost>
Cc: Peter Gutmann <pgut001@cs.auckland.ac.nz>, "Dr. Pala" <madwolf@openca.org>, Nico Williams <nico@cryptonector.com>
To: "saag@ietf.org" <saag@ietf.org>
References: <20190326164951.GX4211@localhost> <20190326214816.GB4211@localhost> <1553679912618.8510@cs.auckland.ac.nz> <20190327151545.GG4211@localhost>
X-Mailer: Apple Mail (2.3445.104.8)
Archived-At: <https://mailarchive.ietf.org/arch/msg/saag/hItn6-uII0i-nlkgLWSDCxQZxNk>
Subject: Re: [saag] ASN.1 vs. DER Encoding
X-BeenThere: saag@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: Security Area Advisory Group <saag.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/saag>, <mailto:saag-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/saag/>
List-Post: <mailto:saag@ietf.org>
List-Help: <mailto:saag-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/saag>, <mailto:saag-request@ietf.org?subject=subscribe>
X-List-Received-Date: Wed, 27 Mar 2019 16:14:32 -0000

> On Mar 27, 2019, at 4:15 PM, Nico Williams <nico@cryptonector.com> wrote:
> 
> I covered that.  I understand that one can built BER/DER/CER dumpers

Back to the original topic of this thread, which is “distinguish between ASN.1 and BER/CER/DER”:

I agree that more care ought to be taken in distinguishing between the abstract syntax (ASN.1) and the encodings. If not sure which of BER/CER/DER to use, you can and should say “X.690 encoding”.

My suggestion is to say DER when that is required, and X.690 when it is not. This is because “BER” in people’s minds reads as “not DER”, which is not true. DER-encoded PDUs are BER-encoded, but not vice-versa.

There is nothing good to say about CER since it did not adequately solve any problems, and only created more. :-)

Usually when people say “this is ASN.1 encoded”, they mean “this is BER encoded; it could be CER or DER too, but this is not a guarantee of the protocol.” They almost never mean XER, PER, OER, or any other such encodings. Hence, s/ASN\.1 encod/X.690 encode/ and you are done.

> that know nothing of the schema, with some lossage of type information
> when using IMPLICIT tagging (none otherwise).

Dealing with tagging issues is supposed to be fixed with AUTOMATIC TAGS but I have yet to see an IETF spec that uses that ASN.1 feature.

> On Mar 26, 2019, at 5:24 PM, Dr. Pala <madwolf@openca.org> wrote:
> in X.509 PKIs, we use DER as the preferred encoding (and PEM for 7-bit transport mode). Therefore when we talk about certificate parsing, for example, we do parse DER/PEM, not ASN.1.
> 
While we are arguing about nomenclature, it is “textual encoding”, not PEM. RFC 7468, thank you. :-)

https://tools.ietf.org/html/rfc7468

Sean