Re: [Teep] Implementation feedback on draft-ietf-teep-opentrustprotocol-01

Andrew Atyeo <Andrew.Atyeo@intercede.com> Mon, 16 July 2018 15:36 UTC

Return-Path: <Andrew.Atyeo@intercede.com>
X-Original-To: teep@ietfa.amsl.com
Delivered-To: teep@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id AE3701310C5 for <teep@ietfa.amsl.com>; Mon, 16 Jul 2018 08:36:52 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.909
X-Spam-Level:
X-Spam-Status: No, score=-1.909 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001, T_DKIMWL_WL_MED=-0.01, URIBL_BLOCKED=0.001] autolearn=unavailable autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=intercedeltd.onmicrosoft.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 sPZjQoR_O4_e for <teep@ietfa.amsl.com>; Mon, 16 Jul 2018 08:36:48 -0700 (PDT)
Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-db5eur01on0069.outbound.protection.outlook.com [104.47.2.69]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 32E391310C2 for <teep@ietf.org>; Mon, 16 Jul 2018 08:36:46 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=IntercedeLtd.onmicrosoft.com; s=selector1-intercede-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=CLwWxSesQZwYVCrx4PPC6okcnb1biWFDaP2ovy6+Bhk=; b=aPze/bOcKBM1g9o42+8gbYx133EhL6FiKY5iR1vDE6C4Kyu2GQHkKQeVG0sWUQ2ZtoeR4xKhRcdv7SFo8tJ46nkqzy9RqFmC/xT9U7fQbJAyZ/gFgvfD+b5qQT+YluEEbRaG0ojcUbvFBtuYu2p4tqcbTuMVRp0s62b+EZwOoBY=
Received: from HE1PR06MB3147.eurprd06.prod.outlook.com (10.171.198.20) by HE1PR06MB3161.eurprd06.prod.outlook.com (10.171.198.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.952.18; Mon, 16 Jul 2018 15:36:43 +0000
Received: from HE1PR06MB3147.eurprd06.prod.outlook.com ([fe80::ec16:1065:dc4f:2e80]) by HE1PR06MB3147.eurprd06.prod.outlook.com ([fe80::ec16:1065:dc4f:2e80%4]) with mapi id 15.20.0952.021; Mon, 16 Jul 2018 15:36:43 +0000
From: Andrew Atyeo <Andrew.Atyeo@intercede.com>
To: Dave Thaler <dthaler=40microsoft.com@dmarc.ietf.org>, "teep@ietf.org" <teep@ietf.org>
Thread-Topic: Implementation feedback on draft-ietf-teep-opentrustprotocol-01
Thread-Index: AdQdELD0WeWS9FafTXOUTGNyvJ0BjgAAIDtQ
Date: Mon, 16 Jul 2018 15:36:43 +0000
Message-ID: <HE1PR06MB3147E1F7E2F989977A104773955D0@HE1PR06MB3147.eurprd06.prod.outlook.com>
References: <DM5PR2101MB0805ECC14568567445C261D5A35D0@DM5PR2101MB0805.namprd21.prod.outlook.com>
In-Reply-To: <DM5PR2101MB0805ECC14568567445C261D5A35D0@DM5PR2101MB0805.namprd21.prod.outlook.com>
Accept-Language: en-GB, en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
authentication-results: spf=none (sender IP is ) smtp.mailfrom=Andrew.Atyeo@intercede.com;
x-originating-ip: [62.172.117.190]
x-ms-publictraffictype: Email
x-microsoft-exchange-diagnostics: 1; HE1PR06MB3161; 7:kW4OJH/e5H75IZN/G945P3mVKvPGl+rimH5tiKXtuQ58KVgtuR0iqqcO6P74fFVsptw3wu3FCFuMxq2jcao0uO4j/halANet2L9R9lynQv9jVpQ8ztkMb+IyH1Q5jWrEsAr4vKUTiZF47QHLoO7la0f8waF1bdNM+JSIE9Op/q0Raj+x7vnuW/Bz33t7MV1l1j5fxkBs+3qQj40umWfYnmiA9ITMGP4mZehQnRVlWwZmWCRo/cLqo1K1hnMijX+C
x-ms-exchange-antispam-srfa-diagnostics: SOS;
x-ms-office365-filtering-correlation-id: b5967e11-c1d9-4231-4b56-08d5eb31eead
x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989117)(5600053)(711020)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(2017052603328)(7153060)(7193020); SRVR:HE1PR06MB3161;
x-ms-traffictypediagnostic: HE1PR06MB3161:
x-microsoft-antispam-prvs: <HE1PR06MB31618FFC090E93B583D682EA955D0@HE1PR06MB3161.eurprd06.prod.outlook.com>
x-exchange-antispam-report-test: UriScan:(28532068793085)(192374486261705)(21748063052155);
x-ms-exchange-senderadcheck: 1
x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(6040522)(2401047)(5005006)(8121501046)(3002001)(3231311)(944501410)(52105095)(10201501046)(93006095)(93001095)(149027)(150027)(6041310)(20161123564045)(20161123558120)(20161123562045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011)(7699016); SRVR:HE1PR06MB3161; BCL:0; PCL:0; RULEID:; SRVR:HE1PR06MB3161;
x-forefront-prvs: 073515755F
x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(346002)(376002)(396003)(136003)(366004)(39840400004)(52314003)(199004)(189003)(72206003)(7696005)(14444005)(14454004)(68736007)(229853002)(256004)(9686003)(97736004)(54896002)(6436002)(6306002)(186003)(66066001)(53546011)(76176011)(55016002)(102836004)(26005)(6506007)(478600001)(105586002)(106356001)(3846002)(99286004)(33656002)(446003)(5250100002)(110136005)(86362001)(6246003)(2906002)(2900100001)(74316002)(25786009)(316002)(5660300001)(2501003)(7736002)(8936002)(6116002)(81166006)(81156014)(53936002)(8676002)(486006)(236005)(790700001)(606006)(476003)(11346002); DIR:OUT; SFP:1101; SCL:1; SRVR:HE1PR06MB3161; H:HE1PR06MB3147.eurprd06.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1;
received-spf: None (protection.outlook.com: intercede.com does not designate permitted sender hosts)
x-microsoft-antispam-message-info: WKwYOOeSmniN/EwHiAVCZW/KLUlHRjAt6IZpKiKv/cteMuVXB2PPxrUoXrVBrLEyROnPEq8A5r5vMNmit7DK5S7ijuFUe5RmVUJ2mFDozUmA3msBcjgTVGz6sy55RFL7CbqTmtOU2BsjV+HFobaCqAcjHIYaKYm6D2MBQFRK+wfhbenbXYiIlFN4rBslDj2a96yup8CObh2XoLLs1TITk7X6nw2n8Mp8CPpEtApnc4udyFmwZ6NENWxJ9jXfzVViYItM9OejvB0GBj7OjDuJKdVDwlfFQbfNDbpoPzksEP6tOoX2tvZIyYO/glfiXiZ3IqZZ04B0kYExlsHVbozqH9djh7tlombVz7Keg2/L6D4=
spamdiagnosticoutput: 1:99
spamdiagnosticmetadata: NSPM
Content-Type: multipart/alternative; boundary="_000_HE1PR06MB3147E1F7E2F989977A104773955D0HE1PR06MB3147eurp_"
MIME-Version: 1.0
X-OriginatorOrg: intercede.com
X-MS-Exchange-CrossTenant-Network-Message-Id: b5967e11-c1d9-4231-4b56-08d5eb31eead
X-MS-Exchange-CrossTenant-originalarrivaltime: 16 Jul 2018 15:36:43.2740 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 1075719f-f133-43d2-8156-800f80fef316
X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR06MB3161
Archived-At: <https://mailarchive.ietf.org/arch/msg/teep/eN-OuB4_GeGIxaQ0Sl2zkd-W1no>
Subject: Re: [Teep] Implementation feedback on draft-ietf-teep-opentrustprotocol-01
X-BeenThere: teep@ietf.org
X-Mailman-Version: 2.1.27
Precedence: list
List-Id: A Protocol for Dynamic Trusted Execution Environment Enablement <teep.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/teep>, <mailto:teep-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/teep/>
List-Post: <mailto:teep@ietf.org>
List-Help: <mailto:teep-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/teep>, <mailto:teep-request@ietf.org?subject=subscribe>
X-List-Received-Date: Mon, 16 Jul 2018 15:36:53 -0000

Some really good feedback from Dave – my thoughts [AA] in the email below.

Andrew Atyeo
Security Architect
Intercede
Digital trust    people ǀ devices ǀ apps
Office: +44 (0) 1455 558 111
www.intercede.com<https://www.intercede.com/>
Legal Disclaimer <https://www.intercede.com/privacy-cookies>
From: TEEP [mailto:teep-bounces@ietf.org] On Behalf Of Dave Thaler
Sent: 16 July 2018 15:25
To: teep@ietf.org
Subject: [Teep] Implementation feedback on draft-ietf-teep-opentrustprotocol-01

During the Hackathon yesterday, I started trying to write code for OTrP
to see what issues I would run into.   Below are some issues I ran into, in
addition to what I already gave as feedback on the arch doc.


1)      Section 6.5 explains that the TAM needs to receive a list of one or more

TA’s that are requested to be installed (S6.5.1 point 1A).  However, no

message is defined for doing so, which prevents interoperability.  I
think this message needs to be generated by the TEE (not the rich app),
for reasons I will explain in #3 below.

[AA] I don’t see the need for a message for defining the TAs that need to be installed. The OTrP messages are between the TAM and the TEE, but the desire to install TAs comes from the rich app. In practice, a rich app will have the identifiers of the TAs it requires built into its own code, since its own code will also be calling those TAs (e.g. once installed, to perform some DRM or payment authentication). Therefore a rich app is aware of the TAs it needs.

I don’t think this info can come from the TEE – since at this point the TA is not installed yet, so which part of the TEE would have the knowledge of which TAs are needed?



2)      Section 6.5 explains that the TAM needs to keep track of TAs installed
on all devices, even though its list might be wrong.   This has a scalability
issue.  Instead, I think there should be no such requirement.
[AA] the document should not mandate that a TAM needs to keep track of TAs. (Most would, but this is a implementation detail).
The whole of section 6.5 is for a ‘sample flow’, so I don’t think it is mandating anything.

3)      Putting my issue #1 and issue #2 together means there’s an extra round

trip that is unnecessary.  6.5 says the TAM receive a list of TAs needed,

and then the TAM just goes back and asks what is installed, just to get
a list of what needs to be installed.  This is unnecessary, the TEE can just

send a list of one or more TAs that need to be installed and aren’t already.

Hopefully this explains why I said in issue #1 above why I think the message
needs to be generated by the TEE.

[AA] but how could the TEE (which doesn’t have its TAs loaded yet) know what TAs should be loaded?

4)      Section 9.1.1 requires a list of OCSP stapling data, but as far as I can see,

the document provides no information or citation about the correct format
for such data.

[AA] This is a good point – this should refer to rfc6960

5)      The “did” field in 9.2.1.1 seems to be either (a) redundant and should be

removed, or (b) missing from other messages like Install TA.  The text explains
the field is to check that the message was received by the right device.  My
opinion is that since the TEE has to trust the TAM anyway, it’s the TAM’s
responsibility to send messages to the right device over an authenticated
channel (whether encrypted or not).  So I think it should be removed.

6)      Some fields, e.g. “signerreq”, have boolean values that are encoded as
strings (“true”, “false”). I think these should be boolean types, not strings,
which would also have the advantage of better compression if we can use
CBOR encoding.
[AA] I agree. At one point we had a bug open to address this, but I think there are some cases that are not addressed. For example 9.1.5 shows signerreq as a json Boolean (true), but then the example GetDeviceTEEStateResponse on page 36, and other places shows signerreq as a string (“true”).
There needs to be an cleanup, searching on true and false, to identify any missed cases where Booleans are still represented as strings.

7)      Section 6.5.1 point 9.A implies that to install a TA, one must have an extra
round trip first to create an SD if one isn’t already there.  I would expect one
common case to be where there is one TA per SD, so that all TAs are isolated
from each other.  As such, requiring the extra delay is inefficient in time,
bandwidth, and processing.   All the fields in CreateSD are already present
in an InstallTA message (except the “did” field mentioned above in issue #5),
so it could be done automatically by the first InstallTA message itself.
[AA] when the SD is created, an asymmetric keypair is generated (spaik), and the public part of this is returned. When a TA is installed, it is encrypted with this key. This enables some use cases where a TAM could interface to a SP and enable an SP to provide the TA encrypted such that the TA binary is not known by the TAM.
The spaik is also used to encrypt the personalization data (that is also sent in InstallTA), and there is also a use case for a TAM interfacing to an SP in order that the SP encrypts perso data for that TEE such that it travels via the TAM to the TEE, but without the TAM having access to that data
Since InstallTA requires knowledge of the public key returned from CreateSD, it is true that the extra round trip is required.
So the question is whether there is a case for installing TA (and their accompanying perso data) without the ability to provide confidentiality between an SP and the TEE by making that layer of encryption optional, and by allowing the TA (and perso data?) to be bundled into CreateSD


8)      The scope of uniqueness of the “rid” and “tid” fields is underspecified.

They just say “unique”.  I think “rid” is just supposed to be unique within

a given {session,”tid”} but I can’t tell for sure.  And I think “tid” is just supposed
to be unique within a given session (not globally across all sessions, all TAMs,

all devices), but I can’t tell.   They’re also formatted as strings, but I’m not sure
why they can’t be integers which I think would be much more efficient..

[AA] although it is not mandated, random guids can be a viable implementation choice for these (as it takes away the requirement to manage incremental counters) – so I would not want to see these become integers. By making them strings, a TAM can choose the mechanism it wants.

I take your point about “rid” and “tid” being underspecified. The truth is that values contained in these fields don’t matter to the protocol much. (they are mostly for the convenience of the TAM in order to match up request and response messages (rid), and (tid) to understand which messages belong in a ‘conversation’)

9)      I found it confusing that the names of the messages don’t match the name values
in the messages themselves (“GetDeviceStateResponse” vs

“GetDeviceTEEStateTBSResponse”, etc.)   Having these not match is bug-prone.

[AA] I agree. Instead of having a mixture of GetDeviceStateXXX and GetDeviceTEEStateXXX they should all standardize on GetDeviceTEEStateXXX.

Node that there are intentional differences at the end of those words (e.g. GetDeviceTEEStateTBSResponse vs GetDeviceTEEStateResponse is intentional as one of these is the ‘to be signed’ data and the other is the signed data.

10)  It’s unclear whether a rich app can depend on two TA’s from different TAMs,

and whether a TA can depend on a TA from a different TAM.  In the use case

where the device admin runs the TAM and controls all TAs on their devices the

answer would be no.  But in other use cases I’m not sure.   If so, then the question
arises about how dependencies are expressed and whether a dependency needs
to express which TAM is used.  This then begs the questions of whether a TA might
be via more than one TAM, or might change TAMs over time.   The answers here
probably belong in the arch doc.
[AA] TA inter-dependency is completely out of the scope of the OTrP protocol. (so the rich app vendor needs to know all the TA IDs they need installing, and which TAM(s) to get them from).

Dave