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

Peter Gutmann <pgut001@cs.auckland.ac.nz> Wed, 27 March 2019 09:49 UTC

Return-Path: <pgut001@cs.auckland.ac.nz>
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 9D949120292 for <saag@ietfa.amsl.com>; Wed, 27 Mar 2019 02:49:14 -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, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_MED=-2.3, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=auckland.ac.nz
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 OJGsM8YzEAnS for <saag@ietfa.amsl.com>; Wed, 27 Mar 2019 02:49:13 -0700 (PDT)
Received: from mx4-int.auckland.ac.nz (mx4-int.auckland.ac.nz [130.216.125.246]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id D2DFB1202B8 for <saag@ietf.org>; Wed, 27 Mar 2019 02:49:12 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=auckland.ac.nz; i=@auckland.ac.nz; q=dns/txt; s=mail; t=1553680153; x=1585216153; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=4mJDpBNZAN0UhAk6+w675lz5+A3kcAJEINL6u2WDGCs=; b=kdytXrCkEMqWFX6LQUo4NWCaMTYtyjAyCF3RVllpVynrL07CZNg5foiA 7VEFj3lVjPtMdaK5g62tn3AQZ3Mv1FLlRtjdBDoH3gwcz1zBBVfQ0brNg 9bySTibsJZyip3PwAjQl/1e9ZbU60g4nQZY7RGoE6bYhjdkyyNMZU76rc ql0boCsVAVCLE0LNuQh44ayKhAl+HdBFsf5vP5JPn3wnRDSmUrJIcUHXy YG+yVvsTWUP+KkdQMPTrFIOiFHvpM8JpKRycIjrW8ySMhwBMhEnrDkoQW yn0D/nwmppJcMWGPe5Uiqay+zIPH8ki+Cz9KBjA/AMzyKaUhcOHtR0nNh g==;
X-IronPort-AV: E=Sophos;i="5.60,276,1549882800"; d="scan'208";a="53346911"
X-Ironport-HAT: MAIL-SERVERS - $RELAYED
X-Ironport-Source: 10.6.3.5 - Outgoing - Outgoing
Received: from exchangemx.uoa.auckland.ac.nz (HELO uxcn13-tdc-d.UoA.auckland.ac.nz) ([10.6.3.5]) by mx4-int.auckland.ac.nz with ESMTP/TLS/AES256-SHA; 27 Mar 2019 22:49:10 +1300
Received: from uxcn13-ogg-d.UoA.auckland.ac.nz (10.6.2.5) by uxcn13-tdc-d.UoA.auckland.ac.nz (10.6.3.5) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Wed, 27 Mar 2019 22:49:10 +1300
Received: from uxcn13-ogg-d.UoA.auckland.ac.nz ([10.6.2.5]) by uxcn13-ogg-d.UoA.auckland.ac.nz ([10.6.2.5]) with mapi id 15.00.1395.000; Wed, 27 Mar 2019 22:49:10 +1300
From: Peter Gutmann <pgut001@cs.auckland.ac.nz>
To: Nico Williams <nico@cryptonector.com>, Carl Wallace <carl@redhoundsoftware.com>
CC: "saag@ietf.org" <saag@ietf.org>
Thread-Topic: [saag] ASN.1 vs. DER Encoding
Thread-Index: AQHU4/B7Wn4JSCcuPE2ed5Fjno127KYddU0AgAAGK4CAAAI3AIAAJsGAgAGYLW4=
Date: Wed, 27 Mar 2019 09:49:09 +0000
Message-ID: <1553680145271.97708@cs.auckland.ac.nz>
References: <21dec229-5b5c-8d52-6817-edac2e39ceec@openca.org> <20198.1553629138@dooku.sandelman.ca> <20190326200103.GR3822@straasha.imrryr.org> <D8BFFE5D.D8084%carl@redhoundsoftware.com>,<20190326222740.GE4211@localhost>
In-Reply-To: <20190326222740.GE4211@localhost>
Accept-Language: en-NZ, en-GB, en-US
Content-Language: en-NZ
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-ms-exchange-transport-fromentityheader: Hosted
x-originating-ip: [130.216.158.4]
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
Archived-At: <https://mailarchive.ietf.org/arch/msg/saag/Kjax90l9fKzMGfd0NPuCOiHqdS8>
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 09:49:15 -0000

Nico Williams <nico@cryptonector.com> writes:

>Something similar can be said of SSHv2's encoding rules.

The ones that arbitrarily mix binary data and comma-delimited text strings?
Of all the encodings I've had to write parsers for, SSH's one scares me the
most.

It's also the one where I've found the most crashes in the other system while
developing the code and getting various bits slightly wrong, e.g. sending
"foo," or ",," as a value, or getting a binary length field slightly wrong in
combination with text-string data.

Peter.