Re: [Suit] draft-ietf-suit-trust-domains: proposal of new command sequence

"Kończyk, Sylwester" <sylwester.konczyk@nordicsemi.no> Wed, 24 January 2024 05:30 UTC

Return-Path: <sylwester.konczyk@nordicsemi.no>
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 66422C14CE36 for <suit@ietfa.amsl.com>; Tue, 23 Jan 2024 21:30:19 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -7.108
X-Spam-Level:
X-Spam-Status: No, score=-7.108 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H2=-0.001, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01, URIBL_BLOCKED=0.001, URIBL_DBL_BLOCKED_OPENDNS=0.001, URIBL_ZEN_BLOCKED_OPENDNS=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=nordicsemi.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 trcg1pcFp-BP for <suit@ietfa.amsl.com>; Tue, 23 Jan 2024 21:30:15 -0800 (PST)
Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-db3eur04on2043.outbound.protection.outlook.com [40.107.6.43]) (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 D4F69C14F6E9 for <suit@ietf.org>; Tue, 23 Jan 2024 21:30:13 -0800 (PST)
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QvZ41eJ5bjiL3jE5FN6fXkNWZ/JG7xYmT2CE77gUuLBmXXcDrf7kBSJpTnKf+Kb4HGBKFUVSMO+TWcLgf6ypzGbGuVi9WGpXuJNI88ZmXqf7u5ju48SbRx53YYoc8sWKJz1hbLclT1tLxFHLv7Zbg8K+RvOVFGP2+gVP2fwJYZ3y+KJmriTtp/UVikoAMxOZEEjDo75dpx5ZWd9R4kN7bQVosQka+y24zAs6YBpUU5wclm0KD/vTXpER+s3EGy4nbEIVwi13CWoFO67ZzpgO9USNyujd7v4EV/vM4kWzNsKBtQtkoiQKWluzcrt5Bv84TG3eRfzsZRUPSWax3E7uAQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=c2dSTl2Pq0sIBZVvihfhTQjbPXRG0vNchKxP7PMPBNg=; b=W+SCudYwpKSNWghcAB7iCQeIT5kQDZrDU+EinG9WZqsXLnKuF/9tEQtka+z4sI7AWNG4d33tjWiJPnaK8dh0R1eejDEdHDgU0oSzLa42/0UUHUl4zztZOtVRD88Ul180xkK/eojV63EM180/cQ7b02pAD0FyTmtGJOiwMdZJIssp1KOvdyJ4+1vKI9kf+IM57UA4EwzEOkzRnwJ9NU/92CjH5wiGW66tGHWZte+e1ZUxCrM0cXNRwgyZWGvA4tdiivdpv8R7Z1M86lFZagIz28/0gMDCwW/AgQy1K/lTtysx0rrWKUT7qHlAvoHBLC/fdF+BlMO3Fv8PTA31uK1v0Q==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nordicsemi.no; dmarc=pass action=none header.from=nordicsemi.no; dkim=pass header.d=nordicsemi.no; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nordicsemi.no; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=c2dSTl2Pq0sIBZVvihfhTQjbPXRG0vNchKxP7PMPBNg=; b=O0VzU8g1CFmaaEXLCqYD92wYTlHxvJvoOkdgV5b2vk42cjaAXB6S2ozQIvrHQUAJ9BdzgHc88ssSTAi2Xa0ts7MC4pcHayT1MPYWgI8p+VPbKQ8bah8h6N9kmZHR9teSmTAOJN9tz1LmMEQHiKVTJ7pTXrV/ymQktCYNrQdFDmQ1ez3ZO4nYT/7RaNH5ke699RDKlVDIR6+k6KlcoT7plGaFITqBNeIwkppjZ6GdkztOW2TmoVwMBiWnCY7KDkM5oE+N+yoUStKS8TQY8qgYQOMMKL+9Oo+p2xIGQzKIPMNJ8L9kvyDavZIWWcxGYMpd6S9bxu1RqMhx0X5Z6jY2mA==
Received: from DU0PR05MB10075.eurprd05.prod.outlook.com (2603:10a6:10:441::7) by AM9PR05MB8481.eurprd05.prod.outlook.com (2603:10a6:20b:38b::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7228.22; Wed, 24 Jan 2024 05:30:10 +0000
Received: from DU0PR05MB10075.eurprd05.prod.outlook.com ([fe80::e00f:3318:281d:e6ba]) by DU0PR05MB10075.eurprd05.prod.outlook.com ([fe80::e00f:3318:281d:e6ba%5]) with mapi id 15.20.7202.035; Wed, 24 Jan 2024 05:30:10 +0000
From: "Kończyk, Sylwester" <sylwester.konczyk@nordicsemi.no>
To: Brendan Moran <brendan.moran.ietf@gmail.com>
CC: Brendan Moran <Brendan.Moran@arm.com>, "suit@ietf.org" <suit@ietf.org>
Thread-Topic: [Suit] draft-ietf-suit-trust-domains: proposal of new command sequence
Thread-Index: AdozF/DOyCDWPu2LSwmnIhxAAOCOKwAPuwVUABy6uMAACQFuqgA0009gBCLatQUA8RNREAAOKfYAAS3HOIAAIJUa0A==
Date: Wed, 24 Jan 2024 05:30:10 +0000
Message-ID: <DU0PR05MB10075BE6C4C0CACD12DA20079F17B2@DU0PR05MB10075.eurprd05.prod.outlook.com>
References: <DU0PR05MB1007598D80C708EF5E31D6C1FF196A@DU0PR05MB10075.eurprd05.prod.outlook.com> <DBAPR08MB5576FEBEC9ADFCEFFA5C9F51EA96A@DBAPR08MB5576.eurprd08.prod.outlook.com> <DU0PR05MB10075EA07524D2FDEF829D988F195A@DU0PR05MB10075.eurprd05.prod.outlook.com> <DBAPR08MB557690042715F2B1DC523EBCEA95A@DBAPR08MB5576.eurprd08.prod.outlook.com> <DU0PR05MB100754DCE8CCCE2E161D9AD8FF194A@DU0PR05MB10075.eurprd05.prod.outlook.com> <DBAPR08MB5576463CBE50C94061E5723AEA6F2@DBAPR08MB5576.eurprd08.prod.outlook.com> <DU0PR05MB10075E115F960173C2A2EBB49F1722@DU0PR05MB10075.eurprd05.prod.outlook.com> <CAPmVn1Ne_-skgZgHOgY2Ltc0mqzn6sKFPpu0XDtvjwALYN1eHw@mail.gmail.com> <CAPmVn1OB5jrUmfN+iP086QWTRM-NeOdVhubnxmkRw4mMOP_9KA@mail.gmail.com>
In-Reply-To: <CAPmVn1OB5jrUmfN+iP086QWTRM-NeOdVhubnxmkRw4mMOP_9KA@mail.gmail.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nordicsemi.no;
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: DU0PR05MB10075:EE_|AM9PR05MB8481:EE_
x-ms-office365-filtering-correlation-id: 0725435c-acff-4097-1f59-08dc1c9d884f
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam: BCL:0;
x-microsoft-antispam-message-info: uQAevl96Nb8D2nyA7t6Gq9lgK+Jajwscvuu9eBxzrH/2Irh+Hvy4jU8xD1emxohEd39CIhsl/i/uclfT2BklWEs0QHKT1aneq2QNJ27vudOY2qHpkjvn4pagkYYaQ98TMmOHlKYQOiyqQzkJHpBbxpWkzeTRIKtEkw5sbcyAQ/Y8qjOFrPKyyCaU+jgGiipDQlRi51CwGZ5oxq0QwrUEkMHM5AVSRKalcT3fvx5f5wS9EFOdFffFpzIHU7X0KKaY1C2jbyL/89UJCFXVWnccxp9O2WsTP9lGNQWAvpt4gug44foyszWieXVpHOxQ26lkVEbcWi8ip1oglQvawrRY7ZneUER++8eZmk8fjB0ew/TKWq3tLhHsrY6FSjt8woktXBsfZTvdSzSrLOqGF+RAQ041qUgrVWn6u2cX15hPBtVRPcmmDynbHvvyQuCiFxNa5VYpnEjEA0GuPmD2Ed81SGQt0DP6Yy1O7bRgYl91L/yDUBVmpWlxKGl/XzIYW+8AQcvnvKKQiaH/0edMNiY9uDlvG9hVDdT+1BFuhoobddb3VmTqMFxgAgUZmoBtGzxCd/kqIbuh/gs5wsZHocOmL1Zx2LWBlfWtDBRhWvqmEJcuZt/qdqtI9jh2rP8FTEmq92Wq1yrJLxW7veNgHtoJK6lLis2wQbndz2zeucSf00YbQC8mDKMKnA2owZPmN4WpN3dgq8b4JqhRP630LuiLQGpCS4JsLpZ1fkm19KMDQcE=
x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DU0PR05MB10075.eurprd05.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(396003)(346002)(366004)(136003)(376002)(39860400002)(230922051799003)(451199024)(1800799012)(1590799021)(186009)(64100799003)(30864003)(2906002)(5660300002)(86362001)(85202003)(85182001)(38100700002)(33656002)(45080400002)(38070700009)(478600001)(83380400001)(53546011)(7696005)(6506007)(9686003)(26005)(66574015)(122000001)(71200400001)(66946007)(66446008)(66556008)(66476007)(3613699003)(316002)(6916009)(54906003)(4326008)(52536014)(64756008)(8936002)(8676002)(41300700001)(76116006)(55016003)(1580799018)(87944015); DIR:OUT; SFP:1101;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0: vZaPnS1rH9qZln+/nRx5/8w8Wh2fzmD0U1IuXdmUSjCfGMI8XZTc2Pbw6ZhBhDl+FwwJ3grzpnOSLJEAvn5gbYyX0BPhoWAemzvGXo4gfYippU6fEJ3sGZWyTkdlssDWAVxXGaHhvlSPIWFVV9n9QSeqfq8vMgFNodLdsHv/3mjUC6jWZ04zGJ9T+VJrd+YE5cGS2I08N7PMoLl3aW51DeNFZqsHldZqmgb8CHJhxxQfWQN3QCk4NszHmYvxQuym4z75iJCnl0Nze7Wk5k8iYpnLA99w1Z1BtMMpE4ciPAQsFf/8d2+U5cHQBwS3IIn65/vUhXGKzMKP6PO8W5bt+P2YhQ7/Aa02KwrSn+8C1xAUiikACdJ4nvVWDncU/YAzBTmBR3ERgIQBwJI9v9bnkk5Lr49W3NXgB7a7Ur95++pRzotLUXk6POmI8+08nCV72u5DVObbbuZzDuZbiA1LbRblGVJOIpTWSrsocWaY1/1B5u8IZEnGK34wjMLKymx+VHS/BFXGjY4bV3OkRzRqSwiL9S6YOSkpn6eLlvY94e0hb96UC7Wep2+eSaZLPZ77Pk/1lvAZlkZLdtyDtm+D1FLWcZUHDVSViiJWjCjE3wWOeSFNz0d+TQmETS8kr9Iy4ImVc/lmsZru9hOAZr5bBmTWr23/jG13kjA3exp1K1jkry7P40kXbQ8NJeBB2vtkawmzbOc6rdGyrQfuCBgNOzB64EDof5mhNUjUBXT6kVPLBulQmYCKtK7Bb9uRv23lsQtzkusHQ1iq1SNV/WWI8SxieS4ymfgohNtgIzAkpV5+nZ44JaphZ1wuAcLXQpDLr2e4yGg1FvCGm1JVhlulSiFBf0Nk3zmTXg0KM5GxxNP1M74h7GzsqXweUeGFdMsoLLVxNXvR32UCjbDuZYhVwAn4Titfh7WLe0CWNnJon2IIorEZ019X9jErBDE0/e8M8jwuUDaCj5spoJHGAEPMsZz48aA2s2GkDS53D+cIdKj13gQsJTKSz2J9dPB0Vbt1nXSjwR/EQq0TgBPP6G1jBTW2i2ebk5tmPJer/vZWJnGlWEml+kIdW9RD9AJHg+6KY4vmgfNSn4Awgn2fe+ZKiDrK55YTg00jWvqA/KvTd6bHnmJCQDs/UiywlrqoiqmOb3SFoy9p2Nz35Bi3fgWgKkP8zRruafShEMVzd7WeuvUHSvlkqnWKRP91eYGB1UShEgXGc9oOawSWWxnRLOj1O8BoK90OLYoKs8GV1y9XpZw8LFojFxZy9lO5524Mawl7lPGmGHNa2vvlNs8afzK2S8qGzX6kvXK7C4MB3GO1VXoqtDtbjul+bKDTVChvZbprCJzD7ynUcfBRIAwvRNfFa/C5peQvuPuluUACSQxuG5SpAjAwtNiaWq33qwYZtQbl6fchSQGNFLhmjXspWK2uV0IwTZNUi+hZKflMxcB+Yryifs0XdwDGJLyEOus6GU713kqxw2B4QRO2dERiK02l17P8NOA0ViKZstUV3CD/4OKVdaxUPD+BJdgCOAprw1iiXEq2dRGnu12bRoBv4nCFbdIOXo/DLUS377tlwoyWibgILvGDgZPr1LaOLSvqxzyfG6WLGQYInAAlCPzZ55Bt5w==
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
MIME-Version: 1.0
X-OriginatorOrg: nordicsemi.no
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: DU0PR05MB10075.eurprd05.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 0725435c-acff-4097-1f59-08dc1c9d884f
X-MS-Exchange-CrossTenant-originalarrivaltime: 24 Jan 2024 05:30:10.1627 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 28e5afa2-bf6f-419a-8cf6-b31c6e9e5e8d
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: ZHaDmaQAJHdN3QiFcBwwUJF2PVhN8FBQb3lJp9ZDWpfKa1MOYy+xe86Q+sMzpmUrpJpVUx+6gZHUFqqJNYyeOzrI1jBh2QouV05VyO0Vi4k=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR05MB8481
Archived-At: <https://mailarchive.ietf.org/arch/msg/suit/WFi-q39rqnEaPq8wIt2g8wQ5SvI>
Subject: Re: [Suit] draft-ietf-suit-trust-domains: proposal of new command sequence
X-BeenThere: suit@ietf.org
X-Mailman-Version: 2.1.39
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: Wed, 24 Jan 2024 05:30:19 -0000

Hi Brendan,

I am glad to hear that. I fully agree with your analysis, especially about the need of new Candidate-verification command sequence.

Referring to three options related to introduction of this new command sequence, and especially to associated CDDL snippets - any of those would work. As I understand, now we have to reach an agreement within WG about choosing one of those. Let me add few comments to each option:

Option 1: “If Candidate Verification is present in the manifest, then installation MUST be executed after Candidate Verification” – Right. Perhaps that could be more clear if we would change the order of appearance:

SUIT_Severable_Members_Choice = (
  ? suit-dependency-resolution => bstr .cbor SUIT_Command_Sequence,
  ? suit-payload-fetch => SUIT_Digest / bstr .cbor SUIT_Command_Sequence,
  ? suit-candidate-verification => SUIT_Digest / bstr .cbor SUIT_Command_Sequence,
  ? suit-install => SUIT_Digest / bstr .cbor SUIT_Command_Sequence,
  ? suit-text => SUIT_Digest / bstr .cbor SUIT_Text_Map,
)
… and keep already allocated key values:

suit-dependency-resolution = 15
suit-payload-fetch = 16
suit-candidate-verification = /* any available value */
suit-install = 17

In above case respective sequences are to be executed in order; they are just represented by out-of-order keys.

Also, your idea about changing the suit-install key to 20 would work. As I understand - suit-candidate-verification would be 18 or 19 in that case?

Option 2: It is the least I like. Indeed, suit-install and suit-candidate-installation would be confusing.

Option 3: Seems to be the cleanest from logical point of view (split the Update Procedure into Staging and Installation), but practically, in my personal opinion, it does not bring anything more than option 1.


Best Regards,

Sylwester

-----Original Message-----
From: Brendan Moran <brendan.moran.ietf@gmail.com>
Sent: Tuesday, January 23, 2024 2:32 PM
To: Kończyk, Sylwester <sylwester.konczyk@nordicsemi.no>
Cc: Brendan Moran <Brendan.Moran@arm.com>; suit@ietf.org
Subject: Re: [Suit] draft-ietf-suit-trust-domains: proposal of new command sequence

After thinking about this more, I believe that you are right, Sylwester; we cannot merge installation with either staging or invocation in all scenarios. As a result, I believe we need to consider how to insert a candidate verification command sequence into the manifest. While this appears to me to be a core consideration, I do not think it needs to be in the manifest specification itself.

This example shows my justification for adding a new procedure and one or more command sequences. Suppose that you have a device that has the following partitions:

A: Application/Downloader
B: Staging
C: Installer
D: Bootloader
E: Recovery

Suppose that B is substantially smaller than the A image.
=> This is why there is a separate installer

Suppose that C uses a decompression algorithm to reinflate B to A => This is required so that a small B remains adequate for A => This means that C likely needs to be updatable

Suppose that failed installations are handled by E image fetching a new B and attempting install again.

Then,
A performs dependency resolution and image fetch C performs image installation D performs secure boot

Because of the separation of responsibilities, it would be difficult to implement this use case without a clear division between Staging and Installation.

Where we stand today:

Update Procedure
* Dependency-resolution
* Payload-fetch
* Install

What we need:
Staging Procedure
* Dependency-resolution
* Payload-fetch

Installation Procedure
* Candidate-verification
* Candidate-installation

Bear in mind that these procedures do not exist in the metadata; they are logical procedures. The manifest processor must decide which command sequences to invoke and when.



How do we instantiate the new procedure and sequence?
============

I can see three ways to resolve this. The CDDL below is shown in aggregate form, combining the detail present in trust-domains and in the manifest spec.

1. If Candidate Verification is present in the manifest, then installation MUST be executed after Candidate Verification

SUIT_Severable_Members_Choice = (
  ? suit-dependency-resolution => bstr .cbor SUIT_Command_Sequence,
  ? suit-payload-fetch => SUIT_Digest / bstr .cbor SUIT_Command_Sequence,
  ? suit-install => SUIT_Digest / bstr .cbor SUIT_Command_Sequence,
  ? suit-candidate-verification => SUIT_Digest / bstr .cbor SUIT_Command_Sequence,
  ? suit-text => SUIT_Digest / bstr .cbor SUIT_Text_Map,
)

Note: the ordering here is the ordering that will occur if we do not alter the suit-install key.

The Staging Procedure is composed of (1. suit-dependency-resolution, 2. suit-payload-fetch) The Install Procedure is composed of (1. suit-candidate-verification, 2. suit-install)

Note that the Install Procedure requires out-of-order processing of elements in the manifest. This could be corrected by changing the suit-install key in the manifest-spec.

This approach is my preference, particularly if we change the suit-install key from 17 to 20. Draft-ietf-suit-manifest is in IETF last call. I believe that, if the working group agrees, this change is small enough to be accepted.

2. A new Candidate Installation command sequence is introduced.
Suit-install may be used as normal. The manifest processor (or relevant ACLs) will determine whether each component can be written from application-level suit-install or the installer-level candidate-installation.

SUIT_Severable_Members_Choice = (
  ? suit-dependency-resolution => bstr .cbor SUIT_Command_Sequence,
  ? suit-payload-fetch => SUIT_Digest / bstr .cbor SUIT_Command_Sequence,
  ? suit-install => SUIT_Digest / bstr .cbor SUIT_Command_Sequence,
  ? suit-candidate-verification => SUIT_Digest / bstr .cbor SUIT_Command_Sequence,
  ? suit-candidate-installation => SUIT_Digest / bstr .cbor SUIT_Command_Sequence,
  ? suit-text => SUIT_Digest / bstr .cbor SUIT_Text_Map,
)

The Staging Procedure is composed of (1. suit-dependency-resolution, 2. suit-payload-fetch, 3. suit-install) The Install Procedure is composed of (1. suit-candidate-verification, 2. suit-candidate-installation)

The overlap between suit-install and suit-candidate-installation may be somewhat confusing. No changes are required to the manifest specification. The Manifest Processor can process all command sequences in-order.

3. Modify the Manifest Specification now to split the Update Procedure into Staging and Installation, add the new candidate verification command sequence, and adjust the corresponding CBOR keys to match.

SUIT_Severable_Members_Choice = (
  ? suit-dependency-resolution => bstr .cbor SUIT_Command_Sequence,
  ? suit-payload-fetch => SUIT_Digest / bstr .cbor SUIT_Command_Sequence,
  ? suit-candidate-verification => SUIT_Digest / bstr .cbor SUIT_Command_Sequence,
  ? suit-candidate-installation => SUIT_Digest / bstr .cbor SUIT_Command_Sequence,
  ? suit-text => SUIT_Digest / bstr .cbor SUIT_Text_Map,
)

The Staging Procedure is composed of (1. suit-dependency-resolution, 2. suit-payload-fetch) The Install Procedure is composed of (1. suit-candidate-verification, 2. suit-candidate-installation)

Summary:

1. creates a tooling question: if the device supports candidate verification, is it mandatory? And, if a manifest processor that supports Candidate-verification receives a manifest that does not contain it, is that a fault? Can we change the suit-install key; incrementing it by 1-3 before we finalise the manifest spec?

2. simplifies the specification update: the Update Procedure remains exactly as it is. The suit-install sequence can be used or not. It makes no difference to the security model: suit-install and suit-payload-fetch have access to all the same commands and component IDs.

3. is not a massive change, but it is quite structural and quite late.
That said, the mechanics of it are minimal. An implementor may not even notice.

Best Regards,
Brendan

On Wed, Jan 17, 2024 at 1:31 PM Brendan Moran <brendan.moran.ietf@gmail.com> wrote:
>
> Hi Sylwester,
>
> I think I haven't been completely clear on this. Please see my comments inline.
>
> Best Regards,
> Brendan
>
> On Wed, Jan 17, 2024 at 7:23 AM Kończyk, Sylwester
> <sylwester.konczyk=40nordicsemi.no@dmarc.ietf.org> wrote:
> > To make sure I understand your examples - When you are mentioning "System Validation sequence" - are you referring to SUIT_Command_Sequence suit-validate? In case of "load sequence" mentioned in your last post - does it refer to SUIT_Command_Sequence suit-install?  As I understand, the trick would be to execute suit-validate twice, first time - prior to suit-install, second time, in invocation procedure, prior to suit-load.
>
> [BM] For lazy installation, I am referring exclusively to the elements
> of the Invocation Procedure.
> By "System Validation sequence," I meant suit-validate.
> By "load sequence," I meant suit-load.
>
> Suppose there is a device that has a staging area (Component ID
> ["Staging"]) and an active firmware (Component ID ["Active"]). A
> manifest (JSON-style) that would satisfy your needs is as follows:
>
> {
>     "suit-authentication-wrapper" : "omitted",
>     "suit-manifest" : {
>         "suit-common": {
>             "suit-components" : [
>                 ["Staging"],
>                 ["Active"]
>             ],
>             "suit-shared-sequence" : [
>                 "suit-directive-set-component-index", 0,
>                 "suit-directive-override-parameters", {
>                     "suit-parameter-image-digest" : "<Staging image digest>"
>                 },
>                 "suit-directive-set-component-index", 1,
>                 "suit-directive-override-parameters", {
>                     "suit-parameter-image-digest" : "<Installed image digest>"
>                 }
>             ]
>         },
>         "suit-payload-fetch" : [
>             "suit-directive-set-component-index", 0,
>             "suit-directive-override-parameters", {
>                 "suit-parameter-uri" : "https://suit.example/lazy-install.bin"
>             },
>             "suit-directive-fetch", 2,
>             "suit-condition-image-match", 2
>         ],
>         "suit-validate" : [
>             "suit-directive-set-component-index", 1,
>             "suit-directive-try-each", [
>                 [
>                     "suit-directive-set-component-index", 1,
>                     "suit-condition-image-match", 2
>                 ],
>                 [
>                     "suit-directive-set-component-index", 0,
>                     "suit-condition-image-match", 2
>                 ]
>             ]
>         ],
>         "suit-load": [
>             "suit-directive-set-component-index", 1,
>             "suit-directive-try-each", [
>                 [
>                     "suit-condition-image-match", 2
>                 ],
>                 [
>                     "suit-directive-override-parameters", {
>                         "suit-parameter-source-component" : 0
>                     },
>                     "suit-directive-copy", 2,
>                     "suit-condition-image-match", 2
>                 ]
>             ]
>         ],
>         "suit-invoke":[
>             "suit-directive-set-component-index", 1,
>             "suit-directive-invoke", 2
>         ]
>     }
> }
>
> As you can see, each time the device boots, the bootloader uses
> suit-validate to check whether EITHER the active image is correct OR
> the staged image is correct. If EITHER condition is true, then it
> proceeds to suit-load. During suit-load, the manifest directs the
> bootloader to determine whether the active image is correct. If it is
> not, the bootloader (having already verified that the staged image is
> correct) copies the staged image into the active image component. Once
> the copy is finished, the bootloader verifies that the active image is
> correct. Then, it proceeds to suit-invoke. suit-invoke simply invokes
> the active image, having already verified that it is correct.
>
> >
> >
> >
> > Logical steps, applying “lazy installation” on examples from my post would look like:
> >
> > 1.            Staging procedure carried out by the APP.
> >
> >                 - suit-dependency-resolution
> >
> >                 - suit-payload-fetch
> >
>
> [BM]: Step 2 not needed.
>
> > 3.            Invocation procedure carried out by the BL.
> >
> >                 - suit-validate
> >
> >                 - suit-load
> >
> >                 - suit-invoke
>
> ... SNIP ...
>
> >
> > Getting to conclusion - both solutions ("lazy installation" and introduction of suit-pre-install-validate) would work. The only question is what is simpler, or rather what kind of simplicity should be sacrificed:
> >
> > Having two dedicated validation sequences - in that case existing specification shall be extended.
>
> [BM]: The specification would be slightly more complex. I don't know
> if it is enough additional complexity to be an issue. The bigger
> problem is that suit-install could exist in one of two procedures.
> This leads to some implementation challenges that I find quite
> concerning. Changing this requires a change to the Manifest
> Specification. It seems that it would be safer to add two sequences:
> one pre-install-validation sequence and a separate,
> post-validation-install sequence, then group both of these in a
> separate procedure--would these new sequences be severable? I would
> assume so since they are not needed once installation has completed;
> that said, they should be minimal in size, which makes the value of
> severing them questionable.
>
> > Adding extra logic to suit-validate and execute it twice - it will require a more complex content of suit-install.
>
> [BM]: As I described above, suit-install is not executed twice.
> suit-load is used instead.
>
> >
> >
> > Obviously, I would prefer to have dedicated suit-pre-install-validate at disposal. I see following benefits of such approach:
> >
> > Having clear separation of two concerns - validation prior to installation and validation prior to invocation. I would be glad to have similar clarity as it is already achieved for invocation procedure and three available command sequences.
> > Simplified logic in appropriate sequences, causing that definition (creation) of manifest would be less error prone.
> > suit-pre-install-validate could be severed after installation, therefore space reserved for installed manifest could be smaller.
>
> [BM]: As described above, suit-load is for loading images into their
> executable locations, post validation. While suit-load can be used for
> loading into volatile RAM, it can also be used for loading into NVRAM.
> This seems to be your use case.
>
> My big question is whether you see sufficient semantic difference,
> between this type of loading operation and a discrete installation
> step, that we would require a whole new procedure. I'm definitely open
> to that, I just want to be sure we have covered the alternatives
> first.