Re: [Suit] self-describing format vs fixed/binary manifest structure

Martin Pagel <Martin.Pagel@microsoft.com> Fri, 14 December 2018 19:31 UTC

Return-Path: <Martin.Pagel@microsoft.com>
X-Original-To: suit@ietfa.amsl.com
Delivered-To: suit@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id AE1261312AE for <suit@ietfa.amsl.com>; Fri, 14 Dec 2018 11:31:33 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -3.46
X-Spam-Level:
X-Spam-Status: No, score=-3.46 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.46, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=microsoft.com
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 KvdcAVjPKfRK for <suit@ietfa.amsl.com>; Fri, 14 Dec 2018 11:31:31 -0800 (PST)
Received: from NAM03-DM3-obe.outbound.protection.outlook.com (mail-eopbgr800134.outbound.protection.outlook.com [40.107.80.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id A9BF91312A8 for <suit@ietf.org>; Fri, 14 Dec 2018 11:31:30 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=dYz/e9uGkgMkicVEZiZuVgqL0Z5GpCe86q0YORug6Vg=; b=eFQ7Lra3er8e1dzON+k8x6vynwMr80vRtEDbE9mDK8iVa1gXRyJ4RQsSbjqx5jRAF1DOJDUFOv/c29uo4OrHWDjYJKSQYjdVTIYB7GYc4Jxv5FovP1ejIgOMT9X9zE6WAsfM7bxLRmUrxqDOSiNwWo47k3v+skTRULrA9ABMwZA=
Received: from DM5PR21MB0698.namprd21.prod.outlook.com (10.175.112.13) by DM5PR21MB0748.namprd21.prod.outlook.com (10.173.172.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1446.6; Fri, 14 Dec 2018 19:31:28 +0000
Received: from DM5PR21MB0698.namprd21.prod.outlook.com ([fe80::3807:fbfd:938f:b1c5]) by DM5PR21MB0698.namprd21.prod.outlook.com ([fe80::3807:fbfd:938f:b1c5%10]) with mapi id 15.20.1446.010; Fri, 14 Dec 2018 19:31:28 +0000
From: Martin Pagel <Martin.Pagel@microsoft.com>
To: Michael Richardson <mcr+ietf@sandelman.ca>, "suit@ietf.org" <suit@ietf.org>, "dev-mcuboot@lists.runtime.co" <dev-mcuboot@lists.runtime.co>
Thread-Topic: [Suit] self-describing format vs fixed/binary manifest structure
Thread-Index: AdSRuIx24y9fgBmKQIigg64Z3c8zMwAo7OaAADVwiOAAIfQ5AAABSKQQAAV4MQAAAm6/YA==
Date: Fri, 14 Dec 2018 19:31:28 +0000
Message-ID: <DM5PR21MB0698339BEFB704398BA8909F9DA10@DM5PR21MB0698.namprd21.prod.outlook.com>
References: <DM5PR21MB069822F40B3F5CC8DBD5F6C69DA70@DM5PR21MB0698.namprd21.prod.outlook.com> <9919.1544647801@localhost> <DM5PR21MB06986BEC8A8DA5AF9137404A9DA00@DM5PR21MB0698.namprd21.prod.outlook.com> <E76EA259-12C7-45CA-A4A2-C322C0B0A591@tzi.org> <DM5PR21MB06983D88A8F9E0499FBB13759DA10@DM5PR21MB0698.namprd21.prod.outlook.com> <10530.1544809544@localhost>
In-Reply-To: <10530.1544809544@localhost>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
msip_labels: MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Enabled=True; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SiteId=72f988bf-86f1-41af-91ab-2d7cd011db47; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Owner=mapagel@microsoft.com; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SetDate=2018-12-14T19:31:26.9183285Z; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Name=General; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Application=Microsoft Azure Information Protection; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Extended_MSFT_Method=Automatic; Sensitivity=General
x-originating-ip: [2001:4898:80e8:8:e9a3:8b86:fb69:1f1e]
x-ms-publictraffictype: Email
x-microsoft-exchange-diagnostics: 1; DM5PR21MB0748; 6:E80Q3xRI3u7aC4SXkm+Bi2IhQAb7cIyoi3VSLv/k01AU8+1bD4HqtwLiqcjUt1H6+jklqVMaowYcsfvDVvpaCe5lHOPvQZfC4Zg28YzvgbMPIO5a1qkxRVd1Ya0C6283GBJtbk9DWT+J4sWCQLkvfqQmhGnyncBcpaT4wCfugJhRGo2zlvD76htPR3yzJophZhNwruDpZ0pHugqTR3i0Y74LVODVQ860qEhZ1RSMth9jVgEohf+uJcUtfpIJlI3Kf9atUcIBDHRKvjCLsE9Thd0s3rvkFOROMyGAX/qvevgWc1dqjZhObOQhWnA2lJUG6k+UERC5FHKgZbxScFENqN8YI7dXnELv0FU8k+ryhqqrQzXtZDnWVruyYC/Ni429mr3LJsceHbKFtKT+b1/YdN7Er15BdGtquLiarXDiPIhoii/YinjUpubGtrpBjDI8dNJz+wdBuVYSD8bI824tQg==; 5:kWH/WKq5CWhCzim0cZOvepPVihicX39q2Jr9x2b+Bm3bZQln/6TzFsNkdX2HCuw8nlGOviuUCgN5om27ZVBwFMorK/K7kqZdzcDSCN3qrw57MDvKpkJ1/LEjCxbxDvJmcwzMtNhDu+E4aSy9BjeSwDjq7lde40Bpu/cxjchLOzc=; 7:0uXsthgJxSKcoxCKlzR48UcbqItm3lrZmvh3AuN38Ub5iRru/mdc6nhk7UdVRHXz5YNdzlMJMHiO5qtyqCjrukdwvza1+RlMDcux8ryNauERXl4unGL01g4jBl8MvFoS6GYu6jfX5ihb1RhRaLK2uw==
x-ms-exchange-antispam-srfa-diagnostics: SOS;
x-ms-office365-filtering-correlation-id: 7171d79a-308e-4e95-457f-08d661fabea5
x-ms-office365-filtering-ht: Tenant
x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(5600074)(711020)(4618075)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7193020); SRVR:DM5PR21MB0748;
x-ms-traffictypediagnostic: DM5PR21MB0748:
x-ms-exchange-purlcount: -3
x-microsoft-antispam-prvs: <DM5PR21MB0748ABC38ED9ED0C2849E1339DA10@DM5PR21MB0748.namprd21.prod.outlook.com>
x-ms-exchange-senderadcheck: 1
x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(3230021)(999002)(5005014)(6040522)(8220035)(2401047)(8121501046)(10201501046)(3002001)(3231475)(944501520)(2018427008)(93006095)(93001095)(6055026)(148016)(149066)(150057)(6041310)(20161123564045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123560045)(201708071742011)(7699051)(76991095); SRVR:DM5PR21MB0748; BCL:0; PCL:0; RULEID:; SRVR:DM5PR21MB0748;
x-forefront-prvs: 08864C38AC
x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(39860400002)(396003)(376002)(346002)(366004)(136003)(13464003)(199004)(189003)(102836004)(33656002)(5660300001)(53546011)(6346003)(55016002)(186003)(14454004)(72206003)(25786009)(8990500004)(14444005)(86612001)(97736004)(256004)(71190400001)(71200400001)(86362001)(6116002)(486006)(476003)(10090500001)(46003)(7736002)(229853002)(10290500003)(6436002)(8676002)(316002)(110136005)(11346002)(81166006)(81156014)(68736007)(105586002)(2906002)(22452003)(93886005)(106356001)(2501003)(446003)(478600001)(8936002)(99286004)(6246003)(7696005)(76176011)(74316002)(305945005)(53936002)(6506007)(9686003); DIR:OUT; SFP:1102; SCL:1; SRVR:DM5PR21MB0748; H:DM5PR21MB0698.namprd21.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1;
received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts)
authentication-results: spf=none (sender IP is ) smtp.mailfrom=Martin.Pagel@microsoft.com;
x-microsoft-antispam-message-info: fCC4mDcDQ/6DDhoQUVJYWHU0Tip+PnQsd/m31Ii99dVv/M9xfkXMhy6eR3rr9e4XLhOUYL37GtuErfAGQMQoYJCYMzOGKB294krJ5jT1BxWvFNaTjzXGTx4My9wEBBdmSZn3zJ2O491GeJ5jpQnncQp831FM4ubCbsDzx9z0/b0esVAPF/2T9OQsQCIqZ7inGN/f2vZYx7BDTc0c5GjHPGL4PTH4ueur8GsJVE/NNU3tEsFxyl5BduLnyHNi1WgzrdGFlHYBTBxdWloXLvIYb9wcdOuK9QuxgMXUyyLry3NIUJJCBbGgdL3oV2BxD6Ga
spamdiagnosticoutput: 1:99
spamdiagnosticmetadata: NSPM
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-OriginatorOrg: microsoft.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 7171d79a-308e-4e95-457f-08d661fabea5
X-MS-Exchange-CrossTenant-originalarrivaltime: 14 Dec 2018 19:31:28.6023 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR21MB0748
Archived-At: <https://mailarchive.ietf.org/arch/msg/suit/-cCx9jziIOpYv-UYdjh6Maxamnw>
Subject: Re: [Suit] self-describing format vs fixed/binary manifest structure
X-BeenThere: suit@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: Software Updates for Internet of Things <suit.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/suit>, <mailto:suit-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/suit/>
List-Post: <mailto:suit@ietf.org>
List-Help: <mailto:suit-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/suit>, <mailto:suit-request@ietf.org?subject=subscribe>
X-List-Received-Date: Fri, 14 Dec 2018 19:31:34 -0000

Thanks, Michael, 
I think the greatest value of the SUIT draft is the Architecture and Information Model documents as they define the rationale for a specific set of manifest fields. How you encode these fields is secondary and I believe it is more important that these fields can get easily loaded by the MCU rather than coming up with a portable/standard format. I only specified 64-bytes as an example, yes, 32-byte are enough for ECDSA. Same applies to thumbprint. Each manufacturer (or whoever develops the boot and installation software) would need to define the details of the manifest structure format it expects including byte alignment, crypto algorithms, keys etc.

I admit that the tables are difficult to decipher in text, you might want to review the PDF version I uploaded, but I will check out the ASCIIO tool. 

I will address your notes on Security Considerations with my next revision.
Martin

-----Original Message-----
From: Suit <suit-bounces@ietf.org> On Behalf Of Michael Richardson
Sent: Friday, December 14, 2018 9:46 AM
To: suit@ietf.org; dev-mcuboot@lists.runtime.co
Subject: Re: [Suit] self-describing format vs fixed/binary manifest structure


Martin Pagel <Martin.Pagel@microsoft.com> wrote:
> both formats are binary formats, the difference is that the CBOR is 
> self-describing, meaning each field has a prefix which describes the 
> data type and field number whereas the fixed structure are just a 
> packed binary structure such as a C struct.

Unfortunately, it's only "such as", because we can not describe it as
a C-struct in a portable/standard way   :-(
Many of us have extensive experience overlaying C-structure definitions on memory, so we can just "suck it in", but it has always resulted in issues.

This is why we like CBOR.  Please realize that the structure has to be processed as a series of byte copies from the buffer into *ANOTHER* structure (and/or processed and validated inline).

But, let's assume that I'm willing to go with a fixed-format structure such
as you have described.    There are some issues that I have:

1) The "Signature" block at 64-bytes is both too small and wasteful at the
   same time... :-)
   32-bytes is enough for ECDSA signatures.
   64-bytes in inadequate (as I understand it), for a hash-based signature.
   I think it's critical for any device that will be in the field past 2025
   to support hash-based signatures.  It may have to support both
   simultaenously for a period of time.

2) The SignCertThumbprint at 20 bytes seems to imply at most a sha1 hash of a
   certificate?

3) I did not understand easily the ManifestSet Header with the multiple Manifests.
   Can you split the ManifestSetHeader, Footer and Manifest sections into
   multiple sections.  Move the descriptions into a point-list after the
   description of the structure.  Don't use "Type" Unit16, but rather more
   convential IETF ascii-art diagrams.
   (You might find the tool "asciio" very useful for this)

4) I don't think that the explanation of how the format complies to the
   requirements belongs in the Security Considerations.  That's not what
   Security Considerations is for.  The protocol should explain itself,
   and then the SC should explain how those features defeat, mitigate, or
   fail to mitigate various attacks.

--
Michael Richardson <mcr+IETF@sandelman.ca>, Sandelman Software Works  -= IPv6 IoT consulting =-