{"id":380,"date":"2026-09-05T06:53:31","date_gmt":"2026-09-05T06:53:31","guid":{"rendered":"https:\/\/neodata.com.uy\/labs\/a-cose-sign1-object-is-not-its-signing-input\/"},"modified":"2026-09-07T13:51:03","modified_gmt":"2026-09-07T13:51:03","slug":"a-cose-sign1-object-is-not-its-signing-input","status":"publish","type":"post","link":"https:\/\/neodata.com.uy\/labs\/a-cose-sign1-object-is-not-its-signing-input\/","title":{"rendered":"A COSE_Sign1 object is not its signing input."},"content":{"rendered":"<p><!--\nWORDPRESS CONTENT: NEODATA Labs Marginalia\n--><\/p>\n<p class=\"nlabs-kicker\">MARGINALIA &middot; ANATOMY OF AN OBJECT<\/p>\n<h2 id=\"four-transmitted-fields-become-a-different-structure\">Four transmitted fields become a different structure before verification.<\/h2>\n<p>An expanded view of a <code>COSE_Sign1<\/code> object contains:<\/p>\n<pre><code>COSE_Sign1 = [\n  protected,\n  unprotected,\n  payload,\n  signature\n]<\/code><\/pre>\n<p>Those four fields are transported. They are not the byte sequence given directly to the signature algorithm. The verifier reconstructs a second CBOR structure:<\/p>\n<pre><code>Sig_structure = [\n  \"Signature1\",\n  protected,\n  external_aad,\n  payload\n]<\/code><\/pre>\n<p>The protected header is included as its serialized byte string. The unprotected header is not included. External additional authenticated data is supplied by the application and may not appear in the transmitted object at all. If the payload is detached, the verifier must obtain the exact original bytes elsewhere.<\/p>\n<p>This boundary explains several implementation failures. An algorithm placed only in an unprotected field is not bound by the signature. A key identifier can help locate a candidate key but does not prove that the key is acceptable. A different external context or payload representation produces a different signing input.<\/p>\n<p>To debug a failed or surprising verification, inspect both objects: the structure received and the exact <code>Sig_structure<\/code> reconstructed from it.<\/p>\n<p class=\"nlabs-source\">Source: <a href=\"https:\/\/www.rfc-editor.org\/rfc\/rfc9052.html#section-4.2\">RFC 9052, Section 4.2<\/a> and <a href=\"https:\/\/www.rfc-editor.org\/rfc\/rfc9052.html#section-4.4\">Section 4.4<\/a>.<\/p>\n<p>Related research: <a href=\"https:\/\/neodata.com.uy\/labs\/the-transcript-is-the-protocol\/\">The transcript is the protocol.<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Four transmitted fields become a different CBOR structure before signature verification.<\/p>\n","protected":false},"author":2,"featured_media":404,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[35],"tags":[24],"nlabs_article_type":[],"class_list":["post-380","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-marginalia","tag-marginalia"],"_links":{"self":[{"href":"https:\/\/neodata.com.uy\/labs\/wp-json\/wp\/v2\/posts\/380","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/neodata.com.uy\/labs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/neodata.com.uy\/labs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/neodata.com.uy\/labs\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/neodata.com.uy\/labs\/wp-json\/wp\/v2\/comments?post=380"}],"version-history":[{"count":1,"href":"https:\/\/neodata.com.uy\/labs\/wp-json\/wp\/v2\/posts\/380\/revisions"}],"predecessor-version":[{"id":405,"href":"https:\/\/neodata.com.uy\/labs\/wp-json\/wp\/v2\/posts\/380\/revisions\/405"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/neodata.com.uy\/labs\/wp-json\/wp\/v2\/media\/404"}],"wp:attachment":[{"href":"https:\/\/neodata.com.uy\/labs\/wp-json\/wp\/v2\/media?parent=380"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/neodata.com.uy\/labs\/wp-json\/wp\/v2\/categories?post=380"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/neodata.com.uy\/labs\/wp-json\/wp\/v2\/tags?post=380"},{"taxonomy":"nlabs_article_type","embeddable":true,"href":"https:\/\/neodata.com.uy\/labs\/wp-json\/wp\/v2\/nlabs_article_type?post=380"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}