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

Dave Thaler <dthaler@microsoft.com> Mon, 16 July 2018 17:59 UTC

Return-Path: <dthaler@microsoft.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 3155613118A for <teep@ietfa.amsl.com>; Mon, 16 Jul 2018 10:59:49 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.01
X-Spam-Level:
X-Spam-Status: No, score=-2.01 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001, T_DKIMWL_WL_HIGH=-0.01] 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 9yMfkGlHc4jU for <teep@ietfa.amsl.com>; Mon, 16 Jul 2018 10:59:44 -0700 (PDT)
Received: from NAM05-BY2-obe.outbound.protection.outlook.com (mail-eopbgr710124.outbound.protection.outlook.com [40.107.71.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 20196131177 for <teep@ietf.org>; Mon, 16 Jul 2018 10:59:41 -0700 (PDT)
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=V9VF8kUS4i+c7g8nX2FAft/Ji0lnrRBZ5PoA3VtRIR4=; b=fcuOfDMVDhicWmJt+e6Mz35+XN5P3xwRlMwbWuxXhL27Q3dXLf8ox7wmBni7dB40kLnw4BFLmv/EspDSwMd2ViQXt/pW2yRHuvJKD1PIIvlyvPi7w2WlsKqlxdPU0xjibRzfEb2ZJvMXQo/SojWOaJvqXOo25YKeZcDgGCzsKvc=
Received: from DM5PR2101MB0805.namprd21.prod.outlook.com (10.167.105.149) by DM5PR2101MB0903.namprd21.prod.outlook.com (52.132.132.160) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.995.1; Mon, 16 Jul 2018 17:59:39 +0000
Received: from DM5PR2101MB0805.namprd21.prod.outlook.com ([fe80::8416:6f:8f6b:3fb7]) by DM5PR2101MB0805.namprd21.prod.outlook.com ([fe80::8416:6f:8f6b:3fb7%3]) with mapi id 15.20.0995.000; Mon, 16 Jul 2018 17:59:39 +0000
From: Dave Thaler <dthaler@microsoft.com>
To: Andrew Atyeo <Andrew.Atyeo@intercede.com>, "teep@ietf.org" <teep@ietf.org>
Thread-Topic: Implementation feedback on draft-ietf-teep-opentrustprotocol-01
Thread-Index: AdQdELD0WeWS9FafTXOUTGNyvJ0BjgAAIDtQAAKGEoA=
Date: Mon, 16 Jul 2018 17:59:39 +0000
Message-ID: <DM5PR2101MB0805A7BEC6DE90EC6910088CA35D0@DM5PR2101MB0805.namprd21.prod.outlook.com>
References: <DM5PR2101MB0805ECC14568567445C261D5A35D0@DM5PR2101MB0805.namprd21.prod.outlook.com> <HE1PR06MB3147E1F7E2F989977A104773955D0@HE1PR06MB3147.eurprd06.prod.outlook.com>
In-Reply-To: <HE1PR06MB3147E1F7E2F989977A104773955D0@HE1PR06MB3147.eurprd06.prod.outlook.com>
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=dthaler@ntdev.microsoft.com; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SetDate=2018-07-16T17:53:21.3059708Z; 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:67c:1232:144:f57f:f28c:b655:e32]
x-ms-publictraffictype: Email
x-microsoft-exchange-diagnostics: 1; DM5PR2101MB0903; 6:KgSE5mCheo2BlVU7ei8c2LYtk8godKH1cM+nRAPVESVFnLF40YTQcl/ZFLhW/5+4rwgVFmW1SHiMCOArposWyLSYITJ4ShNHxNZZH2+jNDSN3en+2tKpeyKeDRBBc4qOXi12aRL776XAVDX8WVylWoQmok51/zrBA55cofhGeG5t7xrW9k6pSZPgO/JUOY2IcVfq+39MZ2p1EEACnRzja0HgPlJbDJpTvaipzCc6GiNIpgAPJLVnUwvvC15vE2t8odGJUwI8/t81sHeNfqN0jOJd65uinKt/Rb248q4gtBNwkrW6ELLHvvcLuTrVSZA6IOb1E7+DXnkTYAIaxDYkX2id9ISSR/DShbFwHNDox6RytLZPo4rYBne+86rFiA7NIKBxB8MmhHbviaQHPUAO9U8lRkfBDeNVL0zqCCHOQAkz7jmqf7E1JHb1QWnO1r67/V2Etmiiv5ly6KBD3T+Mgg==; 5:EUFC+iA4l8+8EypqubZk6brNtggAr2UJVp1LWFn+ikp3ipP+hrVmy4wfmJvT8q+ogzGo2p1BRrA8Hjvt3mTUiPz/ODBd5yK6bwyt/P4C4Gjzw2XFNr9ekcQgFhhygYERTFcuVo3j5xz14iARzXg0HJ9tniTUEOmNPVfxRX2ALYA=; 7:ngWtGEBI/aymPlsuxNYWp2FmvFPK/lsAIFJP9VL9m5oTNEclCKqfj3TyaLY87Rf20UQsffQ8TuiK43S5A2dwsouvzZwcM556Rd37xu79oIhmSE9AeUeJZyr54mGLKrHMDIezC2y6S0/UAXujSQqq9BeLss5wleOBO4qYxW4Gyq6vk2G3SDjpmw/YcwtJP5lLtSsMuZ2+FGnMTmgDI+C0PNOCFgSGQVrCXLN483tdGKrCdYNYOp0GZpBR3ybWM272
x-ms-exchange-antispam-srfa-diagnostics: SOS;
x-ms-office365-filtering-ht: Tenant
x-ms-office365-filtering-correlation-id: fd36e7c5-a9db-4d95-8305-08d5eb45e6b5
x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989117)(48565401081)(5600053)(711020)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(2017052603328)(7193020); SRVR:DM5PR2101MB0903;
x-ms-traffictypediagnostic: DM5PR2101MB0903:
authentication-results: spf=none (sender IP is ) smtp.mailfrom=dthaler@microsoft.com;
x-microsoft-antispam-prvs: <DM5PR2101MB0903A7CE7B59D68A3EC84391A35D0@DM5PR2101MB0903.namprd21.prod.outlook.com>
x-exchange-antispam-report-test: UriScan:(28532068793085)(21748063052155);
x-ms-exchange-senderadcheck: 1
x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(93006095)(93001095)(3231311)(944501410)(52105095)(2018427008)(3002001)(10201501046)(6055026)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123564045)(20161123558120)(20161123560045)(6072148)(201708071742011)(7699016); SRVR:DM5PR2101MB0903; BCL:0; PCL:0; RULEID:; SRVR:DM5PR2101MB0903;
x-forefront-prvs: 073515755F
x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(39860400002)(366004)(346002)(396003)(136003)(376002)(189003)(199004)(60444003)(68736007)(53936002)(8676002)(790700001)(6116002)(76176011)(6436002)(74316002)(102836004)(229853002)(6506007)(8990500004)(55016002)(10090500001)(7696005)(54896002)(6306002)(14444005)(256004)(9686003)(6246003)(2900100001)(86362001)(25786009)(8936002)(14454004)(316002)(446003)(110136005)(2501003)(22452003)(2906002)(86612001)(186003)(476003)(486006)(7736002)(81166006)(105586002)(46003)(5660300001)(81156014)(11346002)(106356001)(33656002)(478600001)(99286004)(5250100002)(10290500003)(97736004); DIR:OUT; SFP:1102; SCL:1; SRVR:DM5PR2101MB0903; H:DM5PR2101MB0805.namprd21.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1;
received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts)
x-microsoft-antispam-message-info: Gfbbb2bN8gX64Tcz89qaXj5SrPdVAUP7YxLw9zeFULtULveGRPViV26xEoIkJYzaWWd2XVIQC4kllXqLizS6TpDT/gKtgekod7FuclfGF4nG/ObosvTU4TVrZzuaD9QlgNS1Y5w1HRgNsIK6aKL72NU7d5Kd4THuYIBSMiWHrobEMH1FD/XJSgP9dnGaUSTd6ADmJ1WJwEwx5FTIg7AqXoSNEJF9ehiNaYHfHIFOZIAKwuP+wp7jYGmN820I535YPV1AKvtkapffC2HS/HKTgrLqnEopFshE95Rb80Lhf+chZuDKfelf4XpbC/yzlZCY0hiRUl9MuMAPx9Fi0/YGlaKex3jrWj6Y/r5CYIfOCPU=
spamdiagnosticoutput: 1:99
spamdiagnosticmetadata: NSPM
Content-Type: multipart/alternative; boundary="_000_DM5PR2101MB0805A7BEC6DE90EC6910088CA35D0DM5PR2101MB0805_"
MIME-Version: 1.0
X-OriginatorOrg: microsoft.com
X-MS-Exchange-CrossTenant-Network-Message-Id: fd36e7c5-a9db-4d95-8305-08d5eb45e6b5
X-MS-Exchange-CrossTenant-originalarrivaltime: 16 Jul 2018 17:59:39.7048 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR2101MB0903
Archived-At: <https://mailarchive.ietf.org/arch/msg/teep/P8_ajOkdob6zSKJ6Gd0np--WpSQ>
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 17:59:55 -0000

Andrew writes:
…

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?



As I noted in my arch doc comments, I disagree that there needs to be any communication between the rich app being installed, and the TAM.  A valid implementation model should be that the app store installer reads the metadata (including TA dependencies) about the rich app, and as part of installing the rich app (without ever needing to run it), the installer can communicate with the TEE to express those dependencies, which then triggers the TEE to generate a signed message to the TAM, which can be related by the installer.



In the less efficient model where the rich app has to be run, as the doc implies, the same process can occur where the TEE generates the message in response to the rich app telling the agent it has a dependency.

…

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?



The same piece of code that connects to the TAM tells the TEE what TA’s it desires.

The TEE then generates a message with the list of TAs that aren’t already installed.



…

3)     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

My main point is that it should be possible to combine CreateSD into the first InstallTA and be more efficient.
Also remember that the TA binary need not come from the TAM.


4)     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’)



Unless there is a reason a guid is actually needed (e.g., global uniqueness), I would argue against that additional complexity.

If all you need is uniqueness within a session, a simple sequence number would suffice.



5)     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.



I don’t understand, and the terms seem to be interchangeable in the doc, so if there is a distinction, it’s not explained clearly in the doc.



6)     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).

TAs inherently can depend on other TA’s.  I don’t think it should be out of scope for the WG.

Dave