The following errata report has been submitted for RFC9921,
"CBOR Object Signing and Encryption (COSE) Header Parameter for Timestamp 
Tokens as Defined in RFC 3161"

--------------------------------------
You may review the report below and at:
https://errata.rfc-editor.org/eid9177/

--------------------------------------
Type: Technical
Reported by: Florent Morselli <[email protected]>

Section A.2 says:

Original Text
-------------
the CBOR-encoded signature field is hashed using SHA-256 to create
   the following TimeStampReq object

   SEQUENCE {
     INTEGER 1
     SEQUENCE {
       SEQUENCE {
         OBJECT IDENTIFIER sha-256 (2 16 840 1 101 3 4 2 1)
         NULL
         }
       OCTET STRING
         DD 94 71 EF E7 43 C4 05 13 35 DF 8F 6D 28 82 F3
         BA DC 38 77 00 F7 ED 3F 70 91 67 2A 3E EA F7 C8
       }
     BOOLEAN TRUE
     }

Corrected Text
--------------
the CBOR-encoded signature field is hashed using SHA-256 to create
   the following TimeStampReq object

   SEQUENCE {
     INTEGER 1
     SEQUENCE {
       SEQUENCE {
         OBJECT IDENTIFIER sha-256 (2 16 840 1 101 3 4 2 1)
         NULL
         }
       OCTET STRING
         44 C2 41 9D 13 1D 53 D5 55 84 B5 DD 33 B7 88 C2
         4E 55 1C 6D 44 B1 AF C8 B2 B8 5E 69 54 76 3B 4E
       }
     BOOLEAN TRUE
     }

   The TimeStampToken shown in the TSTInfo excerpt that follows, and
   embedded in the final COSE_Sign1 under label 270, must be re-obtained
   from the TSA for this MessageImprint; its
   TSTInfo.messageImprint.hashedMessage must then read
   44 C2 41 9D ... 54 76 3B 4E as well.

Notes
-----
The MessageImprint of the TimeStampReq and of the committed TimeStampToken in
Appendix A.2 is DD9471EF...3EEAF7C8. Section 3.1.1 computes the CTT imprint of
the very same COSE_Sign1 (RFC 9052 Appendix C.2.1, signature 8eb33e4c...cacb36)
as SHA-256 over the CBOR-encoded signature field, 0x5840 followed by the 64
signature bytes, and prints 44C2419D...54763B4E. That value is correct and can
be reproduced with any SHA-256 implementation; the value in Appendix A.2
cannot. As a result, the token of Appendix A.2 does not satisfy the mandatory
check of Section 4 ("the receiver MUST make sure that the MessageImprint in the
embedded timestamp token matches a hash of [...] the signature") for the message
it is embedded in, and an implementation that uses the appendix as a test
vector must reject it.

The cause is in the example generator of the draft's source repository
(https://github.com/ietf-scitt/draft-birkholz-cose-tsa-tst-header-parameter,
example/ctt/create-example.sh). The script extracts the signature from in.diag
with `awk '/signature/ {print $4}'` and pipes it through diag2cbor.rb to obtain
the bytes to hash. Commit 58407a7b (2025-05-12, "apply line folding on
synthesis") folded in.diag at 69 columns, so the signature literal spans three
lines and awk returns only the first,
h'8eb33e4ca31d1c465ab05aac34cc6b23d58fef5c083106c4d
an unterminated literal. diag2cbor.rb (cbor-diag 0.11.8) rejects it and prints
a parse error; `set -o pipefail` does not propagate into the <(...) process
substitution, so `openssl ts -query -data` hashed the error message when
commit 086f7f79 (2025-08-29, "update CTT examples") regenerated the token.
SHA-256 of that error text, verbatim (two lines, each terminated by a newline,
200 bytes in total):

*** can't parse h'8eb33e4ca31d1c465ab05aac34cc6b23d58fef5c083106c4d
*** Expected one of [ \t\n\r], "/", [0-9a-fA-F], [^\\'\t], "\\", "\\u", "'" at 
line 2, column 1 (byte 53) after 
h'8eb33e4ca31d1c465ab05aac34cc6b23d58fef5c083106c4d

is exactly DD9471EFE743C4051335DF8F6D2882F3BADC387700F7ED3F7091672A3EEAF7C8.
(The backslash sequences on the second line are literal characters of the
grammar diag2cbor.rb prints, not escapes.) The token of the previous revision
of the example (repository state before 086f7f79) carried the correct
44C2419D... imprint. Appendix A.1 is generated by a script that hashes a
literal string and is not affected: its imprint 09E638D4... is
SHA-256("This is the content.") as Section 3.2 requires.

The normative text of Section 3.1 and the worked computation of Section 3.1.1
are consistent with each other; only the appendix needs correction. Since the
token is signed by the TSA (freetsa.org), the corrected appendix requires a
newly issued token over the 44C2419D... imprint rather than an edit of the
existing bytes.

Instructions:
-------------
This erratum is currently posted as "Reported". Please
use "Reply All" to discuss whether it should be verified or
rejected. When a decision is reached, the verifying party  
will log in to change the status and edit the report, if necessary.

--------------------------------------
RFC9921 (draft-ietf-cose-tsa-tst-header-parameter)
--------------------------------------
Title               : CBOR Object Signing and Encryption (COSE) Header 
Parameter for Timestamp Tokens as Defined in RFC 3161
Publication Date    : February 2026
Author(s)           : H. Birkholz, T. Fossati, M. Riechert
Category            : Proposed Standard
Source              : cose (sec)
Stream              : IETF
Verifying Party     : IESG
_______________________________________________
COSE mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to