Re: [Suit] Parameters and Commands

Koen Zandberg <koen.zandberg@inria.fr> Fri, 28 February 2020 14:46 UTC

Return-Path: <koen.zandberg@inria.fr>
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 206023A18FE for <suit@ietfa.amsl.com>; Fri, 28 Feb 2020 06:46:43 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.896
X-Spam-Level:
X-Spam-Status: No, score=-1.896 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, HTML_MESSAGE=0.001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, 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 pHQ0__EyM7CZ for <suit@ietfa.amsl.com>; Fri, 28 Feb 2020 06:46:41 -0800 (PST)
Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) (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 3F4CC3A0B0F for <suit@ietf.org>; Fri, 28 Feb 2020 06:46:40 -0800 (PST)
X-IronPort-AV: E=Sophos;i="5.70,496,1574118000"; d="asc'?scan'208,217";a="340735750"
Received: from 82-197-204-96.dsl.cambrium.nl (HELO [10.1.5.26]) ([82.197.204.96]) by mail3-relais-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES128-SHA; 28 Feb 2020 15:46:37 +0100
To: suit@ietf.org
References: <27913A6B-F42C-4AA9-8A7A-64B1D546C13C@arm.com>
From: Koen Zandberg <koen.zandberg@inria.fr>
Autocrypt: addr=koen.zandberg@inria.fr; ke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5stkr1EmVc2r9Jdv/l06lHOJr6/WPumq9hQyxHpX1lhrAsl sUz2QkEspiJc5+i7Mte7bUWdYJkIVd/9HTplVoZyJUHPCQGORSySMvyRihPbo7HcHsv8o7if ghRaX9Sf88tiU7TIvG1AaEZ6AWj45EnqCdesS9eDGtgcFNBC3gAdF9o0uppXNKAsCfUxYr28 O7c3+9WSa5WiN8cFAURGMlhhdBaz0SNEW7RG9WjSqSuvMQ5mqP1HQtAEE05TRnaj7UAJEGlW jyv4EUonmDkP/2nwxCnfklFn7kaNVsQZELkly+HnmBNbov2GW4rLmrdjKTnQcJ7mJTeS3yiD KjVflgntDJFBH6zbUNREbmCPCuF+xcHUGPkrS1686nHf+GmzrJw3xbJD2u0KuHe3cxxFFc+v wtZfSA3LCqZceuGNRAd3gEUcl/STxo9LfnpF3kESGkHoRpmZ19KptZGXlu9aXcAwH9JVYqwM F4o6o39aGs0UfLJqOr/MxpoYldO6IV9WFZLQruMfQRw9wyonkcxxkSoLBVJ8w+CMUvGjirio ONuiIRFSlr84FereqO3+LHmLr+ey5q3oQbkXb2cWdM6UsatcYFHC9WZ1XgULft7diBhnpl0B F7lOKWuibVN8JCbCBjDGo64Zsco9zlJAyYWwZo0WIs18kFH79Ekt8g9+tcrBVRaUhYbegBy2 LijwErmuz1yLQBrMOKEGedkiIgXrQerYSVkD2Gvg4AxUssAMT+BxP5aazDdBlChcpPA5XgXT IHvlRTfWLXtZzizPL3dB7mq+2/SOWTB4A4xoRzaJ9+NJqJ0STBQ4L8YM99GLQUMoN1xyhPTb xlmxUPPMTqpXcEHPkG5aHsRgDqL3xV4puZ/03Q74/x/IUE+kz4ZhHxH9D4eo9kHtEzbfMn8i W/O5Y7GnTFKtBs1qX/1ikJKtAQutx+PT6dpcFhdSyOfsrbOW
Message-ID: <cd1d3e93-b094-e274-c07c-c400b9475b16@inria.fr>
Date: Fri, 28 Feb 2020 15:46:27 +0100
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0
MIME-Version: 1.0
In-Reply-To: <27913A6B-F42C-4AA9-8A7A-64B1D546C13C@arm.com>
Content-Type: multipart/signed; micalg="pgp-sha256"; protocol="application/pgp-signature"; boundary="3CwqVVIz2SwSLwWUOhjwnNogRg2t5nTjH"
Archived-At: <https://mailarchive.ietf.org/arch/msg/suit/NDORoaUXSPh6FzE_-98eT4EVtzs>
Subject: Re: [Suit] Parameters and Commands
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, 28 Feb 2020 14:50:22 -0000

Hi Brendan,

I also support the idea ofaligningall conditionals to use parameters.
From an implementation point of view I see a small downside in that the
parameter location has to be stored to be retrieved later during the
parsing of the conditional (this matches with your argument no. 2). For
the low number of parameters used this increase is probably negligible
and I don't expect any serious concerns here. 

Concerning encoding the attestation policy within the unused arguments,
I have slightly more doubts. I assume that this would replace all nil
arguments in the commands with the attestation policy (a single cbor
uint?). If this is the case I don't have any strong concerns, but it
looks a bit like swapping one inconsistency for another, mixing
arguments and policy specifications.

I will implement the changes you've proposed here in our current ietf-v3
implementation (https://github.com/RIOT-OS/RIOT/pull/13486
<https://github.com/RIOT-OS/RIOT/pull/13486)>)
<https://github.com/RIOT-OS/RIOT/pull/13486)>to get some hard numbers on
the impact of this change, and get back to you on the list.

Cheers

On 27/02/2020 14.44, Brendan Moran wrote:
> During the hackathon, I discovered that my examples and my manifest
> generator tool are generating incorrect sequences for testing vendor
> ID and class ID.
>
> There are currently two ways to handle commands (conditions or
> directives):
>
>  1. The command consumes an argument (that is the value that follows
>     the command's key)
>  2. The command consumes a parameter (that is a value set by the
>     “set-parameters” or “override-parameters” commands)
>
>
> This duality led to my error in setting up the Vendor and Class ID
> tests in the demo code.
>
> The reasons for each mode are:
>
>  1. Command consumes an argument
>      1. Encoding is more compact (encoding via parameters takes 2-3
>         more bytes, depending on the situation).
>      2. Less storage needed (the argument is consumed immediately)
>      3. Does not require matching parameter key
>      4. More explicit association between command and argument
>  2. Command consumes a parameter
>      1. More compact when the parameter is used more than once (e.g.
>         image digest)
>      2. Allows override by dependencies, when set-parameters is used
>
>
>
> We’ve talked before about “only one way to do things” and I think I
> can see a path to making that the case here. Here is my proposal:
>
> Commands consuming a parameter are absolutely necessary due to
> override and deduplication concerns. Conditions testing against an
> argument are convenient and more explicit. Therefore, harmonising
> around a single option probably means that we have to select
> parameters instead of arguments:
>
>  1. Eliminate arguments from most commands (see below)
>  2. Match most parameter keys with command keys to simplify the
>     association, make “arguments” more explicit
>
>
> Only these commands require arguments, since they either deal with
> setting parameters, setting parameter scope, or with flow control,
> which requires nested command sequences.
>
>   * Set Component Index
>   * Set Dependency Index
>   * Set Parameters
>   * Override Parameters
>   * Try-each
>   * Run Sequence
>   * For Each Component
>
>
> This leaves the majority of commands with NUL arguments. This is
> actually quite useful for another feature.
>
> We have also discussed the possibility of defining attestation policy
> within SUIT. This would mean that we need flags to indicate to the
> parser which measurements should be reported. For example, a Vendor
> ID, an image digest, or a component offset might need to be reported
> in the attestation report. Each of these is checked by a condition.
> Each of those conditions will consume a parameter under this model.
> Then, the argument can indicate: report a measurement, do not report a
> measurement, report a measurement only if comparison is successful, or
> perhaps other attestation-related policies. Bear in mind that
> attesting a failed condition may be helpful for attesting why a
> manifest has failed, as we discussed in the hackathon and virtual
> interim meeting.
>
> If we are making the majority of commands are using parameters instead
> of arguments, this becomes trivial: the arguments are replaced with
> attestation policy arguments. This allows us to tell the attestation
> engine explicitly what to report from the manifest, which allows
> secure, dynamically updatable attestation policy.
>
> This doesn’t introduce a substantial change to either the parser or
> the format. If there is some appetite for simplifying the correlation
> between commands and parameters, I think it might make sense to spend
> some effort aligning parameter keys with command keys. This could
> simplify the parser by allowing a generic parameter lookup to be done
> in one place, rather than by each handler.
>
> Best Regards,
> Brendan
> IMPORTANT NOTICE: The contents of this email and any attachments are
> confidential and may also be privileged. If you are not the intended
> recipient, please notify the sender immediately and do not disclose
> the contents to any other person, use it for any purpose, or store or
> copy the information in any medium. Thank you.
>
> _______________________________________________
> Suit mailing list
> Suit@ietf.org
> https://www.ietf.org/mailman/listinfo/suit