[COSE] Re: [EXT] Re: RFC 9052 clarification on recipient ciphertext

"Sipos, Brian J." <Brian.Sipos@jhuapl.edu> Tue, 14 July 2026 12:46 UTC

Return-Path: <Brian.Sipos@jhuapl.edu>
X-Original-To: cose@mail2.ietf.org
Delivered-To: cose@mail2.ietf.org
Received: from localhost (localhost [127.0.0.1]) by mail2.ietf.org (Postfix) with ESMTP id 5C49D1167CF64 for <cose@mail2.ietf.org>; Tue, 14 Jul 2026 05:46:59 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ietf.org; s=ietf1; t=1784033219; bh=mj6O4PrxGs5W3zsbEkGUfWreZ4KmhjqxUUklYAwng2Q=; h=From:To:CC:Subject:Date:References:In-Reply-To; b=PemmkSs90fghnQNqT0b5KXL/V4JUYTE5B12pk7e9kzbpeNwIBFHeouVhwJEUQMl9q 7i8oqfayTeHoHhcpPMAbCchFwWYoVMkcKqPVlzPZtM/vdani+t6y5ulAnxGUB0LSgB s90E8xkkW3khlzgAeWj54GXQ+SDeYdOlv6xL8v0Y=
X-Virus-Scanned: amavisd-new at ietf.org
X-Spam-Flag: NO
X-Spam-Score: -2.096
X-Spam-Level:
X-Spam-Status: No, score=-2.096 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_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_NONE=0.001] autolearn=ham autolearn_force=no
Authentication-Results: mail2.ietf.org (amavisd-new); dkim=pass (2048-bit key) header.d=jhuapl.edu
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 g8XGtDsWhw0V for <cose@mail2.ietf.org>; Tue, 14 Jul 2026 05:46:58 -0700 (PDT)
Received: from aplegw03.jhuapl.edu (aplegw03.jhuapl.edu [128.244.208.131]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail2.ietf.org (Postfix) with ESMTPS id 48B6B1167CF57 for <cose@ietf.org>; Tue, 14 Jul 2026 05:46:56 -0700 (PDT)
Received: from pps.filterd (aplegw03.jhuapl.edu [127.0.0.1]) by aplegw03.jhuapl.edu (8.18.1.7/8.18.1.7) with ESMTP id 66EChbp4177614; Tue, 14 Jul 2026 08:46:50 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jhuapl.edu; h=cc :content-type:date:from:in-reply-to:message-id:mime-version :references:subject:to; s=JHUAPL2024; bh=57VurJT7KV/Yx+O/bleLGz5 uWNzuZbWsX7Td379UVto=; b=oNaz0kT11Spy1fopRGnPXuiTkn9x81qQC7kfRvB +gGLgP/pwaK1fBgR0AbE4AMVMagAeFYmgBXq5gPmy392o5T+T06RTGP3syUkFTbn 2wZiLrYxwOLV/qw79EokWyoJZKQv9Wni0gD7jtXFhADrEnQEDp21bZTyEg90jy53 qUGTIEKl7c/X5v8ZjkN55OfApEGwebl6tQVkoyT7cQw43IZJtrBUD/pciTeLgpkP 95+Wa/6MsPVtNJBpgDapyOettDAu/cOHHGimhTJP4/mCYH95GH0cl99KVGp9In6O mcLIVYXuiyrV5OdHC/yxVvkN1V8V/TrQa+OAG0tPKwhQmKw==
Received: from aplex31.dom1.jhuapl.edu (aplex31.dom1.jhuapl.edu [10.114.162.3]) by aplegw03.jhuapl.edu (PPS) with ESMTPS id 4fc40a3eba-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 14 Jul 2026 08:46:49 -0400 (EDT)
Received: from aplex39.dom1.jhuapl.edu (10.114.162.26) by aplex31.dom1.jhuapl.edu (10.114.162.3) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.43; Tue, 14 Jul 2026 08:46:49 -0400
Received: from aplex39.dom1.jhuapl.edu ([fe80::45d4:6ccc:c2ee:2a03]) by aplex39.dom1.jhuapl.edu ([fe80::45d4:6ccc:c2ee:2a03%9]) with mapi id 15.02.2562.043; Tue, 14 Jul 2026 08:46:49 -0400
From: "Sipos, Brian J." <Brian.Sipos@jhuapl.edu>
To: Laurence Lundblade <lgl@island-resort.com>
Thread-Topic: [EXT] Re: [COSE] RFC 9052 clarification on recipient ciphertext
Thread-Index: Ad0O8dh1DhV7F8MpTQynZFD5ZtAWYgEcZf4AAAqVvYA=
Date: Tue, 14 Jul 2026 12:46:49 +0000
Message-ID: <69ea5b85a0df4be1a81f844575e07973@jhuapl.edu>
References: <a5fd1abd2be04ee5a48c171a2d3ffd9a@jhuapl.edu> <4537E15A-85EC-4F00-84AE-3DB8C4BE2F8B@island-resort.com>
In-Reply-To: <4537E15A-85EC-4F00-84AE-3DB8C4BE2F8B@island-resort.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: yes
X-MS-TNEF-Correlator:
x-originating-ip: [10.114.162.19]
Content-Type: multipart/signed; protocol="application/x-pkcs7-signature"; micalg="SHA1"; boundary="----=_NextPart_000_027A_01DD136D.4CAE7E90"
MIME-Version: 1.0
X-CrossPremisesHeadersFilteredBySendConnector: aplex31.dom1.jhuapl.edu
X-OrganizationHeadersPreserved: aplex31.dom1.jhuapl.edu
X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-07-14_03,2026-07-10_01,2025-10-01_01
Message-ID-Hash: VY6HEQJZG6Z6FQAC2MQZWB2F3ME6N2SY
X-Message-ID-Hash: VY6HEQJZG6Z6FQAC2MQZWB2F3ME6N2SY
X-MailFrom: Brian.Sipos@jhuapl.edu
X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-cose.ietf.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header
CC: "cose@ietf.org" <cose@ietf.org>
X-Mailman-Version: 3.3.9rc6
Precedence: list
Subject: [COSE] Re: [EXT] Re: RFC 9052 clarification on recipient ciphertext
List-Id: CBOR Object Signing and Encryption <cose.ietf.org>
Archived-At: <https://mailarchive.ietf.org/arch/msg/cose/X4cvsjqpWpL47O2H_H52IOPg9d0>
List-Archive: <https://mailarchive.ietf.org/arch/browse/cose>
List-Help: <mailto:cose-request@ietf.org?subject=help>
List-Owner: <mailto:cose-owner@ietf.org>
List-Post: <mailto:cose@ietf.org>
List-Subscribe: <mailto:cose-join@ietf.org>
List-Unsubscribe: <mailto:cose-leave@ietf.org>

Laurence,

The root of the problem is the question “is the decoder-processor supposed to treat null value any differently?”

 

If the intent is that this field is a “do not care” that the algorithm never sees and doesn’t use, then there is a cascade effect:

1.	There is no functional difference between null and empty bstr for verification (or in fact any bstr at all)
2.	The decoder can handle both of these values the same way internally (e.g. decode both to an empty byte string)
3.	The choice of which encoding to use is arbitrary because the value itself is “do not care”
4.	The encoder can choose one preferred value (e.g. always treat as byte string, never output null value)

As far as I can tell, it seems like the answer is: no, the field is “do not care” from the algorithm perspective and the errata is to add a statement that the null value is purely aesthetic and in fact any value MAY be present when the recipient ciphertext is not needed by the algorithm.

 

Brian S.

 

From: Laurence Lundblade <lgl@island-resort.com> 
Sent: Monday, July 13, 2026 11:36 PM
To: Sipos, Brian J. <Brian.Sipos@jhuapl.edu>
Cc: cose@ietf.org
Subject: [EXT] Re: [COSE] RFC 9052 clarification on recipient ciphertext

 


APL external email warning: Verify sender lgl@island-resort.com <mailto:lgl@island-resort.com>  before clicking links or attachments

 

This text in 5.1 would seem to require nil:

 

ciphertext:

This field contains the encrypted key, encoded as a bstr. All encoded keys are symmetric keys; the binary value of the key is the content. If there is not an encrypted key, then this field is encoded as a nil value.

 

But examples C.3.1 and C.3.2, which don’t have an encrypted key, show:

 

        / ciphertext / h''

 

Probably if we look at Jim Schaad’s code that generated the examples we’ll find h’’. 

 

This is the problem, right? Seems like a problem to me.

 

LL

 





On Jul 8, 2026, at 8:53 AM, Sipos, Brian J. <Brian.Sipos@jhuapl.edu <mailto:Brian.Sipos@jhuapl.edu> > wrote:

 

COSE WG,

Within the COSE_Sign/COSE_Sign1 messages the “payload” is optionally nil-valued and within COSE_Encrypt/COSE_Encrypt0 messages the “ciphertext” is optionally nil-valued, in both cases these nil values convey that the payload or ciphertext is “detached” and held elsewhere.

 

There is a similar type union for COSE_recipient structure “ciphertext” field, but less explanation about the semantics or uses of the nil value here. All of the examples in RFC 9052 make use of empty-bstr recipient ciphertext when the algorithm doesn’t make use of one, search for “/ ciphertext / h''” to see these examples. This seems a little backward to me (the KDF-based recipient algs do not have ciphertext) but these already exist.

 

So for the question of the semantics of this recipient field:

1.	Is there a meaningful distinction between empty-bstr and nil value?
2.	Is there a reason why a generator-encoder would use one over the other?
3.	Should a decoder-processor treat them differently?
4.	Is it okay for a general purpose codec to treat them as equivalent and normalize to one form?

 

Finally, it seems like this deserves some errata discussion for Section 5.1. I can write one if there is some consensus about what the “right” answers are.

 

Thoughts on this are welcome,

Brian S.

_______________________________________________
COSE mailing list --  <mailto:cose@ietf.org> cose@ietf.org
To unsubscribe send an email to  <mailto:cose-leave@ietf.org> cose-leave@ietf.org