[SPICE] Re: is bstr encoding of the disclosure array really necessary?

Orie Steele <orie@transmute.industries> Fri, 28 February 2025 14:54 UTC

Return-Path: <orie@transmute.industries>
X-Original-To: spice@mail2.ietf.org
Delivered-To: spice@mail2.ietf.org
Received: from localhost (localhost [127.0.0.1]) by mail2.ietf.org (Postfix) with ESMTP id 620FA3BFE2D for <spice@mail2.ietf.org>; Fri, 28 Feb 2025 06:54:12 -0800 (PST)
X-Virus-Scanned: amavisd-new at ietf.org
X-Spam-Flag: NO
X-Spam-Score: -2.099
X-Spam-Level:
X-Spam-Status: No, score=-2.099 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, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Authentication-Results: mail2.ietf.org (amavisd-new); dkim=pass (2048-bit key) header.d=transmute.industries
Received: from mail2.ietf.org ([166.84.6.31]) by localhost (mail2.ietf.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Axiu8QEMKYF8 for <spice@mail2.ietf.org>; Fri, 28 Feb 2025 06:54:11 -0800 (PST)
Received: from mail-pj1-x1031.google.com (mail-pj1-x1031.google.com [IPv6:2607:f8b0:4864:20::1031]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (P-256) server-digest SHA256) (No client certificate requested) by mail2.ietf.org (Postfix) with ESMTPS id 55E7C3BFE13 for <spice@ietf.org>; Fri, 28 Feb 2025 06:54:11 -0800 (PST)
Received: by mail-pj1-x1031.google.com with SMTP id 98e67ed59e1d1-2fe82414cf7so4342747a91.0 for <spice@ietf.org>; Fri, 28 Feb 2025 06:54:11 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=transmute.industries; s=google; t=1740754450; x=1741359250; darn=ietf.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=9dhApnnfhslBwwMBtanr/9MiaMbdt1Gkr0ejzRHPYFU=; b=P5pJyHgvCkLimcxfnTwURExyFDiVihWXEo19vkwJ9NSmGhoDHaOLr8edc/Xfdw3TAv f3RpTh21nKgpK+l05dN7cZt+oBtbZb38uUFncFvsYzafGThJNYVMwipKGoO7dBnAlvWy Sl0zqZ8VsajBInz3MEVHAz93MmyrljFxELxeHPZgul9TfmSriNuR4uaokHY4SmNcD3VX PkP2yn61CuJTIZsUQr8Ie2wyKlQskidaKkQqAxGn78aGpcZ3E2TPeZ6rpY4QVNv/A4Qt wjwQ7LSGHEscpNGZcLLfcilEU++gvj57MkQyqta/Y0FAsm1MLVk4KG1TIPa2wt0qR+OV E+BQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1740754450; x=1741359250; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=9dhApnnfhslBwwMBtanr/9MiaMbdt1Gkr0ejzRHPYFU=; b=Ck8qb7/nbpEkK7NdzWvIpVDhL2T4lNyX70wUG0EEOiMDscFYuQqfZy+0jDRrpw2iom faxbmYOwY+0GAVieRMTbjvGRGsQ8pB7w+OW8RdlAe3YZJ7Aa/9Kv3h9+g38DWRbJXFKc kumdNhKq5xkp/Ou+QJNPzO1xQjq2eaZhLoIU5DuAbQZfXIFERrr61b33NJFgaz7Gpp2A b1pe6KTKVjqOtRqU3cwYsgfCm/hKd12c2da5vzEUwqzaOi13K/JIfJHfrijzHE8v80ld xJuwL7prgoPPLX6Kt6UkfnkoW46dNuRSpxo2G80WJJKa9Uf5MVEtRknTCjPMrowfmGvh HJDA==
X-Forwarded-Encrypted: i=1; AJvYcCXjjWt1G+duD6HX/4vnSj8+DC0XISSEUc61+BkPqrMFShLnRHZD4sMQVru7i0Oy1ae8j9SjrA==@ietf.org
X-Gm-Message-State: AOJu0Yxib3Y9wLvfbp2EIYS04D48OO7VQAhKcU418Ba3D++Wl/2545EA mmV6lXlM6OKdsNg12EfsCzJ0fC14CjKQ0len2WbEbNNrWJCjg7LcrNbABX22ts+HTPSANVdiGV7 zHppFgsOxkTugxJ31jJQzg8C5ltQ5QAcPLGrChw==
X-Gm-Gg: ASbGncutRp8hfgprCzIBTU9RYfd4bGLHsMc0s99kbfeBLCwmOkn0+nS451GAB20xQxv 7K4LH9CQXqOUMdu8f14p0j8XQO3UboclcO1SWOkKtKXDmnid7tAORTylJnDk6kkQR7xNGDSJw05 sJozYb7dQJD0g1e56QzuIoCijjH1CD/vXrF2/ELNx13g==
X-Google-Smtp-Source: AGHT+IG9feE3UIUS8OgDZ9vdoBxKR05v1vrUXgL+U8JV8BKAXa8E8Q2cXNrFbNa3ZIc2Ty3QLIFESIjL3S64IIyx3Vw=
X-Received: by 2002:a17:90b:4b:b0:2fe:a515:4a98 with SMTP id 98e67ed59e1d1-2febac05a46mr5499858a91.31.1740754450479; Fri, 28 Feb 2025 06:54:10 -0800 (PST)
MIME-Version: 1.0
References: <CAKoiRubgcicR729Mj6SCFUrcB9K8hrZtTNgZuee1Yf5vocRn-Q@mail.gmail.com> <97CF3E02-2491-4777-B4E1-AD34C6E45C5F@tzi.org> <CAN8C-_L_d2ihi1fMiVuuyLzpXnsSJM+w7XpA1nkYSJz5k2bDZQ@mail.gmail.com> <DF87868F-1BCB-4FE9-B844-F5CE535A1923@tzi.org> <CAKoiRuYugUEZMJ0f=rTdDwgrQNG5aryRubvc=7EMe9j-hUbk_g@mail.gmail.com>
In-Reply-To: <CAKoiRuYugUEZMJ0f=rTdDwgrQNG5aryRubvc=7EMe9j-hUbk_g@mail.gmail.com>
From: Orie Steele <orie@transmute.industries>
Date: Fri, 28 Feb 2025 08:53:59 -0600
X-Gm-Features: AQ5f1JpZUYPRFHSiTiFCpeaZ90b9WFT0-O73Mov_JGDC2NS28YvN-R96q1Das3Q
Message-ID: <CAN8C-_KGD1Zbts1QzM-aZiKgWPquvjKW_frqc==yxk9Awrys9g@mail.gmail.com>
To: Rohan Mahy <rohan.mahy@gmail.com>
Content-Type: multipart/alternative; boundary="000000000000a99ac9062f34fa6b"
Message-ID-Hash: TTINJ3UE44JXYZAQ6KBBJCSVDZEAGFNY
X-Message-ID-Hash: TTINJ3UE44JXYZAQ6KBBJCSVDZEAGFNY
X-MailFrom: orie@transmute.industries
X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header
CC: Carsten Bormann <cabo@tzi.org>, Rohan Mahy <rohan.ietf@gmail.com>, spice@ietf.org
X-Mailman-Version: 3.3.9rc6
Precedence: list
Subject: [SPICE] Re: is bstr encoding of the disclosure array really necessary?
List-Id: Secure Patterns for Internet CrEdentials <spice.ietf.org>
Archived-At: <https://mailarchive.ietf.org/arch/msg/spice/5A-dZ1b3fjHfmvDGm6Kz9rwcF3A>
List-Archive: <https://mailarchive.ietf.org/arch/browse/spice>
List-Help: <mailto:spice-request@ietf.org?subject=help>
List-Owner: <mailto:spice-owner@ietf.org>
List-Post: <mailto:spice@ietf.org>
List-Subscribe: <mailto:spice-join@ietf.org>
List-Unsubscribe: <mailto:spice-leave@ietf.org>

To make my position clear.

I think we should keep the bstr encoding.

and we should warn that "value" is "any" and is not encoded with CDE.

OS

On Fri, Feb 28, 2025 at 8:19 AM Rohan Mahy <rohan.mahy@gmail.com> wrote:

> Hi All,
> Personally I find this last point of Carsten's the most compelling:
> "one would not [expect] that byte string [(a disclosure)] to be decoded on
> ingestion and re-encoded for verification."
>
> The issuer and the holder need to have the same view of the bytes that are
> in the disclosure. The bstr encoding ensures that, even if there could be
> different ways to encode its contents (especially for example, encoding the
> value in a complicated nested disclosure).
>
> Unless there is a strong argument in favor of removing the bstr encoding,
> I am inclined to close the current issue and PR and leave the bstr encoding
> as it is in the editor's copy.
> Thanks,
> -rohan
>
>
> On Fri, Feb 28, 2025 at 6:00 AM Carsten Bormann <cabo@tzi.org> wrote:
>
>> On 28. Feb 2025, at 14:27, Orie Steele <orie@transmute.industries> wrote:
>> >
>> > Postels law applies here I think.
>>
>> (I’m not going to start an RFC 9413 discussion, but:)
>>
>> > The issuer and holder should be strict (use CDE, or a content type for
>> an even stricter application layer variant).
>>
>> Using CDE would be “strict” only if the document was actually requiring
>> CDE.
>> It does not, as it tries to fit into the design space that COSE was
>> developed for.
>> So the protocol should simply be retaining the exact encoding used by the
>> signer to build the hash.
>>
>> Note that content type definitions are not at all required (or even
>> expected) to be deterministic.
>> However, there might be a stronger understanding that the byte string
>> included is the actual value being signed, as further annotated by the
>> content type, so one would not except that byte string to be decoded on
>> ingestion and re-encoded for verification.
>>
>> Grüße, Carsten
>>
>>