Re: [COSE] Newly Submitted Draft - CBOR Web Token (CWT) Claims in COSE Headers

Anders Rundgren <anders.rundgren.net@gmail.com> Tue, 08 March 2022 17:50 UTC

Return-Path: <anders.rundgren.net@gmail.com>
X-Original-To: cose@ietfa.amsl.com
Delivered-To: cose@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 627A23A0105 for <cose@ietfa.amsl.com>; Tue, 8 Mar 2022 09:50:18 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.109
X-Spam-Level:
X-Spam-Status: No, score=-2.109 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, FREEMAIL_FROM=0.001, NICE_REPLY_A=-0.001, RCVD_IN_DNSWL_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01] 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 zOtoNU6T7LfY for <cose@ietfa.amsl.com>; Tue, 8 Mar 2022 09:50:13 -0800 (PST)
Received: from mail-wr1-x430.google.com (mail-wr1-x430.google.com [IPv6:2a00:1450:4864:20::430]) (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 2E4883A00E5 for <cose@ietf.org>; Tue, 8 Mar 2022 09:50:13 -0800 (PST)
Received: by mail-wr1-x430.google.com with SMTP id r10so29801413wrp.3 for <cose@ietf.org>; Tue, 08 Mar 2022 09:50:13 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:date:mime-version:user-agent:subject:content-language:to :cc:references:from:in-reply-to:content-transfer-encoding; bh=KnUBskf/WJQSZcBlgjnQXtIA7yAIlVGzb9HWVW89AuU=; b=hSuuOuyxU8EXTErM8ZgSvOKajoZIrtu11eSv/tU2MEBAx43KoGkov5mzchHHVIg+zJ x1fPORDHaMX/ypkwZUxQnpwCH+8MqL6dAbe5ktx0ovw+S5fe6Mra65Xk9/DvB2djDLNu XZaunrgI+hg53zvfZKwlJni+oElzDS58w0NakkKCsMmyZEfV+s+8VfFyjMTzePaWBmZy m2Z7/1qLByOisWsFx6UhUXPdLrFK/rupEcNfaku0QMLKyxcyTrk3F3G9woAL0dlj90Cr YSxmC0SMsP7vMCQwipSKRVoTVA4nGSRlnEMrvb/x6xsNMJTPDo6hAfOLZpKGF2xCQ4Gt neNw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=KnUBskf/WJQSZcBlgjnQXtIA7yAIlVGzb9HWVW89AuU=; b=ivf4toO9LoeXiCHliN+0V79gmpgiktn8XAFgY7pNA+TuREnXEG2h04gPtJyYQGrSrk fqW5hzLkTLmpdgh1XkC9gKrbFrFMJxBNtWPSlByx1bUVu7BTnHl/b1eqlOYMyCH8rl8B JdjofLgGoGtd7vBSfbXhPGMF1Z2zJs+QZrMrWCrGnYJ2tzJ2cl0bzERsD1Zs4zBnGIBv VdYidraghsHB+D3tqcxrOtAHbaMJDfBcEZM6HXFd/ZisqZTkqVeAFpQdETRWvAQKd7Oi q6zxMonlE3kgOhKHEsMkdifBqhZOl0cXuL4BwFOgG4BqOanmZuZ15EIiKHqWfD1X1DmR xy4g==
X-Gm-Message-State: AOAM533WeHXjqGXCyzPrLK43Zv97LW0+ZTJwTwmJiAACzwfNYtMK7HpB EXFtY6kOrg72+Zpe5uQo3Lg=
X-Google-Smtp-Source: ABdhPJz3WHTbTKjbfcescKqUTN8SIOyONEcDNeptpQJUf23XXyWipMwp2138KKyyT1CgUEOXIpFteg==
X-Received: by 2002:a5d:584f:0:b0:1e8:5697:e979 with SMTP id i15-20020a5d584f000000b001e85697e979mr13313545wrf.167.1646761811163; Tue, 08 Mar 2022 09:50:11 -0800 (PST)
Received: from [192.168.1.67] (25.131.146.77.rev.sfr.net. [77.146.131.25]) by smtp.googlemail.com with ESMTPSA id l11-20020a5d674b000000b001f047c49e99sm14579132wrw.2.2022.03.08.09.50.09 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 08 Mar 2022 09:50:10 -0800 (PST)
Message-ID: <eecf3089-d807-22ca-e6a6-67fe45151dd0@gmail.com>
Date: Tue, 8 Mar 2022 18:50:09 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.6.2
Content-Language: en-US
To: Laurence Lundblade <lgl@island-resort.com>
Cc: Carsten Bormann <cabo@tzi.org>, "cose@ietf.org" <cose@ietf.org>, Mike Jones <Michael.Jones@microsoft.com>, Hannes Tschofenig <hannes.tschofenig@arm.com>, Tobias Looker <tobias.looker@mattr.global>
References: <SY4P282MB1274BCAC469DFE3B7284DFB29D039@SY4P282MB1274.AUSP282.PROD.OUTLOOK.COM> <DBBPR08MB5915A5EE40B555A4953E7BA0FA039@DBBPR08MB5915.eurprd08.prod.outlook.com> <SJ0PR00MB10050EBE6EAB4E80584A31B9F5039@SJ0PR00MB1005.namprd00.prod.outlook.com> <280EEA8E-67E4-4E7A-94A6-8C0A60048F81@island-resort.com> <36e34eb7-ee20-3644-4383-1c3f72279fc3@gmail.com> <DBBPR08MB59154C935195F0ADEFD0EC4BFA049@DBBPR08MB5915.eurprd08.prod.outlook.com> <SJ0PR00MB10051A6A8F8D3C9F87896899F5049@SJ0PR00MB1005.namprd00.prod.outlook.com> <f4dd91ee-b6e1-2dd4-abaa-21e75b3106b1@gmail.com> <9E9D10FB-54D6-499C-918B-DA6E7D9E1CF1@tzi.org> <634f9e86-499d-5510-c96c-493ff81f953c@gmail.com> <9D98038E-E44B-4B99-851A-A52CF12A7C89@island-resort.com>
From: Anders Rundgren <anders.rundgren.net@gmail.com>
In-Reply-To: <9D98038E-E44B-4B99-851A-A52CF12A7C89@island-resort.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Archived-At: <https://mailarchive.ietf.org/arch/msg/cose/2JtJzTODeG-7VrNNLGu4ej5epQs>
Subject: Re: [COSE] Newly Submitted Draft - CBOR Web Token (CWT) Claims in COSE Headers
X-BeenThere: cose@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: CBOR Object Signing and Encryption <cose.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/cose>, <mailto:cose-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/cose/>
List-Post: <mailto:cose@ietf.org>
List-Help: <mailto:cose-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/cose>, <mailto:cose-request@ietf.org?subject=subscribe>
X-List-Received-Date: Tue, 08 Mar 2022 17:50:19 -0000

On 2022-03-08 18:07, Laurence Lundblade wrote:

Hi Laurence,
This is just a PoC with the aim showing that the scheme I'm advocating is simple.
I'm sure CBOR tool designers can implement something fitting (if they feel a need).

In my Java implementation, the read-and-delete operation requires TWO lines of code.  That is some 1000-5000 times times less than a full-blown XML transform.

This is another, related topic:
https://github.com/cyberphone/D-CBOR/blob/main/d-cbor-4-constrained-devices.md#handling-indefinite-length-data

Cheers,
Anders

> 
>> On Mar 7, 2022, at 9:23 PM, Anders Rundgren <anders.rundgren.net@gmail.com <mailto:anders.rundgren.net@gmail.com>> wrote:
>>
>> On 2022-03-04 8:08, Carsten Bormann wrote:
>>> On 2022-03-04, at 07:54, Anders Rundgren <anders.rundgren.net@gmail.com <mailto:anders.rundgren.net@gmail.com>> wrote:
>>>>
>>>> - Collect key and algorithm data from the authorization signature object.
>>>> - Save and Remove FIDO "authenticatorData" and FIDO "signature" from the CBOR container.
>>> This is what we called the “transform” in the beloved XMLDSig.
>>> The complexities of this step can be the basis of interesting vulnerabilities (or interoperability failures).
>>
>> Since I had not worked with low-level encoders and decoders, I spent a couple of days in the lab (kitchen actually).
>>
>> To not be dependent on my own stuff (which of course works flawlessly since it was from the beginning designed with FIDO in mind), I applied the more universal CSF (CBOR Signature Format) to Laurence's excellent QCBOR library.  This is what I came up with:
>> https://github.com/cyberphone/D-CBOR/blob/main/verify-demo/csf-verifier.c <https://github.com/cyberphone/D-CBOR/blob/main/verify-demo/csf-verifier.c>
> 
> Your code accesses private QCBOR data structures to make this work, but no fear because 1) this part of QCBOR is not going to change and 2) I’m working on a PR to allow access to encoded maps and arrays <https://github.com/laurencelundblade/QCBOR/pull/117>. (I’m  bit bogged down on QCBOR PRs these days)
> 
>> The actual transform part is performed by FOUR LINES of C.  This was a surprise even to me.
>>
>> Carsten, you should be proud; CBOR is the by far best data interchange format for blending with cool cryptographic constructs!
>>
>> Could wrapping your precious data in bstr just in order to sign it, be headed for obsolescence? :)
> 
> I suspect not because decoders in other languages won’t be so easy to modify for this.
> 
> LL