Re: [Teep] [EXT] OTrP Proposal - Removing Redundant Message Layer

Anders Rundgren <anders.rundgren.net@gmail.com> Sat, 01 July 2017 14:22 UTC

Return-Path: <anders.rundgren.net@gmail.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 22FFB1205F0 for <teep@ietfa.amsl.com>; Sat, 1 Jul 2017 07:22:19 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.999
X-Spam-Level:
X-Spam-Status: No, score=-1.999 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, 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 (2048-bit key) header.d=gmail.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 b_iC5Pxpd0bX for <teep@ietfa.amsl.com>; Sat, 1 Jul 2017 07:22:16 -0700 (PDT)
Received: from mail-wr0-x235.google.com (mail-wr0-x235.google.com [IPv6:2a00:1450:400c:c0c::235]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 2CCBF1204DA for <teep@ietf.org>; Sat, 1 Jul 2017 07:22:16 -0700 (PDT)
Received: by mail-wr0-x235.google.com with SMTP id r103so215899365wrb.0 for <teep@ietf.org>; Sat, 01 Jul 2017 07:22:16 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:subject:to:references:message-id:date:user-agent:mime-version :in-reply-to:content-language:content-transfer-encoding; bh=CIq72OQ6sEbQzppeu5H/kmn+sImTR6FlSxtkMsuPeyI=; b=WzfjP0+LJqgakMA1EWle10VgNNM4x1jSEFveBlvBEn4JFjzCh7kl38MdCnPHarLSaV ku6wnrK/dVyv+LuG1U+ADlVM+CBm0EY3EfZix8w88xQLocar+XKh0vVsbR/xnnliRXtK z+WClNosk5cN6WCkSt+vy1DtAzKaxLiuDV7Z7UJEslU5cpFMw78MmpvJf3PbLmz72T6i c1XeAe+pJ1VrRVzv4nYmXHKUy4n5CmgxCdloPKI/gqvJWSMByUcfomJnH4E4sYnGghYu EtlpQfewoOd7GjtgH/Pqb3+a7K40xtV3SY408kSW5kp7qjQDC1FMg0TO+dsKgHsz3vux GZvQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:subject:to:references:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=CIq72OQ6sEbQzppeu5H/kmn+sImTR6FlSxtkMsuPeyI=; b=KcJ9ScZE1pWPTje8DtRL2GxHE4CVMMQ2ev8F69sXF/IEsCDowCu3QU+3euNYBzSAHA 38+QuTHr45ukdhB8qBTzp2TVw5AgQOt9+hu68IF0r8JiXMP3hp7GNiXTPSbgDj8QGT5G csYi9yViUrK60DR4ZaKAkIp4ofg2RYTg8xgCDBAKAC3yJQ/iJsR0NAQSEWkTlT9sZOeR zjwUK7xNW5QjJ3iYPzLfMcNxVm9KnvTog9DF+AzZiGgZGfcPAR8z71+/2k4z5eXNEgk7 7s1OPxIXvMSl49WhghhtdFhQ3FZWW6GU971nUfoycaCXIvfOMrpMws8dHWV+L2niqfAc AAaQ==
X-Gm-Message-State: AKS2vOzItUqKpxChQXL2W4yMrOkCw36bTYHiOyyrrJVa2Zg2e9r/0hFX 6cmN5GCStlv5JNTa
X-Received: by 10.223.136.109 with SMTP id e42mr27550921wre.81.1498918934092; Sat, 01 Jul 2017 07:22:14 -0700 (PDT)
Received: from [192.168.1.79] (25.131.146.77.rev.sfr.net. [77.146.131.25]) by smtp.googlemail.com with ESMTPSA id m26sm14011192wrm.4.2017.07.01.07.22.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 01 Jul 2017 07:22:13 -0700 (PDT)
From: Anders Rundgren <anders.rundgren.net@gmail.com>
To: Mingliang Pei <Mingliang_Pei@symantec.com>, "teep@ietf.org" <teep@ietf.org>
References: <9ce8a049-496b-489e-177c-754f4b3dd70e@gmail.com> <D57C4AE6.39E72%mingliang_pei@symantec.com>
Message-ID: <afc95658-ad4e-c510-5cde-01b6442ed527@gmail.com>
Date: Sat, 01 Jul 2017 16:22:12 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.2.0
MIME-Version: 1.0
In-Reply-To: <D57C4AE6.39E72%mingliang_pei@symantec.com>
Content-Type: text/plain; charset="utf-8"; format="flowed"
Content-Language: en-US
Content-Transfer-Encoding: 8bit
Archived-At: <https://mailarchive.ietf.org/arch/msg/teep/FjhBxgQ6Tu-wxQ8KsiCMp5QqnTQ>
Subject: Re: [Teep] [EXT] OTrP Proposal - Removing Redundant Message Layer
X-BeenThere: teep@ietf.org
X-Mailman-Version: 2.1.22
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: Sat, 01 Jul 2017 14:22:19 -0000

On 2017-07-01 03:57, Mingliang Pei wrote:
> Hi Anders,

Hi Ming,

> 
> Thank you for your comments and suggestions. I was on vacation and travel,
> and just circle back on this. Please see my comments inline.
> 
> Overall, I did hope that JOSE signature can be inline as JCS for easier
> readability without being in the encoded form but I do see much bigger
> benefit to leverage well discussed and approved standard JOSE for
> achieving implementation interoperability. If JCS can get further
> alignment within IETF as an alternative JSON signature standard, I am open
> to support it.

This is a question that is not only technical, but political. Converting JCS
into an RFC is probably quite possible but without backing from a more noteworthy
entity, I wouldn't mean that much.  The JOSE WG is concluded BTW.

IMO, standards need an application to thrive, JOSE WG was effectively created
by the needs of OpenID including URL-safe signatures.

JCS was designed for information-rich applications that previously typically
would be expressed in XML like payments.  JCS dropped the canonicalization
requirement by building on ECMA's definition of JSON.parse() and JSON.stringify().
This scheme was neither known nor considered by the JOSE WG.

It is important to get the proportions right here, we are talking about
*extremely simple code* compared to XML canonicalization.

If the TEEP WG consider message readability and the Message/TBS layer design
a minor issue, JWS is an obvious choice.  I would do the same :-)

Outside of the IETF, I don't think many people is going to dress their precious
messages in Base64 since it has been proved (by multiple parties working with standards
in this space including the W3C), to be unnecessary and obstructing message syntax.

For my work JWS was sort of "impossible" since some of it builds on signed messages
enveloping other signed messages (counter-signing).  Nowadays there is also an
encryption counterpart which shares the JCS clear text notion and JWK support for
header elements: https://cyberphone.github.io/doc/security/jef.html

I would love to go Prague, but I'm currently rather busy with a payment consultant
job. A tele-conference would be quite possible just about anytime if you would be
interested in discussing JCS.

Regards,
Anders

> We know the history of XML signature - enveloped and
> attached flavors. I didn¹t get into the JOSE discussion of the final
> choice but I knew that canonicalization was complex to handle. The
> overhead of Base64URL of payload looks to be tolerable if not ideal in
> this usage context here, I think.
> 
> How do you see the traction that JCS becomes a commonly endorsed standard
> format?
> 
> Thanks,
> 
> Ming
> 
> On 5/23/17, 10:49 PM, "TEEP on behalf of Anders Rundgren"
> <teep-bounces@ietf.org on behalf of anders.rundgren.net@gmail.com> wrote:
> 
>> Hi TEEers,
>>
>> As an alternative (or maybe a complement) to the session-key proposal
>> https://mailarchive.ietf.org/arch/msg/teep/qs-4aXf2Fx9mrBOz6Kj8f1Mk7G8
>> you may consider evaluating an alternative to JOSE for signatures.
>>
>> The JOSE standards stack is awesome but was designed for the needs of
>> OpenId and such rather than security protocols in general. Another corner
>> stone for the JOSE work was that there is no such thing as JSON
>> canonicalization which is why data is dressed in Base64URL.  However, the
>> latter changed with the advent of EcmaScript version 6 which specifies an
>> exact method for serializing JavaScript/JSON objects which is already
>> implemented in most Browsers, Node.js, as well as in Android* and Java*
>> in general.  In fact (modulo floating point), it works flawlessly in most
>> other platforms as well.
>>
>> Now to the actual issue.  I have taken the liberty analyzing the
>> consequences of using JWS in OTrP:
>>
>> https://tools.ietf.org/html/draft-pei-opentrustprotocol-03#section-7.4
>>
>>              "The top element " <name>[Signed][Request | Response]"
>> cannot be
>>               fully trusted to match the content because it doesn't
>> participate the
>>               signature generation.  However, a recipient can always
>> match it with
>>               the value associated with the property "payload".  It
>> purely serves to
>>               provide a quick reference for reading and method
>> invocation."
>>
>> SIDE-EFFECT: JWS introduces additional signature verification steps
> 
> Ming: right. The naming is a reference, and can be compared with the name
> in the payload that has integrity check. The overhead is pretty small or
> trivial in my consideration, leveraging JOSE while providing some quick
> reference benefit without decoding. It is a balance.
> 
>>
>>
>> https://tools.ietf.org/html/draft-pei-opentrustprotocol-03#section-8.2.1.3
>>
>> Top level message object:
>>              {
>>                   "CreateSDResponse": {
>>                     "payload":"<CreateSDTBSResponse JSON>",
>>                     "protected": {
>>                        "<BASE64URL of signing algorithm>"
>>                     },
>>                     "signature": "<signature contents signed by TEE
>> device private   key (BASE64URL)>"
>>                   }
>>                 }
>>
>> Payload:
>>               {
>>                   "CreateSDTBSResponse": {
>>                     "ver": "1.0",
>>                     "status": "<operation result>",
>>                     "rid": "<the request ID received>",
>>                     "tid": "<the transaction ID received>",
>>                     "content": ENCRYPTED {
>>                       "reason":"<failure reason detail>", // optional
>>                       "did": "<the device id received from the request>",
>>                       "sdname": "<SD name for the domain created>",
>>                       "teespaik": "<TEE SP AIK public key, BASE64
>> encoded>",
>>                       "dsi": "<Updated TEE state, including all SD owned
>> by    this TSM>"
>>                     }
>>                   }
>>                }
>>
>> SIDE-EFFECT: JWS forces you adding artificial message layers in order to
>> get a reasonable message structure.
> 
> Ming: the payload data itself can freely have any data content we need to
> construct for OTrP logic. It just goes back to the encoding to get payload
> and the JOSE signature.
> 
>>
>> By combining ES6 Serialization, JSON Web Algorithms (JOSE/JWA) and JSON
>> Web Key (JOSE/JWK), you can stay pretty close to JOSE while getting away
>>from the current two-level messaging scheme in addition to having header
>> information in clear:
>> https://cyberphone.github.io/doc/security/jsonsignatures.html
>>
>> Although not on any IETF standard track, this is not a research project,
>> JCS (JSON Cleartext Signature) is fully documented and supported by an
>> extensive set of test vectors and working code.
> 
> Ming: thanks for your work. I trust it is well written and tested. Just
> for standard reference, I am personally inclined to leverage what has been
> approved JSON after many considerable debates and compromise for
> interoperability. Happy to discuss further here and at Prague if you are
> going. Thanks again for your improvement suggestion.
> 
>>
>> Cheers,
>> Anders
>> Co-inventor of signed JavaScript/JSON objects
>> https://clicktime.symantec.com/a/1/QTy_yBCUNYZo9tIyB1dIFw0oU5d_qTtMg1iQZNC
>> hLtQ=?d=H1RqBoAz6Y6IDyLUoGRp6kVw-Qep7vDUn0dbUlh75Rjsxyxc5WkwHTZm5rN7aT9qnG
>> pI-VF8jgfJSICAEGQjVGq0UVUkXypftYQeaNBTYhG73dVHczyC_w405LsuUV9elouoIWeZVz-v
>> 56y-nOct4hnWBHZbsJ27bdVdshzT8N1OgpfTNF6skQp5qTIzGvYaGXkpWmi9FTqlFpYsMcM0la
>> g32Fv2kiYAHiJBWtlPlD-E4ebDPyTUoZKB1WLGphwu0jnVc0HVM5Y5iyTQtCG0UFP9JgdEVamw
>> B-WPU8l0518eiQ_sqIx71zVgggh9G2d9zyXz3aQq_pUBb4Ky3HzsTrpo1wkF7gRfutAsnCsJWo
>> uCkhN7ZkB33OSAesgr5A2r_RGsnpNn6YScZ7kBiJzG&u=https%3A%2F%2Fgithub.com%2Fcy
>> berphone%2Fopenkeystore%23openkeystore
>>
>> * Through third-party libraries
>>
>> _______________________________________________
>> TEEP mailing list
>> TEEP@ietf.org
>> https://www.ietf.org/mailman/listinfo/teep
>