<?xml version='1.0' encoding='utf-8'?>
<rfc xmlns:xi="http://www.w3.org/2001/XInclude" version="3" ipr="trust200902" docName="draft-ietf-core-oscore-groupcomm-28" category="std" consensus="true" submissionType="IETF" xml:lang="en" number="10021" tocInclude="true" sortRefs="true" symRefs="true" prepTime="2026-11-19T17:36:01" indexInclude="true" scripts="Common,Latin" tocDepth="3">
  <link href="https://dx.doi.org/10.17487/rfc10021" rel="alternate"/>
  <link href="urn:issn:2070-1721" rel="alternate"/>
  <link href="https://datatracker.ietf.org/doc/draft-ietf-core-oscore-groupcomm-latest" rel="prev"/>
  <front>
    <title abbrev="Group OSCORE">Group Object Security for Constrained RESTful Environments (Group OSCORE)</title>
    <seriesInfo name="RFC" value="10021" stream="IETF"/>
    <author initials="M." surname="Tiloca" fullname="Marco Tiloca">
      <organization showOnFrontPage="true">RISE AB</organization>
      <address>
        <postal>
          <street>Isafjordsgatan 22</street>
          <city>Kista</city>
          <code>164 40</code>
          <country>Sweden</country>
        </postal>
        <email>marco.tiloca@ri.se</email>
      </address>
    </author>
    <author initials="G." surname="Selander" fullname="Göran Selander">
      <organization showOnFrontPage="true">Ericsson AB</organization>
      <address>
        <postal>
          <street>Torshamnsgatan 23</street>
          <city>Kista</city>
          <code>16440 Stockholm</code>
          <country>Sweden</country>
        </postal>
        <email>goran.selander@ericsson.com</email>
      </address>
    </author>
    <author initials="F." surname="Palombini" fullname="Francesca Palombini">
      <organization showOnFrontPage="true">Ericsson AB</organization>
      <address>
        <postal>
          <street>Torshamnsgatan 23</street>
          <city>Kista</city>
          <code>16440 Stockholm</code>
          <country>Sweden</country>
        </postal>
        <email>francesca.palombini@ericsson.com</email>
      </address>
    </author>
    <author initials="J." surname="Preuß Mattsson" fullname="John Preuß Mattsson">
      <organization showOnFrontPage="true">Ericsson AB</organization>
      <address>
        <postal>
          <street>Torshamnsgatan 23</street>
          <city>Kista</city>
          <code>16440 Stockholm</code>
          <country>Sweden</country>
        </postal>
        <email>john.mattsson@ericsson.com</email>
      </address>
    </author>
    <author initials="R." surname="Höglund" fullname="Rikard Höglund">
      <organization showOnFrontPage="true">RISE AB</organization>
      <address>
        <postal>
          <street>Isafjordsgatan 22</street>
          <city>Kista</city>
          <code>16440 Stockholm</code>
          <country>Sweden</country>
        </postal>
        <email>rikard.hoglund@ri.se</email>
      </address>
    </author>
    <date month="11" year="2026"/>
    <area>WIT</area>
    <workgroup>core</workgroup>
    <keyword>Secure group communication</keyword>
    <keyword>End-to-end security</keyword>
    <keyword>IoT security</keyword>
    <keyword>CoAP</keyword>
    <keyword>Multicast</keyword>
    <keyword>Constrained environments</keyword>
    <abstract pn="section-abstract">
      <t indent="0" pn="section-abstract-1">This document defines the security protocol Group Object Security for Constrained RESTful Environments (Group OSCORE), providing end-to-end security of messages exchanged with the Constrained Application Protocol (CoAP) between members of a group, e.g., sent over IP multicast. In particular, Group OSCORE provides protection and source authentication for group requests sent from a client to multiple servers and for the corresponding responses. Group OSCORE also defines a pairwise mode where each member of the group can efficiently derive symmetric pairwise keys to use with another member of the group for pairwise-protected communication. Group OSCORE can be used between endpoints communicating with CoAP or CoAP-mappable HTTP.</t>
    </abstract>
    <boilerplate>
      <section anchor="status-of-memo" numbered="false" removeInRFC="false" toc="exclude" pn="section-boilerplate.1">
        <name slugifiedName="name-status-of-this-memo">Status of This Memo</name>
        <t indent="0" pn="section-boilerplate.1-1">
            This is an Internet Standards Track document.
        </t>
        <t indent="0" pn="section-boilerplate.1-2">
            This document is a product of the Internet Engineering Task Force
            (IETF).  It represents the consensus of the IETF community.  It has
            received public review and has been approved for publication by
            the Internet Engineering Steering Group (IESG).  Further
            information on Internet Standards is available in Section 2 of 
            RFC 7841.
        </t>
        <t indent="0" pn="section-boilerplate.1-3">
            Information about the current status of this document, any
            errata, and how to provide feedback on it may be obtained at
            <eref target="https://www.rfc-editor.org/info/rfc10021" brackets="none"/>.
        </t>
      </section>
      <section anchor="copyright" numbered="false" removeInRFC="false" toc="exclude" pn="section-boilerplate.2">
        <name slugifiedName="name-copyright-notice">Copyright Notice</name>
        <t indent="0" pn="section-boilerplate.2-1">
            Copyright (c) 2026 IETF Trust and the persons identified as the
            document authors. All rights reserved.
        </t>
        <t indent="0" pn="section-boilerplate.2-2">
            This document is subject to BCP 78 and the IETF Trust's Legal
            Provisions Relating to IETF Documents
            (<eref target="https://trustee.ietf.org/license-info" brackets="none"/>) in effect on the date of
            publication of this document. Please review these documents
            carefully, as they describe your rights and restrictions with
            respect to this document. Code Components extracted from this
            document must include Revised BSD License text as described in
            Section 4.e of the Trust Legal Provisions and are provided without
            warranty as described in the Revised BSD License.
        </t>
      </section>
    </boilerplate>
    <toc>
      <section anchor="toc" numbered="false" removeInRFC="false" toc="exclude" pn="section-toc.1">
        <name slugifiedName="name-table-of-contents">Table of Contents</name>
        <ul bare="true" empty="true" indent="2" spacing="compact" pn="section-toc.1-1">
          <li pn="section-toc.1-1.1">
            <t indent="0" keepWithNext="true" pn="section-toc.1-1.1.1"><xref derivedContent="1" format="counter" sectionFormat="of" target="section-1"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-introduction">Introduction</xref></t>
            <ul bare="true" empty="true" indent="2" spacing="compact" pn="section-toc.1-1.1.2">
              <li pn="section-toc.1-1.1.2.1">
                <t indent="0" keepWithNext="true" pn="section-toc.1-1.1.2.1.1"><xref derivedContent="1.1" format="counter" sectionFormat="of" target="section-1.1"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-terminology">Terminology</xref></t>
              </li>
            </ul>
          </li>
          <li pn="section-toc.1-1.2">
            <t indent="0" pn="section-toc.1-1.2.1"><xref derivedContent="2" format="counter" sectionFormat="of" target="section-2"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-security-context">Security Context</xref></t>
            <ul bare="true" empty="true" indent="2" spacing="compact" pn="section-toc.1-1.2.2">
              <li pn="section-toc.1-1.2.2.1">
                <t indent="0" pn="section-toc.1-1.2.2.1.1"><xref derivedContent="2.1" format="counter" sectionFormat="of" target="section-2.1"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-common-context">Common Context</xref></t>
                <ul bare="true" empty="true" indent="2" spacing="compact" pn="section-toc.1-1.2.2.1.2">
                  <li pn="section-toc.1-1.2.2.1.2.1">
                    <t indent="0" keepWithNext="true" pn="section-toc.1-1.2.2.1.2.1.1"><xref derivedContent="2.1.1" format="counter" sectionFormat="of" target="section-2.1.1"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-aead-algorithm">AEAD Algorithm</xref></t>
                  </li>
                  <li pn="section-toc.1-1.2.2.1.2.2">
                    <t indent="0" pn="section-toc.1-1.2.2.1.2.2.1"><xref derivedContent="2.1.2" format="counter" sectionFormat="of" target="section-2.1.2"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-hkdf-algorithm">HKDF Algorithm</xref></t>
                  </li>
                  <li pn="section-toc.1-1.2.2.1.2.3">
                    <t indent="0" pn="section-toc.1-1.2.2.1.2.3.1"><xref derivedContent="2.1.3" format="counter" sectionFormat="of" target="section-2.1.3"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-id-context">ID Context</xref></t>
                  </li>
                  <li pn="section-toc.1-1.2.2.1.2.4">
                    <t indent="0" pn="section-toc.1-1.2.2.1.2.4.1"><xref derivedContent="2.1.4" format="counter" sectionFormat="of" target="section-2.1.4"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-common-iv">Common IV</xref></t>
                  </li>
                  <li pn="section-toc.1-1.2.2.1.2.5">
                    <t indent="0" pn="section-toc.1-1.2.2.1.2.5.1"><xref derivedContent="2.1.5" format="counter" sectionFormat="of" target="section-2.1.5"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-authentication-credential-f">Authentication Credential Format</xref></t>
                  </li>
                  <li pn="section-toc.1-1.2.2.1.2.6">
                    <t indent="0" pn="section-toc.1-1.2.2.1.2.6.1"><xref derivedContent="2.1.6" format="counter" sectionFormat="of" target="section-2.1.6"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-group-manager-authenticatio">Group Manager Authentication Credential</xref></t>
                  </li>
                  <li pn="section-toc.1-1.2.2.1.2.7">
                    <t indent="0" pn="section-toc.1-1.2.2.1.2.7.1"><xref derivedContent="2.1.7" format="counter" sectionFormat="of" target="section-2.1.7"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-group-encryption-algorithm">Group Encryption Algorithm</xref></t>
                  </li>
                  <li pn="section-toc.1-1.2.2.1.2.8">
                    <t indent="0" pn="section-toc.1-1.2.2.1.2.8.1"><xref derivedContent="2.1.8" format="counter" sectionFormat="of" target="section-2.1.8"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-signature-algorithm">Signature Algorithm</xref></t>
                  </li>
                  <li pn="section-toc.1-1.2.2.1.2.9">
                    <t indent="0" pn="section-toc.1-1.2.2.1.2.9.1"><xref derivedContent="2.1.9" format="counter" sectionFormat="of" target="section-2.1.9"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-signature-encryption-key">Signature Encryption Key</xref></t>
                  </li>
                  <li pn="section-toc.1-1.2.2.1.2.10">
                    <t indent="0" pn="section-toc.1-1.2.2.1.2.10.1"><xref derivedContent="2.1.10" format="counter" sectionFormat="of" target="section-2.1.10"/>. <xref derivedContent="" format="title" sectionFormat="of" target="name-pairwise-key-agreement-algo">Pairwise Key Agreement Algorithm</xref></t>
                  </li>
                </ul>
              </li>
              <li pn="section-toc.1-1.2.2.2">
                <t indent="0" pn="section-toc.1-1.2.2.2.1"><xref derivedContent="2.2" format="counter" sectionFormat="of" target="section-2.2"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-sender-context-and-recipien">Sender Context and Recipient Context</xref></t>
              </li>
              <li pn="section-toc.1-1.2.2.3">
                <t indent="0" pn="section-toc.1-1.2.2.3.1"><xref derivedContent="2.3" format="counter" sectionFormat="of" target="section-2.3"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-establishment-of-security-c">Establishment of Security Context Parameters</xref></t>
              </li>
              <li pn="section-toc.1-1.2.2.4">
                <t indent="0" pn="section-toc.1-1.2.2.4.1"><xref derivedContent="2.4" format="counter" sectionFormat="of" target="section-2.4"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-authentication-credentials">Authentication Credentials</xref></t>
              </li>
              <li pn="section-toc.1-1.2.2.5">
                <t indent="0" pn="section-toc.1-1.2.2.5.1"><xref derivedContent="2.5" format="counter" sectionFormat="of" target="section-2.5"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-pairwise-keys">Pairwise Keys</xref></t>
                <ul bare="true" empty="true" indent="2" spacing="compact" pn="section-toc.1-1.2.2.5.2">
                  <li pn="section-toc.1-1.2.2.5.2.1">
                    <t indent="0" pn="section-toc.1-1.2.2.5.2.1.1"><xref derivedContent="2.5.1" format="counter" sectionFormat="of" target="section-2.5.1"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-derivation-of-pairwise-keys">Derivation of Pairwise Keys</xref></t>
                  </li>
                  <li pn="section-toc.1-1.2.2.5.2.2">
                    <t indent="0" pn="section-toc.1-1.2.2.5.2.2.1"><xref derivedContent="2.5.2" format="counter" sectionFormat="of" target="section-2.5.2"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-ecdh-with-montgomery-coordi">ECDH with Montgomery Coordinates</xref></t>
                  </li>
                  <li pn="section-toc.1-1.2.2.5.2.3">
                    <t indent="0" pn="section-toc.1-1.2.2.5.2.3.1"><xref derivedContent="2.5.3" format="counter" sectionFormat="of" target="section-2.5.3"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-usage-of-sequence-numbers">Usage of Sequence Numbers</xref></t>
                  </li>
                  <li pn="section-toc.1-1.2.2.5.2.4">
                    <t indent="0" pn="section-toc.1-1.2.2.5.2.4.1"><xref derivedContent="2.5.4" format="counter" sectionFormat="of" target="section-2.5.4"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-security-context-for-pairwi">Security Context for Pairwise Mode</xref></t>
                  </li>
                </ul>
              </li>
              <li pn="section-toc.1-1.2.2.6">
                <t indent="0" pn="section-toc.1-1.2.2.6.1"><xref derivedContent="2.6" format="counter" sectionFormat="of" target="section-2.6"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-update-of-security-context">Update of Security Context</xref></t>
                <ul bare="true" empty="true" indent="2" spacing="compact" pn="section-toc.1-1.2.2.6.2">
                  <li pn="section-toc.1-1.2.2.6.2.1">
                    <t indent="0" pn="section-toc.1-1.2.2.6.2.1.1"><xref derivedContent="2.6.1" format="counter" sectionFormat="of" target="section-2.6.1"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-loss-of-the-varying-part-of">Loss of the Varying Part of the Security Context</xref></t>
                  </li>
                  <li pn="section-toc.1-1.2.2.6.2.2">
                    <t indent="0" pn="section-toc.1-1.2.2.6.2.2.1"><xref derivedContent="2.6.2" format="counter" sectionFormat="of" target="section-2.6.2"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-exhaustion-of-sender-sequen">Exhaustion of Sender Sequence Number Space</xref></t>
                  </li>
                  <li pn="section-toc.1-1.2.2.6.2.3">
                    <t indent="0" pn="section-toc.1-1.2.2.6.2.3.1"><xref derivedContent="2.6.3" format="counter" sectionFormat="of" target="section-2.6.3"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-retrieving-new-security-con">Retrieving New Security Context Parameters</xref></t>
                  </li>
                </ul>
              </li>
            </ul>
          </li>
          <li pn="section-toc.1-1.3">
            <t indent="0" pn="section-toc.1-1.3.1"><xref derivedContent="3" format="counter" sectionFormat="of" target="section-3"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-the-cose-object">The COSE Object</xref></t>
            <ul bare="true" empty="true" indent="2" spacing="compact" pn="section-toc.1-1.3.2">
              <li pn="section-toc.1-1.3.2.1">
                <t indent="0" pn="section-toc.1-1.3.2.1.1"><xref derivedContent="3.1" format="counter" sectionFormat="of" target="section-3.1"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-countersignature">Countersignature</xref></t>
                <ul bare="true" empty="true" indent="2" spacing="compact" pn="section-toc.1-1.3.2.1.2">
                  <li pn="section-toc.1-1.3.2.1.2.1">
                    <t indent="0" pn="section-toc.1-1.3.2.1.2.1.1"><xref derivedContent="3.1.1" format="counter" sectionFormat="of" target="section-3.1.1"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-clarifications-on-using-a-c">Clarifications on Using a Countersignature</xref></t>
                  </li>
                </ul>
              </li>
              <li pn="section-toc.1-1.3.2.2">
                <t indent="0" pn="section-toc.1-1.3.2.2.1"><xref derivedContent="3.2" format="counter" sectionFormat="of" target="section-3.2"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-the-kid-and-kid-context-par">The 'kid' and 'kid context' Parameters</xref></t>
              </li>
              <li pn="section-toc.1-1.3.2.3">
                <t indent="0" pn="section-toc.1-1.3.2.3.1"><xref derivedContent="3.3" format="counter" sectionFormat="of" target="section-3.3"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-nonce-computation">Nonce Computation</xref></t>
              </li>
              <li pn="section-toc.1-1.3.2.4">
                <t indent="0" pn="section-toc.1-1.3.2.4.1"><xref derivedContent="3.4" format="counter" sectionFormat="of" target="section-3.4"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-additional-authenticated-da">Additional Authenticated Data</xref></t>
              </li>
            </ul>
          </li>
          <li pn="section-toc.1-1.4">
            <t indent="0" pn="section-toc.1-1.4.1"><xref derivedContent="4" format="counter" sectionFormat="of" target="section-4"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-oscore-header-compression">OSCORE Header Compression</xref></t>
            <ul bare="true" empty="true" indent="2" spacing="compact" pn="section-toc.1-1.4.2">
              <li pn="section-toc.1-1.4.2.1">
                <t indent="0" pn="section-toc.1-1.4.2.1.1"><xref derivedContent="4.1" format="counter" sectionFormat="of" target="section-4.1"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-encoding-of-the-oscore-opti">Encoding of the OSCORE Option Value and Group OSCORE Payload</xref></t>
              </li>
              <li pn="section-toc.1-1.4.2.2">
                <t indent="0" pn="section-toc.1-1.4.2.2.1"><xref derivedContent="4.2" format="counter" sectionFormat="of" target="section-4.2"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-keystream-derivation-for-co">Keystream Derivation for Countersignature Encryption/Decryption</xref></t>
              </li>
              <li pn="section-toc.1-1.4.2.3">
                <t indent="0" pn="section-toc.1-1.4.2.3.1"><xref derivedContent="4.3" format="counter" sectionFormat="of" target="section-4.3"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-examples-of-compressed-cose">Examples of Compressed COSE Objects</xref></t>
                <ul bare="true" empty="true" indent="2" spacing="compact" pn="section-toc.1-1.4.2.3.2">
                  <li pn="section-toc.1-1.4.2.3.2.1">
                    <t indent="0" pn="section-toc.1-1.4.2.3.2.1.1"><xref derivedContent="4.3.1" format="counter" sectionFormat="of" target="section-4.3.1"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-examples-in-group-mode">Examples in Group Mode</xref></t>
                  </li>
                  <li pn="section-toc.1-1.4.2.3.2.2">
                    <t indent="0" pn="section-toc.1-1.4.2.3.2.2.1"><xref derivedContent="4.3.2" format="counter" sectionFormat="of" target="section-4.3.2"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-examples-in-pairwise-mode">Examples in Pairwise Mode</xref></t>
                  </li>
                </ul>
              </li>
            </ul>
          </li>
          <li pn="section-toc.1-1.5">
            <t indent="0" pn="section-toc.1-1.5.1"><xref derivedContent="5" format="counter" sectionFormat="of" target="section-5"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-message-binding-sequence-nu">Message Binding, Sequence Numbers, Freshness, and Replay Protection</xref></t>
            <ul bare="true" empty="true" indent="2" spacing="compact" pn="section-toc.1-1.5.2">
              <li pn="section-toc.1-1.5.2.1">
                <t indent="0" pn="section-toc.1-1.5.2.1.1"><xref derivedContent="5.1" format="counter" sectionFormat="of" target="section-5.1"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-supporting-multiple-respons">Supporting Multiple Responses in Long Exchanges</xref></t>
              </li>
              <li pn="section-toc.1-1.5.2.2">
                <t indent="0" pn="section-toc.1-1.5.2.2.1"><xref derivedContent="5.2" format="counter" sectionFormat="of" target="section-5.2"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-freshness">Freshness</xref></t>
              </li>
              <li pn="section-toc.1-1.5.2.3">
                <t indent="0" pn="section-toc.1-1.5.2.3.1"><xref derivedContent="5.3" format="counter" sectionFormat="of" target="section-5.3"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-replay-protection">Replay Protection</xref></t>
                <ul bare="true" empty="true" indent="2" spacing="compact" pn="section-toc.1-1.5.2.3.2">
                  <li pn="section-toc.1-1.5.2.3.2.1">
                    <t indent="0" pn="section-toc.1-1.5.2.3.2.1.1"><xref derivedContent="5.3.1" format="counter" sectionFormat="of" target="section-5.3.1"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-replay-protection-of-respon">Replay Protection of Responses</xref></t>
                  </li>
                </ul>
              </li>
            </ul>
          </li>
          <li pn="section-toc.1-1.6">
            <t indent="0" pn="section-toc.1-1.6.1"><xref derivedContent="6" format="counter" sectionFormat="of" target="section-6"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-message-reception">Message Reception</xref></t>
          </li>
          <li pn="section-toc.1-1.7">
            <t indent="0" pn="section-toc.1-1.7.1"><xref derivedContent="7" format="counter" sectionFormat="of" target="section-7"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-message-processing-in-group">Message Processing in Group Mode</xref></t>
            <ul bare="true" empty="true" indent="2" spacing="compact" pn="section-toc.1-1.7.2">
              <li pn="section-toc.1-1.7.2.1">
                <t indent="0" pn="section-toc.1-1.7.2.1.1"><xref derivedContent="7.1" format="counter" sectionFormat="of" target="section-7.1"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-protecting-the-request">Protecting the Request</xref></t>
              </li>
              <li pn="section-toc.1-1.7.2.2">
                <t indent="0" pn="section-toc.1-1.7.2.2.1"><xref derivedContent="7.2" format="counter" sectionFormat="of" target="section-7.2"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-verifying-the-request">Verifying the Request</xref></t>
              </li>
              <li pn="section-toc.1-1.7.2.3">
                <t indent="0" pn="section-toc.1-1.7.2.3.1"><xref derivedContent="7.3" format="counter" sectionFormat="of" target="section-7.3"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-protecting-the-response">Protecting the Response</xref></t>
              </li>
              <li pn="section-toc.1-1.7.2.4">
                <t indent="0" pn="section-toc.1-1.7.2.4.1"><xref derivedContent="7.4" format="counter" sectionFormat="of" target="section-7.4"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-verifying-the-response">Verifying the Response</xref></t>
              </li>
              <li pn="section-toc.1-1.7.2.5">
                <t indent="0" pn="section-toc.1-1.7.2.5.1"><xref derivedContent="7.5" format="counter" sectionFormat="of" target="section-7.5"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-external-signature-checkers">External Signature Checkers</xref></t>
              </li>
            </ul>
          </li>
          <li pn="section-toc.1-1.8">
            <t indent="0" pn="section-toc.1-1.8.1"><xref derivedContent="8" format="counter" sectionFormat="of" target="section-8"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-message-processing-in-pairw">Message Processing in Pairwise Mode</xref></t>
            <ul bare="true" empty="true" indent="2" spacing="compact" pn="section-toc.1-1.8.2">
              <li pn="section-toc.1-1.8.2.1">
                <t indent="0" pn="section-toc.1-1.8.2.1.1"><xref derivedContent="8.1" format="counter" sectionFormat="of" target="section-8.1"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-preconditions">Preconditions</xref></t>
              </li>
              <li pn="section-toc.1-1.8.2.2">
                <t indent="0" pn="section-toc.1-1.8.2.2.1"><xref derivedContent="8.2" format="counter" sectionFormat="of" target="section-8.2"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-main-differences-from-oscor">Main Differences from OSCORE</xref></t>
              </li>
              <li pn="section-toc.1-1.8.2.3">
                <t indent="0" pn="section-toc.1-1.8.2.3.1"><xref derivedContent="8.3" format="counter" sectionFormat="of" target="section-8.3"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-protecting-the-request-2">Protecting the Request</xref></t>
              </li>
              <li pn="section-toc.1-1.8.2.4">
                <t indent="0" pn="section-toc.1-1.8.2.4.1"><xref derivedContent="8.4" format="counter" sectionFormat="of" target="section-8.4"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-verifying-the-request-2">Verifying the Request</xref></t>
              </li>
              <li pn="section-toc.1-1.8.2.5">
                <t indent="0" pn="section-toc.1-1.8.2.5.1"><xref derivedContent="8.5" format="counter" sectionFormat="of" target="section-8.5"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-protecting-the-response-2">Protecting the Response</xref></t>
              </li>
              <li pn="section-toc.1-1.8.2.6">
                <t indent="0" pn="section-toc.1-1.8.2.6.1"><xref derivedContent="8.6" format="counter" sectionFormat="of" target="section-8.6"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-verifying-the-response-2">Verifying the Response</xref></t>
              </li>
            </ul>
          </li>
          <li pn="section-toc.1-1.9">
            <t indent="0" pn="section-toc.1-1.9.1"><xref derivedContent="9" format="counter" sectionFormat="of" target="section-9"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-challenge-response-based-fr">Challenge-Response-Based Freshness and Replay Window Recovery</xref></t>
          </li>
          <li pn="section-toc.1-1.10">
            <t indent="0" pn="section-toc.1-1.10.1"><xref derivedContent="10" format="counter" sectionFormat="of" target="section-10"/>. <xref derivedContent="" format="title" sectionFormat="of" target="name-implementation-compliance">Implementation Compliance</xref></t>
          </li>
          <li pn="section-toc.1-1.11">
            <t indent="0" pn="section-toc.1-1.11.1"><xref derivedContent="11" format="counter" sectionFormat="of" target="section-11"/>. <xref derivedContent="" format="title" sectionFormat="of" target="name-web-linking">Web Linking</xref></t>
          </li>
          <li pn="section-toc.1-1.12">
            <t indent="0" pn="section-toc.1-1.12.1"><xref derivedContent="12" format="counter" sectionFormat="of" target="section-12"/>. <xref derivedContent="" format="title" sectionFormat="of" target="name-the-group-manager">The Group Manager</xref></t>
            <ul bare="true" empty="true" indent="2" spacing="compact" pn="section-toc.1-1.12.2">
              <li pn="section-toc.1-1.12.2.1">
                <t indent="0" pn="section-toc.1-1.12.2.1.1"><xref derivedContent="12.1" format="counter" sectionFormat="of" target="section-12.1"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-setup-of-new-endpoints">Setup of New Endpoints</xref></t>
              </li>
              <li pn="section-toc.1-1.12.2.2">
                <t indent="0" pn="section-toc.1-1.12.2.2.1"><xref derivedContent="12.2" format="counter" sectionFormat="of" target="section-12.2"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-management-of-group-keying-">Management of Group Keying Material</xref></t>
                <ul bare="true" empty="true" indent="2" spacing="compact" pn="section-toc.1-1.12.2.2.2">
                  <li pn="section-toc.1-1.12.2.2.2.1">
                    <t indent="0" pn="section-toc.1-1.12.2.2.2.1.1"><xref derivedContent="12.2.1" format="counter" sectionFormat="of" target="section-12.2.1"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-recycling-of-identifiers">Recycling of Identifiers</xref></t>
                  </li>
                </ul>
              </li>
              <li pn="section-toc.1-1.12.2.3">
                <t indent="0" pn="section-toc.1-1.12.2.3.1"><xref derivedContent="12.3" format="counter" sectionFormat="of" target="section-12.3"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-support-for-signature-check">Support for Signature Checkers</xref></t>
              </li>
            </ul>
          </li>
          <li pn="section-toc.1-1.13">
            <t indent="0" pn="section-toc.1-1.13.1"><xref derivedContent="13" format="counter" sectionFormat="of" target="section-13"/>. <xref derivedContent="" format="title" sectionFormat="of" target="name-security-considerations">Security Considerations</xref></t>
            <ul bare="true" empty="true" indent="2" spacing="compact" pn="section-toc.1-1.13.2">
              <li pn="section-toc.1-1.13.2.1">
                <t indent="0" pn="section-toc.1-1.13.2.1.1"><xref derivedContent="13.1" format="counter" sectionFormat="of" target="section-13.1"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-security-of-the-group-mode">Security of the Group Mode</xref></t>
                <ul bare="true" empty="true" indent="2" spacing="compact" pn="section-toc.1-1.13.2.1.2">
                  <li pn="section-toc.1-1.13.2.1.2.1">
                    <t indent="0" pn="section-toc.1-1.13.2.1.2.1.1"><xref derivedContent="13.1.1" format="counter" sectionFormat="of" target="section-13.1.1"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-example-of-need-for-proof-o">Example of Need for Proof of Group Membership</xref></t>
                  </li>
                </ul>
              </li>
              <li pn="section-toc.1-1.13.2.2">
                <t indent="0" pn="section-toc.1-1.13.2.2.1"><xref derivedContent="13.2" format="counter" sectionFormat="of" target="section-13.2"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-security-of-the-pairwise-mo">Security of the Pairwise Mode</xref></t>
              </li>
              <li pn="section-toc.1-1.13.2.3">
                <t indent="0" pn="section-toc.1-1.13.2.3.1"><xref derivedContent="13.3" format="counter" sectionFormat="of" target="section-13.3"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-uniqueness-of-key-nonce">Uniqueness of (key, nonce)</xref></t>
              </li>
              <li pn="section-toc.1-1.13.2.4">
                <t indent="0" pn="section-toc.1-1.13.2.4.1"><xref derivedContent="13.4" format="counter" sectionFormat="of" target="section-13.4"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-management-of-group-keying-m">Management of Group Keying Material</xref></t>
                <ul bare="true" empty="true" indent="2" spacing="compact" pn="section-toc.1-1.13.2.4.2">
                  <li pn="section-toc.1-1.13.2.4.2.1">
                    <t indent="0" pn="section-toc.1-1.13.2.4.2.1.1"><xref derivedContent="13.4.1" format="counter" sectionFormat="of" target="section-13.4.1"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-denial-of-service">Denial of Service</xref></t>
                  </li>
                </ul>
              </li>
              <li pn="section-toc.1-1.13.2.5">
                <t indent="0" pn="section-toc.1-1.13.2.5.1"><xref derivedContent="13.5" format="counter" sectionFormat="of" target="section-13.5"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-update-of-security-context-">Update of Security Context and Key Rotation</xref></t>
                <ul bare="true" empty="true" indent="2" spacing="compact" pn="section-toc.1-1.13.2.5.2">
                  <li pn="section-toc.1-1.13.2.5.2.1">
                    <t indent="0" pn="section-toc.1-1.13.2.5.2.1.1"><xref derivedContent="13.5.1" format="counter" sectionFormat="of" target="section-13.5.1"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-late-update-on-the-sender">Late Update on the Sender</xref></t>
                  </li>
                  <li pn="section-toc.1-1.13.2.5.2.2">
                    <t indent="0" pn="section-toc.1-1.13.2.5.2.2.1"><xref derivedContent="13.5.2" format="counter" sectionFormat="of" target="section-13.5.2"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-late-update-on-the-recipien">Late Update on the Recipient</xref></t>
                  </li>
                </ul>
              </li>
              <li pn="section-toc.1-1.13.2.6">
                <t indent="0" pn="section-toc.1-1.13.2.6.1"><xref derivedContent="13.6" format="counter" sectionFormat="of" target="section-13.6"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-collision-of-group-identifi">Collision of Group Identifiers</xref></t>
              </li>
              <li pn="section-toc.1-1.13.2.7">
                <t indent="0" pn="section-toc.1-1.13.2.7.1"><xref derivedContent="13.7" format="counter" sectionFormat="of" target="section-13.7"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-cross-group-message-injecti">Cross-Group Message Injection</xref></t>
                <ul bare="true" empty="true" indent="2" spacing="compact" pn="section-toc.1-1.13.2.7.2">
                  <li pn="section-toc.1-1.13.2.7.2.1">
                    <t indent="0" pn="section-toc.1-1.13.2.7.2.1.1"><xref derivedContent="13.7.1" format="counter" sectionFormat="of" target="section-13.7.1"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-attack-description">Attack Description</xref></t>
                  </li>
                  <li pn="section-toc.1-1.13.2.7.2.2">
                    <t indent="0" pn="section-toc.1-1.13.2.7.2.2.1"><xref derivedContent="13.7.2" format="counter" sectionFormat="of" target="section-13.7.2"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-attack-prevention-in-group-">Attack Prevention in Group Mode</xref></t>
                  </li>
                </ul>
              </li>
              <li pn="section-toc.1-1.13.2.8">
                <t indent="0" pn="section-toc.1-1.13.2.8.1"><xref derivedContent="13.8" format="counter" sectionFormat="of" target="section-13.8"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-prevention-of-group-cloning">Prevention of Group Cloning Attack</xref></t>
              </li>
              <li pn="section-toc.1-1.13.2.9">
                <t indent="0" pn="section-toc.1-1.13.2.9.1"><xref derivedContent="13.9" format="counter" sectionFormat="of" target="section-13.9"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-group-oscore-for-unicast-re">Group OSCORE for Unicast Requests</xref></t>
              </li>
              <li pn="section-toc.1-1.13.2.10">
                <t indent="0" pn="section-toc.1-1.13.2.10.1"><xref derivedContent="13.10" format="counter" sectionFormat="of" target="section-13.10"/>. <xref derivedContent="" format="title" sectionFormat="of" target="name-end-to-end-protection">End-to-End Protection</xref></t>
              </li>
              <li pn="section-toc.1-1.13.2.11">
                <t indent="0" pn="section-toc.1-1.13.2.11.1"><xref derivedContent="13.11" format="counter" sectionFormat="of" target="section-13.11"/>. <xref derivedContent="" format="title" sectionFormat="of" target="name-master-secret">Master Secret</xref></t>
              </li>
              <li pn="section-toc.1-1.13.2.12">
                <t indent="0" pn="section-toc.1-1.13.2.12.1"><xref derivedContent="13.12" format="counter" sectionFormat="of" target="section-13.12"/>. <xref derivedContent="" format="title" sectionFormat="of" target="name-replay-protection-2">Replay Protection</xref></t>
              </li>
              <li pn="section-toc.1-1.13.2.13">
                <t indent="0" pn="section-toc.1-1.13.2.13.1"><xref derivedContent="13.13" format="counter" sectionFormat="of" target="section-13.13"/>. <xref derivedContent="" format="title" sectionFormat="of" target="name-message-ordering">Message Ordering</xref></t>
              </li>
              <li pn="section-toc.1-1.13.2.14">
                <t indent="0" pn="section-toc.1-1.13.2.14.1"><xref derivedContent="13.14" format="counter" sectionFormat="of" target="section-13.14"/>. <xref derivedContent="" format="title" sectionFormat="of" target="name-message-freshness">Message Freshness</xref></t>
              </li>
              <li pn="section-toc.1-1.13.2.15">
                <t indent="0" pn="section-toc.1-1.13.2.15.1"><xref derivedContent="13.15" format="counter" sectionFormat="of" target="section-13.15"/>. <xref derivedContent="" format="title" sectionFormat="of" target="name-client-aliveness">Client Aliveness</xref></t>
              </li>
              <li pn="section-toc.1-1.13.2.16">
                <t indent="0" pn="section-toc.1-1.13.2.16.1"><xref derivedContent="13.16" format="counter" sectionFormat="of" target="section-13.16"/>. <xref derivedContent="" format="title" sectionFormat="of" target="name-cryptographic-consideration">Cryptographic Considerations</xref></t>
              </li>
              <li pn="section-toc.1-1.13.2.17">
                <t indent="0" pn="section-toc.1-1.13.2.17.1"><xref derivedContent="13.17" format="counter" sectionFormat="of" target="section-13.17"/>. <xref derivedContent="" format="title" sectionFormat="of" target="name-message-segmentation">Message Segmentation</xref></t>
              </li>
              <li pn="section-toc.1-1.13.2.18">
                <t indent="0" pn="section-toc.1-1.13.2.18.1"><xref derivedContent="13.18" format="counter" sectionFormat="of" target="section-13.18"/>. <xref derivedContent="" format="title" sectionFormat="of" target="name-privacy-considerations">Privacy Considerations</xref></t>
              </li>
            </ul>
          </li>
          <li pn="section-toc.1-1.14">
            <t indent="0" pn="section-toc.1-1.14.1"><xref derivedContent="14" format="counter" sectionFormat="of" target="section-14"/>. <xref derivedContent="" format="title" sectionFormat="of" target="name-iana-considerations">IANA Considerations</xref></t>
            <ul bare="true" empty="true" indent="2" spacing="compact" pn="section-toc.1-1.14.2">
              <li pn="section-toc.1-1.14.2.1">
                <t indent="0" pn="section-toc.1-1.14.2.1.1"><xref derivedContent="14.1" format="counter" sectionFormat="of" target="section-14.1"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-oscore-flag-bits-registry">OSCORE Flag Bits Registry</xref></t>
              </li>
              <li pn="section-toc.1-1.14.2.2">
                <t indent="0" pn="section-toc.1-1.14.2.2.1"><xref derivedContent="14.2" format="counter" sectionFormat="of" target="section-14.2"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-target-attributes-registry">Target Attributes Registry</xref></t>
              </li>
            </ul>
          </li>
          <li pn="section-toc.1-1.15">
            <t indent="0" pn="section-toc.1-1.15.1"><xref derivedContent="15" format="counter" sectionFormat="of" target="section-15"/>. <xref derivedContent="" format="title" sectionFormat="of" target="name-references">References</xref></t>
            <ul bare="true" empty="true" indent="2" spacing="compact" pn="section-toc.1-1.15.2">
              <li pn="section-toc.1-1.15.2.1">
                <t indent="0" pn="section-toc.1-1.15.2.1.1"><xref derivedContent="15.1" format="counter" sectionFormat="of" target="section-15.1"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-normative-references">Normative References</xref></t>
              </li>
              <li pn="section-toc.1-1.15.2.2">
                <t indent="0" pn="section-toc.1-1.15.2.2.1"><xref derivedContent="15.2" format="counter" sectionFormat="of" target="section-15.2"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-informative-references">Informative References</xref></t>
              </li>
            </ul>
          </li>
          <li pn="section-toc.1-1.16">
            <t indent="0" pn="section-toc.1-1.16.1"><xref derivedContent="Appendix A" format="default" sectionFormat="of" target="section-appendix.a"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-assumptions-and-security-ob">Assumptions and Security Objectives</xref></t>
            <ul bare="true" empty="true" indent="2" spacing="compact" pn="section-toc.1-1.16.2">
              <li pn="section-toc.1-1.16.2.1">
                <t indent="0" pn="section-toc.1-1.16.2.1.1"><xref derivedContent="A.1" format="counter" sectionFormat="of" target="section-appendix.a.1"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-assumptions">Assumptions</xref></t>
              </li>
              <li pn="section-toc.1-1.16.2.2">
                <t indent="0" pn="section-toc.1-1.16.2.2.1"><xref derivedContent="A.2" format="counter" sectionFormat="of" target="section-appendix.a.2"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-security-objectives">Security Objectives</xref></t>
              </li>
            </ul>
          </li>
          <li pn="section-toc.1-1.17">
            <t indent="0" pn="section-toc.1-1.17.1"><xref derivedContent="Appendix B" format="default" sectionFormat="of" target="section-appendix.b"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-list-of-use-cases">List of Use Cases</xref></t>
          </li>
          <li pn="section-toc.1-1.18">
            <t indent="0" pn="section-toc.1-1.18.1"><xref derivedContent="Appendix C" format="default" sectionFormat="of" target="section-appendix.c"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-example-of-group-identifier">Example of Group Identifier Format</xref></t>
          </li>
          <li pn="section-toc.1-1.19">
            <t indent="0" pn="section-toc.1-1.19.1"><xref derivedContent="Appendix D" format="default" sectionFormat="of" target="section-appendix.d"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-responsibilities-of-the-gro">Responsibilities of the Group Manager</xref></t>
          </li>
          <li pn="section-toc.1-1.20">
            <t indent="0" pn="section-toc.1-1.20.1"><xref derivedContent="" format="none" sectionFormat="of" target="section-appendix.e"/><xref derivedContent="" format="title" sectionFormat="of" target="name-acknowledgements">Acknowledgements</xref></t>
          </li>
          <li pn="section-toc.1-1.21">
            <t indent="0" pn="section-toc.1-1.21.1"><xref derivedContent="" format="none" sectionFormat="of" target="section-appendix.f"/><xref derivedContent="" format="title" sectionFormat="of" target="name-authors-addresses">Authors' Addresses</xref></t>
          </li>
        </ul>
      </section>
    </toc>
  </front>
  <middle>
    <section anchor="intro" numbered="true" removeInRFC="false" toc="include" pn="section-1">
      <name slugifiedName="name-introduction">Introduction</name>
      <t indent="0" pn="section-1-1">The Constrained Application Protocol (CoAP) <xref target="RFC7252" format="default" sectionFormat="of" derivedContent="RFC7252"/> is a web transfer protocol specifically designed for constrained devices and networks <xref target="RFC7228" format="default" sectionFormat="of" derivedContent="RFC7228"/>. Group communication for CoAP <xref target="RFC10020" format="default" sectionFormat="of" derivedContent="RFC10020"/> addresses use cases where deployed devices benefit from a group communication model, for example, to reduce latencies, improve performance, and reduce bandwidth utilization. Use cases include lighting control, integrated building control, software and firmware updates, parameter and configuration updates, commissioning of constrained networks, and emergency multicast (see <xref target="sec-use-cases" format="default" sectionFormat="of" derivedContent="Appendix B"/>). Group communication for CoAP <xref target="RFC10020" format="default" sectionFormat="of" derivedContent="RFC10020"/> mainly uses UDP/IP multicast as the underlying data transport.</t>
      <t indent="0" pn="section-1-2">Object Security for Constrained RESTful Environments (OSCORE) <xref target="RFC8613" format="default" sectionFormat="of" derivedContent="RFC8613"/> is a security protocol that protects CoAP messages. OSCORE builds on CBOR Object Signing and Encryption (COSE) <xref target="RFC9052" format="default" sectionFormat="of" derivedContent="RFC9052"/> <xref target="RFC9053" format="default" sectionFormat="of" derivedContent="RFC9053"/> and provides end-to-end encryption, integrity, replay protection, and binding of response to request between a sender and a recipient, independent of the transport layer also in the presence of intermediaries.
To this end, a CoAP message is protected by including its payload (if any), certain options, and header fields into a COSE object, which is conveyed within the CoAP payload and the CoAP OSCORE Option of the protected message, thereby replacing those message fields with an authenticated and encrypted object.</t>
      <t indent="0" pn="section-1-3">This document defines Group OSCORE, a security protocol for group communication with CoAP <xref target="RFC10020" format="default" sectionFormat="of" derivedContent="RFC10020"/> and for CoAP-mappable HTTP requests and responses, providing the same end-to-end security properties as OSCORE also in the case where requests have multiple recipients. In particular, Group OSCORE provides protection and source authentication for group requests sent from a client to multiple servers and for the corresponding responses. Group OSCORE also defines a pairwise mode where each member of the group can efficiently derive symmetric pairwise keys to use with another member of the group for pairwise-protected communication. Just like OSCORE, Group OSCORE is independent of the transport layer and works wherever CoAP does.</t>
      <t indent="0" pn="section-1-4">As with OSCORE, it is possible to combine Group OSCORE with communication security on other layers. One example is the use of transport layer security, such as DTLS <xref target="RFC9147" format="default" sectionFormat="of" derivedContent="RFC9147"/>, between one client and one proxy, or between one proxy and one server. This prevents observers from accessing addressing information conveyed in CoAP options that would not be protected by Group OSCORE, but would be protected by DTLS. These options include Uri-Host, Uri-Port, and Proxy-Uri. Note that DTLS does not define how to secure messages sent over IP multicast and cannot be used for end-to-end protection over a proxy.
Group OSCORE is also intended to work with OSCORE-capable proxies <xref target="I-D.ietf-core-oscore-capable-proxies" format="default" sectionFormat="of" derivedContent="OSCORE-PROXIES"/>, thereby enabling, for example, nested OSCORE operations with OSCORE-protected communication between a CoAP client and a proxy, carrying messages that are additionally protected with Group OSCORE between the CoAP client and the target CoAP servers.</t>
      <t indent="0" pn="section-1-5">Group OSCORE defines two modes of operation that can be used independently or together:</t>
      <ul spacing="normal" bare="false" empty="false" indent="3" pn="section-1-6">
        <li pn="section-1-6.1">
          <t indent="0" pn="section-1-6.1.1">In the group mode, Group OSCORE requests and responses are digitally signed with the private key of the sender and the signature is embedded in the protected CoAP message. The group mode supports all COSE signature algorithms as well as signature verification by intermediaries. This mode is defined in <xref target="mess-processing" format="default" sectionFormat="of" derivedContent="Section 7"/>.</t>
        </li>
        <li pn="section-1-6.2">
          <t indent="0" pn="section-1-6.2.1">In the pairwise mode, two group members exchange OSCORE requests and responses (typically) over unicast, and the messages are protected with symmetric keys not known by the other group members. These symmetric keys are derived from Diffie-Hellman shared secrets, which are calculated with the asymmetric keys of the sender and recipient, allowing for shorter integrity tags and therefore lower message overhead. This mode is defined in <xref target="sec-pairwise-protection" format="default" sectionFormat="of" derivedContent="Section 8"/>.</t>
        </li>
      </ul>
      <t indent="0" pn="section-1-7">Both modes provide source authentication of CoAP messages. The application decides what mode to use, potentially on a per-message basis. Such decisions can be based, for instance, on preconfigured policies or dynamic assessing of the target recipient and/or resource, among other things. One important case is when requests are protected in group mode and responses are protected in pairwise mode. Since such responses convey shorter integrity tags instead of bigger, full-fledged signatures, this significantly reduces the message overhead in the case of many responses to one request.</t>
      <t indent="0" pn="section-1-8">A special deployment of Group OSCORE consists in using the pairwise mode only. For example, consider the case of a constrained-node network <xref target="RFC7228" format="default" sectionFormat="of" derivedContent="RFC7228"/> with a large number of CoAP endpoints and the objective to establish secure communication between any pair of endpoints with a small provisioning effort and message overhead. Since the total number of security associations that needs to be established grows with the square of the number of endpoints, it is desirable to restrict the amount of secret keying material provided to each endpoint. Moreover, a key establishment protocol would need to be executed for each security association. One solution to this issue is to deploy Group OSCORE, with the endpoints being part of a group, and to use the pairwise mode. This solution offers the benefit of providing a single shared secret while distributing only the public keys of group members or a subset of those. After that, a CoAP endpoint can locally derive the keying material to use with the other endpoint in the group and protect CoAP communications with very low overhead <xref target="I-D.ietf-iotops-security-protocol-comparison" format="default" sectionFormat="of" derivedContent="CoAP-SEC-PROT"/>.</t>
      <t indent="0" pn="section-1-9">In some circumstances, Group OSCORE messages may be transported in HTTP, e.g., when they are protected with the pairwise mode and target a single recipient, or when they are protected with the group mode and target multiple CoAP recipients through cross-protocol translators such as HTTP-to-CoAP proxies <xref target="RFC8075" format="default" sectionFormat="of" derivedContent="RFC8075"/> <xref target="I-D.ietf-core-groupcomm-proxy" format="default" sectionFormat="of" derivedContent="CoAP-GROUP-PROXY"/>. The use of Group OSCORE with HTTP is as defined for OSCORE in <xref section="11" sectionFormat="of" target="RFC8613" format="default" derivedLink="https://rfc-editor.org/rfc/rfc8613#section-11" derivedContent="RFC8613"/>.</t>
      <section anchor="terminology" numbered="true" removeInRFC="false" toc="include" pn="section-1.1">
        <name slugifiedName="name-terminology">Terminology</name>
        <t indent="0" pn="section-1.1-1">The key words "<bcp14>MUST</bcp14>", "<bcp14>MUST NOT</bcp14>", "<bcp14>REQUIRED</bcp14>", "<bcp14>SHALL</bcp14>", "<bcp14>SHALL NOT</bcp14>", "<bcp14>SHOULD</bcp14>", "<bcp14>SHOULD NOT</bcp14>", "<bcp14>RECOMMENDED</bcp14>", "<bcp14>NOT RECOMMENDED</bcp14>",
"<bcp14>MAY</bcp14>", and "<bcp14>OPTIONAL</bcp14>" in this document are to be interpreted as
described in BCP 14 <xref target="RFC2119" format="default" sectionFormat="of" derivedContent="RFC2119"/> <xref target="RFC8174" format="default" sectionFormat="of" derivedContent="RFC8174"/> when, and only when, they
appear in all capitals, as shown here.</t>
        <t indent="0" pn="section-1.1-2">Readers are expected to be familiar with the terms and concepts described in CoAP <xref target="RFC7252" format="default" sectionFormat="of" derivedContent="RFC7252"/>, including "endpoint", "client", "server", "sender", and "recipient"; group communication for CoAP <xref target="RFC10020" format="default" sectionFormat="of" derivedContent="RFC10020"/>; Observe <xref target="RFC7641" format="default" sectionFormat="of" derivedContent="RFC7641"/>; Concise Binary Object Representation (CBOR) <xref target="RFC8949" format="default" sectionFormat="of" derivedContent="RFC8949"/>; Concise Data Definition Language (CDDL) <xref target="RFC8610" format="default" sectionFormat="of" derivedContent="RFC8610"/>; COSE <xref target="RFC9052" format="default" sectionFormat="of" derivedContent="RFC9052"/> <xref target="RFC9053" format="default" sectionFormat="of" derivedContent="RFC9053"/>; and related countersignatures  <xref target="RFC9338" format="default" sectionFormat="of" derivedContent="RFC9338"/>.</t>
        <t indent="0" pn="section-1.1-3">Readers are also expected to be familiar with the terms and concepts for protection and processing of CoAP messages through OSCORE, such as "Security Context" and "Master Secret", defined in <xref target="RFC8613" format="default" sectionFormat="of" derivedContent="RFC8613"/>.</t>
        <t indent="0" pn="section-1.1-4">Terminology for constrained environments, such as "constrained device" and "constrained-node network", is defined in <xref target="RFC7228" format="default" sectionFormat="of" derivedContent="RFC7228"/>.</t>
        <t indent="0" pn="section-1.1-5">This document also refers to the following terminology.</t>
        <dl indent="3" newline="false" spacing="normal" pn="section-1.1-6">
          <dt pn="section-1.1-6.1">Keying material:</dt>
          <dd pn="section-1.1-6.2">
            <t indent="0" pn="section-1.1-6.2.1">Data that is necessary to establish and maintain secure communication among endpoints. This includes, for instance, keys and IVs <xref target="RFC4949" format="default" sectionFormat="of" derivedContent="RFC4949"/>.</t>
          </dd>
          <dt pn="section-1.1-6.3">Authentication credential:</dt>
          <dd pn="section-1.1-6.4">
            <t indent="0" pn="section-1.1-6.4.1">Information associated with an entity, including that entity's public key and parameters associated with the public key. Examples of formats of authentication credentials are CBOR Web Tokens (CWTs) and CWT Claims Sets (CCSs) <xref target="RFC8392" format="default" sectionFormat="of" derivedContent="RFC8392"/>, X.509 certificates <xref target="RFC5280" format="default" sectionFormat="of" derivedContent="RFC5280"/>, and C509 certificates <xref target="I-D.ietf-cose-cbor-encoded-cert" format="default" sectionFormat="of" derivedContent="C509-CERT"/>. Further details about authentication credentials are provided in <xref target="sec-pub-key-format" format="default" sectionFormat="of" derivedContent="Section 2.4"/>.</t>
          </dd>
          <dt pn="section-1.1-6.5">Group:</dt>
          <dd pn="section-1.1-6.6">
            <t indent="0" pn="section-1.1-6.6.1">A set of endpoints that share group keying material and security parameters (Common Context; see <xref target="sec-context" format="default" sectionFormat="of" derivedContent="Section 2"/>). That is, unless otherwise specified, the term "group" used in this document refers to a "security group" (see <xref section="2.1" sectionFormat="of" target="RFC10020" format="default" derivedLink="https://rfc-editor.org/rfc/rfc10020#section-2.1" derivedContent="RFC10020"/>), not to be confused with "CoAP group" or "application group".</t>
          </dd>
          <dt pn="section-1.1-6.7">Group Manager:</dt>
          <dd pn="section-1.1-6.8">
            <t indent="0" pn="section-1.1-6.8.1">An entity responsible for a group. A Group Manager is not required to be an actual group member or to participate in group communication. The operations of the Group Manager are defined in <xref target="group-manager" format="default" sectionFormat="of" derivedContent="Section 12"/>, and its responsibilities are listed in <xref target="sec-group-manager" format="default" sectionFormat="of" derivedContent="Appendix D"/>.</t>
          </dd>
          <dt pn="section-1.1-6.9">Silent server:</dt>
          <dd pn="section-1.1-6.10">
            <t indent="0" pn="section-1.1-6.10.1">A member of a group that performs only group mode processing on incoming requests and never sends responses protected with Group OSCORE. For CoAP group communications, requests are normally sent without necessarily expecting a response. A silent server may send unprotected responses as error responses to report a Group OSCORE error.</t>
          </dd>
          <dt pn="section-1.1-6.11">Group Identifier (Gid):</dt>
          <dd pn="section-1.1-6.12">
            <t indent="0" pn="section-1.1-6.12.1">An identifier that is assigned to the group and is unique within the set of groups of a given Group Manager. The Gid value changes every time the group is rekeyed (see <xref target="sec-group-key-management" format="default" sectionFormat="of" derivedContent="Section 12.2"/>).</t>
          </dd>
          <dt pn="section-1.1-6.13">Birth Gid:</dt>
          <dd pn="section-1.1-6.14">
            <t indent="0" pn="section-1.1-6.14.1">With respect to a group member, the Gid obtained by that group member upon (re-)joining the group.</t>
          </dd>
          <dt pn="section-1.1-6.15">Key Generation Number:</dt>
          <dd pn="section-1.1-6.16">
            <t indent="0" pn="section-1.1-6.16.1">An integer value identifying the current version of the keying material used in a group.</t>
          </dd>
          <dt pn="section-1.1-6.17">Source authentication:</dt>
          <dd pn="section-1.1-6.18">
            <t indent="0" pn="section-1.1-6.18.1">Evidence that a received message in the group originated from a specific identified group member. This also provides assurance that the message was not tampered with by anyone, be it a different legitimate group member or an endpoint that is not a group member.</t>
          </dd>
          <dt pn="section-1.1-6.19">Group request:</dt>
          <dd pn="section-1.1-6.20">
            <t indent="0" pn="section-1.1-6.20.1">A CoAP request message sent by a client in the group to servers in that group.</t>
          </dd>
          <dt pn="section-1.1-6.21">Long exchange:</dt>
          <dd pn="section-1.1-6.22">
            <t indent="0" pn="section-1.1-6.22.1">An exchange of messages associated with a request that is a group request and/or an Observe request <xref target="RFC7641" format="default" sectionFormat="of" derivedContent="RFC7641"/>.
</t>
            <t indent="0" pn="section-1.1-6.22.2">In either case, multiple responses can follow from the same server to the request associated with the long exchange, even if the request is not an Observe request (see <xref section="3.1.6" sectionFormat="of" target="RFC10020" format="default" derivedLink="https://rfc-editor.org/rfc/rfc10020#section-3.1.6" derivedContent="RFC10020"/>). The client terminates a long exchange when freeing up the CoAP Token value used for the associated request, for which no further responses will be accepted afterwards.</t>
          </dd>
        </dl>
      </section>
    </section>
    <section anchor="sec-context" numbered="true" removeInRFC="false" toc="include" pn="section-2">
      <name slugifiedName="name-security-context">Security Context</name>
      <t indent="0" pn="section-2-1">This document refers to a group as a set of endpoints sharing keying material and security parameters for executing the Group OSCORE protocol; see <xref target="terminology" format="default" sectionFormat="of" derivedContent="Section 1.1"/>. All members of a group maintain a Security Context as defined in this section.</t>
      <t indent="0" pn="section-2-2">How the Security Context is established by the group members is out of scope for this document, but if there is more than one Security Context applicable to a message, then the endpoints <bcp14>MUST</bcp14> be able to determine which Security Context was latest established. The management of information about the group (i.e., identifiers, OSCORE input parameters, and keying material) is described in terms of a Group Manager (see <xref target="group-manager" format="default" sectionFormat="of" derivedContent="Section 12"/>).</t>
      <t indent="0" pn="section-2-3">An endpoint of the group may use the group mode (see <xref target="mess-processing" format="default" sectionFormat="of" derivedContent="Section 7"/>), the pairwise mode (see <xref target="sec-pairwise-protection" format="default" sectionFormat="of" derivedContent="Section 8"/>), or both, depending on the modes it supports and the parameters of the Security Context.
The Security Context of Group OSCORE extends the OSCORE Security Context defined in <xref section="3" sectionFormat="of" target="RFC8613" format="default" derivedLink="https://rfc-editor.org/rfc/rfc8613#section-3" derivedContent="RFC8613"/> as follows (see <xref target="fig-additional-context-information" format="default" sectionFormat="of" derivedContent="Figure 1"/>).</t>
      <ul spacing="normal" bare="false" empty="false" indent="3" pn="section-2-4">
        <li pn="section-2-4.1">
          <t indent="0" pn="section-2-4.1.1">One Common Context shared by all the endpoints in the group and extended as defined below.  </t>
          <ul spacing="normal" bare="false" empty="false" indent="3" pn="section-2-4.1.2">
            <li pn="section-2-4.1.2.1">
              <t indent="0" pn="section-2-4.1.2.1.1">The new parameter Authentication Credential Format (see <xref target="ssec-common-context-authcred-format" format="default" sectionFormat="of" derivedContent="Section 2.1.5"/>), specifying the format of authentication credentials used in the group (see <xref target="sec-pub-key-format" format="default" sectionFormat="of" derivedContent="Section 2.4"/>).</t>
            </li>
            <li pn="section-2-4.1.2.2">
              <t indent="0" pn="section-2-4.1.2.2.1">The new parameter Group Manager Authentication Credential, specifying the authentication credential of the Group Manager responsible for the group (see <xref target="ssec-common-context-gm-pub-key" format="default" sectionFormat="of" derivedContent="Section 2.1.6"/>).</t>
            </li>
            <li pn="section-2-4.1.2.3">
              <t indent="0" pn="section-2-4.1.2.3.1">For the group mode, the Common Context is extended with the following new parameters.      </t>
              <ul spacing="normal" bare="false" empty="false" indent="3" pn="section-2-4.1.2.3.2">
                <li pn="section-2-4.1.2.3.2.1">
                  <t indent="0" pn="section-2-4.1.2.3.2.1.1">Group Encryption Algorithm, specifying the algorithm used for encrypting and decrypting messages protected in group mode (see <xref target="ssec-common-context-cs-enc-alg" format="default" sectionFormat="of" derivedContent="Section 2.1.7"/>).</t>
                </li>
                <li pn="section-2-4.1.2.3.2.2">
                  <t indent="0" pn="section-2-4.1.2.3.2.2.1">Signature Algorithm, specifying the algorithm used for computing and verifying the countersignature of messages protected in group mode (see <xref target="ssec-common-context-cs-alg" format="default" sectionFormat="of" derivedContent="Section 2.1.8"/>).</t>
                </li>
                <li pn="section-2-4.1.2.3.2.3">
                  <t indent="0" pn="section-2-4.1.2.3.2.3.1">Signature Encryption Key, specifying the symmetric key used for deriving a keystream, which, in turn, is used for encrypting and decrypting the countersignature of messages protected in group mode (see <xref target="ssec-common-context-group-enc-key" format="default" sectionFormat="of" derivedContent="Section 2.1.9"/>).</t>
                </li>
              </ul>
            </li>
            <li pn="section-2-4.1.2.4">
              <t indent="0" pn="section-2-4.1.2.4.1">For the pairwise mode, the Common Context is extended with a Pairwise Key Agreement Algorithm (see <xref target="ssec-common-context-dh-alg" format="default" sectionFormat="of" derivedContent="Section 2.1.10"/>) used for the agreement on a static-static Diffie-Hellman shared secret from which pairwise keys are derived (see <xref target="key-derivation-pairwise" format="default" sectionFormat="of" derivedContent="Section 2.5.1"/>).</t>
            </li>
          </ul>
          <t indent="0" pn="section-2-4.1.3">
The content of the Common Context is long-term, as it is meant to be stable once the Common Context is established.</t>
        </li>
        <li pn="section-2-4.2">
          <t indent="0" pn="section-2-4.2.1">One Sender Context extended with the following new parameters.  </t>
          <ul spacing="normal" bare="false" empty="false" indent="3" pn="section-2-4.2.2">
            <li pn="section-2-4.2.2.1">
              <t indent="0" pn="section-2-4.2.2.1.1">The endpoint's own private key used to sign messages protected in group mode (see <xref target="mess-processing" format="default" sectionFormat="of" derivedContent="Section 7"/>) or for deriving pairwise keys used with the pairwise mode (see <xref target="sec-derivation-pairwise" format="default" sectionFormat="of" derivedContent="Section 2.5"/>).</t>
            </li>
            <li pn="section-2-4.2.2.2">
              <t indent="0" pn="section-2-4.2.2.2.1">The endpoint's own authentication credential containing its public key (see <xref target="sec-pub-key-format" format="default" sectionFormat="of" derivedContent="Section 2.4"/>).</t>
            </li>
            <li pn="section-2-4.2.2.3">
              <t indent="0" pn="section-2-4.2.2.3.1">For the pairwise mode, the Sender Context is extended with the Pairwise Sender Keys associated with the other endpoints (see <xref target="sec-derivation-pairwise" format="default" sectionFormat="of" derivedContent="Section 2.5"/>).</t>
            </li>
          </ul>
          <t indent="0" pn="section-2-4.2.3">
Except for the Sender Sequence Number defined in <xref section="3.1" sectionFormat="of" target="RFC8613" format="default" derivedLink="https://rfc-editor.org/rfc/rfc8613#section-3.1" derivedContent="RFC8613"/>, the content of the Sender Context is long-term, as it is meant to be stable once the Sender Context is established.  </t>
          <t indent="0" pn="section-2-4.2.4">
If the endpoint is configured exclusively as a silent server (see <xref target="terminology" format="default" sectionFormat="of" derivedContent="Section 1.1"/>), then the Sender Context is omitted.</t>
        </li>
        <li pn="section-2-4.3">
          <t indent="0" pn="section-2-4.3.1">One Recipient Context for each other endpoint from which messages are received. It is not necessary to maintain Recipient Contexts associated with endpoints from which messages are not (expected to be) received.  </t>
          <ul spacing="normal" bare="false" empty="false" indent="3" pn="section-2-4.3.2">
            <li pn="section-2-4.3.2.1">
              <t indent="0" pn="section-2-4.3.2.1.1">Each Recipient Context is extended with the authentication credential of the other endpoint, which is used to verify the signature of messages protected in group mode or to derive the pairwise keys used with the pairwise mode (see <xref target="sec-derivation-pairwise" format="default" sectionFormat="of" derivedContent="Section 2.5"/>).</t>
            </li>
            <li pn="section-2-4.3.2.2">
              <t indent="0" pn="section-2-4.3.2.2.1">For the pairwise mode, each Recipient Context is extended with the Pairwise Recipient Key associated with the other endpoint (see <xref target="sec-derivation-pairwise" format="default" sectionFormat="of" derivedContent="Section 2.5"/>).</t>
            </li>
          </ul>
          <t indent="0" pn="section-2-4.3.3">
Except for the Replay Window defined in <xref section="3.1" sectionFormat="of" target="RFC8613" format="default" derivedLink="https://rfc-editor.org/rfc/rfc8613#section-3.1" derivedContent="RFC8613"/>, the content of each Recipient Context is long-term, as it is meant to be stable once the Recipient Context is established.</t>
        </li>
      </ul>
      <t indent="0" pn="section-2-5">The varying part of the Group OSCORE Security Context is composed of the Sender Sequence Number in the Sender Context and the Replay Windows in the different Recipient Contexts.</t>
      <figure anchor="fig-additional-context-information" align="left" suppress-title="false" pn="figure-1">
        <name slugifiedName="name-additions-to-the-oscore-sec">Additions to the OSCORE Security Context</name>
        <artwork align="center" pn="section-2-6.1">
+-------------------+-------------------------------------------------+
| Context Component | New Information Elements                        |
+-------------------+-------------------------------------------------+
| Common Context    |   Authentication Credential Format              |
|                   |   Group Manager Authentication Credential       |
|                   | * Group Encryption Algorithm                    |
|                   | * Signature Algorithm                           |
|                   | * Signature Encryption Key                      |
|                   | ^ Pairwise Key Agreement Algorithm              |
+-------------------+-------------------------------------------------+
| Sender Context    |   Endpoint's own private key                    |
|                   |   Endpoint's own authentication credential      |
|                   | ^ Pairwise Sender Keys for the other endpoints  |
+-------------------+-------------------------------------------------+
| Each              |   Other endpoint's authentication credential    |
| Recipient Context | ^ Pairwise Recipient Key for the other endpoint |
+-------------------+-------------------------------------------------+
</artwork>
      </figure>
      <t indent="0" pn="section-2-7">Note: The elements labeled with * and with ^ are relevant only for the group mode and only for the pairwise mode, respectively.</t>
      <section anchor="ssec-common-context" numbered="true" removeInRFC="false" toc="include" pn="section-2.1">
        <name slugifiedName="name-common-context">Common Context</name>
        <t indent="0" pn="section-2.1-1">The following sections specify how the Common Context is used and extended compared to <xref target="RFC8613" format="default" sectionFormat="of" derivedContent="RFC8613"/>. The Common Context may be acquired from the Group Manager (see <xref target="group-manager" format="default" sectionFormat="of" derivedContent="Section 12"/>).</t>
        <section anchor="ssec-common-context-aead-alg" numbered="true" removeInRFC="false" toc="include" pn="section-2.1.1">
          <name slugifiedName="name-aead-algorithm">AEAD Algorithm</name>
          <t indent="0" pn="section-2.1.1-1">The Authenticated Encryption with Associated Data (AEAD) Algorithm (see <xref section="3.1" sectionFormat="of" target="RFC8613" format="default" derivedLink="https://rfc-editor.org/rfc/rfc8613#section-3.1" derivedContent="RFC8613"/>) identifies the COSE AEAD algorithm to use for encryption and decryption when messages are protected using the pairwise mode (see <xref target="sec-pairwise-protection" format="default" sectionFormat="of" derivedContent="Section 8"/>). This algorithm <bcp14>MUST</bcp14> provide integrity protection. If this parameter is not set, the pairwise mode is not used in the group.</t>
        </section>
        <section anchor="ssec-common-context-hkdf-alg" numbered="true" removeInRFC="false" toc="include" pn="section-2.1.2">
          <name slugifiedName="name-hkdf-algorithm">HKDF Algorithm</name>
          <t indent="0" pn="section-2.1.2-1">The HMAC-based Key Derivation Function (HKDF) Algorithm (see <xref section="3.1" sectionFormat="of" target="RFC8613" format="default" derivedLink="https://rfc-editor.org/rfc/rfc8613#section-3.1" derivedContent="RFC8613"/>) identifies the used key derivation function, which <bcp14>MUST</bcp14> be one of the HKDF <xref target="RFC5869" format="default" sectionFormat="of" derivedContent="RFC5869"/> algorithms defined for COSE to use HMAC as the underlying PRF (see <xref section="5.1" sectionFormat="of" target="RFC9053" format="default" derivedLink="https://rfc-editor.org/rfc/rfc9053#section-5.1" derivedContent="RFC9053"/>) and registered at <xref target="COSE.Algorithms" format="default" sectionFormat="of" derivedContent="COSE.Algorithms"/>.</t>
        </section>
        <section anchor="ssec-common-context-id-context" numbered="true" removeInRFC="false" toc="include" pn="section-2.1.3">
          <name slugifiedName="name-id-context">ID Context</name>
          <t indent="0" pn="section-2.1.3-1">The ID Context parameter (see Sections <xref target="RFC8613" section="3.1" sectionFormat="bare" format="default" derivedLink="https://rfc-editor.org/rfc/rfc8613#section-3.1" derivedContent="RFC8613"/> and <xref target="RFC8613" section="3.3" sectionFormat="bare" format="default" derivedLink="https://rfc-editor.org/rfc/rfc8613#section-3.3" derivedContent="RFC8613"/> of <xref target="RFC8613" format="default" sectionFormat="of" derivedContent="RFC8613"/>) contains the Gid of the group. The choice of the Gid format is application-specific. An example of specific formatting of the Gid is given in <xref target="gid-ex" format="default" sectionFormat="of" derivedContent="Appendix C"/>. The application needs to specify how to handle potential collisions between Gids (see <xref target="ssec-gid-collision" format="default" sectionFormat="of" derivedContent="Section 13.6"/>).</t>
        </section>
        <section anchor="ssec-common-common-iv" numbered="true" removeInRFC="false" toc="include" pn="section-2.1.4">
          <name slugifiedName="name-common-iv">Common IV</name>
          <t indent="0" pn="section-2.1.4-1">The Common IV parameter (see <xref section="3.1" sectionFormat="of" target="RFC8613" format="default" derivedLink="https://rfc-editor.org/rfc/rfc8613#section-3.1" derivedContent="RFC8613"/>) identifies the Common IV used in the group. Differently from OSCORE, the length of the Common IV is determined as follows:</t>
          <ul spacing="normal" bare="false" empty="false" indent="3" pn="section-2.1.4-2">
            <li pn="section-2.1.4-2.1">
              <t indent="0" pn="section-2.1.4-2.1.1">If only one among the AEAD Algorithm and the Group Encryption Algorithm is set (see Sections <xref target="ssec-common-context-aead-alg" format="counter" sectionFormat="of" derivedContent="2.1.1"/> and <xref target="ssec-common-context-cs-enc-alg" format="counter" sectionFormat="of" derivedContent="2.1.7"/>), the length of the Common IV is the nonce length for the set algorithm.</t>
            </li>
            <li pn="section-2.1.4-2.2">
              <t indent="0" pn="section-2.1.4-2.2.1">If both the AEAD Algorithm and the Group Encryption Algorithm are set, the length of the Common IV is the greatest nonce length among those of the two algorithms.</t>
            </li>
          </ul>
          <t indent="0" pn="section-2.1.4-3">If the Group Encryption Algorithm is A128CTR, A192CTR, or A256CTR (see <xref section="4" sectionFormat="of" target="RFC9459" format="default" derivedLink="https://rfc-editor.org/rfc/rfc9459#section-4" derivedContent="RFC9459"/>), then the length of the nonce used by that algorithm is 12 bytes (see <xref target="ssec-common-context-cs-enc-alg" format="default" sectionFormat="of" derivedContent="Section 2.1.7"/>).</t>
        </section>
        <section anchor="ssec-common-context-authcred-format" numbered="true" removeInRFC="false" toc="include" pn="section-2.1.5">
          <name slugifiedName="name-authentication-credential-f">Authentication Credential Format</name>
          <t indent="0" pn="section-2.1.5-1">The new parameter Authentication Credential Format specifies the format of authentication credentials used in the group.</t>
        </section>
        <section anchor="ssec-common-context-gm-pub-key" numbered="true" removeInRFC="false" toc="include" pn="section-2.1.6">
          <name slugifiedName="name-group-manager-authenticatio">Group Manager Authentication Credential</name>
          <t indent="0" pn="section-2.1.6-1">The new parameter Group Manager Authentication Credential specifies the authentication credential of the Group Manager, including the Group Manager's public key. The endpoint <bcp14>MUST</bcp14> achieve proof of possession of the corresponding private key. As an example, such proof of possession is possible to achieve during the join process provided by the realization of Group Manager specified in <xref target="I-D.ietf-ace-key-groupcomm-oscore" format="default" sectionFormat="of" derivedContent="ACE-KEY-GROUP-OSCORE"/>. Further details on the provisioning of the Group Manager's authentication credential to the group members are out of the scope of this document.</t>
        </section>
        <section anchor="ssec-common-context-cs-enc-alg" numbered="true" removeInRFC="false" toc="include" pn="section-2.1.7">
          <name slugifiedName="name-group-encryption-algorithm">Group Encryption Algorithm</name>
          <t indent="0" pn="section-2.1.7-1">The new parameter Group Encryption Algorithm identifies the algorithm to use for encryption and decryption when messages are protected in group mode (see <xref target="mess-processing" format="default" sectionFormat="of" derivedContent="Section 7"/>). This algorithm <bcp14>MAY</bcp14> provide integrity protection. If it does not, integrity protection is still provided by the countersignature added to the message due to the use of the group mode. If this parameter is not set, the group mode is not used in the group.</t>
          <t indent="0" pn="section-2.1.7-2">In order to be eligible to use as Group Encryption Algorithm, a non-authenticated algorithm <bcp14>MUST</bcp14> ensure that the same key is not reused with the same IV or intermediate values used in the algorithm, e.g., for algorithms that increment the IV internally. If a non-authenticated algorithm does not fulfill the requirement above, that algorithm <bcp14>MUST NOT</bcp14> be used as Group Encryption Algorithm.</t>
          <t indent="0" pn="section-2.1.7-3">Examples of non-authenticated algorithms that can be used as Group Encryption Algorithm are A128CTR, A192CTR, and A256CTR (see <xref section="4" sectionFormat="of" target="RFC9459" format="default" derivedLink="https://rfc-editor.org/rfc/rfc9459#section-4" derivedContent="RFC9459"/>). When either of those three algorithms is used, the following applies:</t>
          <ul spacing="normal" bare="false" empty="false" indent="3" pn="section-2.1.7-4">
            <li pn="section-2.1.7-4.1">
              <t indent="0" pn="section-2.1.7-4.1.1">A 12-byte nonce <bcp14>MUST</bcp14> be computed as defined in <xref target="sec-cose-object-aead-nonce" format="default" sectionFormat="of" derivedContent="Section 3.3"/>.</t>
            </li>
            <li pn="section-2.1.7-4.2">
              <t indent="0" pn="section-2.1.7-4.2.1">The Initialization Vector (IV) used in <xref section="4" sectionFormat="of" target="RFC9459" format="default" derivedLink="https://rfc-editor.org/rfc/rfc9459#section-4" derivedContent="RFC9459"/> is equivalent to the nonce above (12 bytes) concatenated with 0x00000000 (4 bytes) in this order.</t>
            </li>
            <li pn="section-2.1.7-4.3">
              <t indent="0" pn="section-2.1.7-4.3.1">The algorithm <bcp14>MUST NOT</bcp14> be used to encrypt a plaintext or decrypt a ciphertext whose length is larger than 64 GB (i.e., 2<sup>36</sup> bytes).</t>
            </li>
          </ul>
          <t indent="0" pn="section-2.1.7-5">The non-authenticated algorithms A128CBC, A192CBC, and A256CBC (see <xref section="5" sectionFormat="of" target="RFC9459" format="default" derivedLink="https://rfc-editor.org/rfc/rfc9459#section-5" derivedContent="RFC9459"/>) <bcp14>MUST NOT</bcp14> be used as Group Encryption Algorithm.</t>
          <t indent="0" pn="section-2.1.7-6">Future specifications can admit alternative non-authenticated algorithms that can be used as Group Encryption Algorithm. When doing so, it <bcp14>MUST</bcp14> be defined how to securely compose the IV and possible intermediate values used in the algorithm, building on the nonce computed as defined in <xref target="sec-cose-object-aead-nonce" format="default" sectionFormat="of" derivedContent="Section 3.3"/>. Absent such a specification, alternative non-authenticated algorithms <bcp14>MUST NOT</bcp14> be used as Group Encryption Algorithm.</t>
        </section>
        <section anchor="ssec-common-context-cs-alg" numbered="true" removeInRFC="false" toc="include" pn="section-2.1.8">
          <name slugifiedName="name-signature-algorithm">Signature Algorithm</name>
          <t indent="0" pn="section-2.1.8-1">The new parameter Signature Algorithm identifies the digital signature algorithm used for computing and verifying the countersignature on the COSE object (see Sections <xref target="RFC9338" section="3.2" sectionFormat="bare" format="default" derivedLink="https://rfc-editor.org/rfc/rfc9338#section-3.2" derivedContent="RFC9338"/> and <xref target="RFC9338" section="3.3" sectionFormat="bare" format="default" derivedLink="https://rfc-editor.org/rfc/rfc9338#section-3.3" derivedContent="RFC9338"/> of <xref target="RFC9338" format="default" sectionFormat="of" derivedContent="RFC9338"/>) when messages are protected in group mode (see <xref target="mess-processing" format="default" sectionFormat="of" derivedContent="Section 7"/>). If this parameter is not set, the group mode is not used in the group.</t>
        </section>
        <section anchor="ssec-common-context-group-enc-key" numbered="true" removeInRFC="false" toc="include" pn="section-2.1.9">
          <name slugifiedName="name-signature-encryption-key">Signature Encryption Key</name>
          <t indent="0" pn="section-2.1.9-1">The new parameter Signature Encryption Key specifies the symmetric key for deriving a keystream to encrypt/decrypt a countersignature (see <xref target="sssec-encrypted-signature-keystream" format="default" sectionFormat="of" derivedContent="Section 4.2"/>) when a message is protected in group mode (see <xref target="mess-processing" format="default" sectionFormat="of" derivedContent="Section 7"/>).</t>
          <t indent="0" pn="section-2.1.9-2">The Signature Encryption Key is derived as defined for Sender Keys and Recipient Keys in <xref section="3.2.1" sectionFormat="of" target="RFC8613" format="default" derivedLink="https://rfc-editor.org/rfc/rfc8613#section-3.2.1" derivedContent="RFC8613"/> with the following differences:</t>
          <ul spacing="normal" bare="false" empty="false" indent="3" pn="section-2.1.9-3">
            <li pn="section-2.1.9-3.1">
              <t indent="0" pn="section-2.1.9-3.1.1">The 'id' element of the 'info' array is the empty byte string.</t>
            </li>
            <li pn="section-2.1.9-3.2">
              <t indent="0" pn="section-2.1.9-3.2.1">The 'alg_aead' element of the 'info' array specifies the Group Encryption Algorithm from the Common Context (see <xref target="ssec-common-context-cs-enc-alg" format="default" sectionFormat="of" derivedContent="Section 2.1.7"/>), encoded as a CBOR integer or text string, consistently with the "Value" field in the "COSE Algorithms" registry for this algorithm.</t>
            </li>
            <li pn="section-2.1.9-3.3">
              <t indent="0" pn="section-2.1.9-3.3.1">The 'type' element of the 'info' array is "SEKey". The label is an ASCII string and does not include a trailing NUL byte.</t>
            </li>
            <li pn="section-2.1.9-3.4">
              <t indent="0" pn="section-2.1.9-3.4.1">L and the 'L' element of the 'info' array are the size of the key for the Group Encryption Algorithm specified in the Common Context (see <xref target="ssec-common-context-cs-enc-alg" format="default" sectionFormat="of" derivedContent="Section 2.1.7"/>) in bytes. While the obtained Signature Encryption Key is never used with the Group Encryption Algorithm, its length was chosen to obtain a matching level of security.</t>
            </li>
          </ul>
        </section>
        <section anchor="ssec-common-context-dh-alg" numbered="true" removeInRFC="false" toc="include" pn="section-2.1.10">
          <name slugifiedName="name-pairwise-key-agreement-algo">Pairwise Key Agreement Algorithm</name>
          <t indent="0" pn="section-2.1.10-1">The new parameter Pairwise Key Agreement Algorithm identifies the Elliptic Curve Diffie-Hellman (ECDH) algorithm used to derive a static-static Diffie-Hellman shared secret, from which pairwise keys are derived (see <xref target="key-derivation-pairwise" format="default" sectionFormat="of" derivedContent="Section 2.5.1"/>) to protect messages with the pairwise mode (see <xref target="sec-pairwise-protection" format="default" sectionFormat="of" derivedContent="Section 8"/>). If this parameter is not set, the pairwise mode is not used in the group.</t>
          <t indent="0" pn="section-2.1.10-2">When two endpoints compute their Diffie-Hellman shared secret, the Pairwise Key Agreement Algorithm takes the static-static Diffie-Hellman keys of the two endpoints as input. The lifetime of those keys is the same as the lifetime of the authentication credentials that the two endpoints use in the group. As detailed in <xref target="key-derivation-pairwise" format="default" sectionFormat="of" derivedContent="Section 2.5.1"/>, the derivation of the pairwise keys takes not only the Diffie-Hellman shared secret as input, but also group keying material from the latest established Security Context.</t>
          <t indent="0" pn="section-2.1.10-3">If the HKDF Algorithm specified in the Common Context is "HKDF SHA-256" (identified as "HMAC 256/256"), then the Pairwise Key Agreement Algorithm is "ECDH-SS + HKDF-256" (COSE algorithm encoding: -27).</t>
          <t indent="0" pn="section-2.1.10-4">If the HKDF Algorithm specified in the Common Context is "HKDF SHA-512" (identified as "HMAC 512/512"), then the Pairwise Key Agreement Algorithm is "ECDH-SS + HKDF-512" (COSE algorithm encoding: -28).</t>
          <t indent="0" pn="section-2.1.10-5">Note that the HKDF Algorithm in the Common Context is denoted by the corresponding COSE HMAC Algorithm. For example, the HKDF Algorithm "HKDF SHA-256" is specified as the HMAC Algorithm "HMAC 256/256".</t>
          <t indent="0" pn="section-2.1.10-6">More generally, if Pairwise Key Agreement Algorithm is set, it <bcp14>MUST</bcp14> identify a COSE algorithm such that i) it performs a direct ECDH Static-Static key agreement, and ii) it indicates the use of the same HKDF Algorithm used in the group as specified in the Common Context.</t>
        </section>
      </section>
      <section anchor="ssec-sender-recipient-context" numbered="true" removeInRFC="false" toc="include" pn="section-2.2">
        <name slugifiedName="name-sender-context-and-recipien">Sender Context and Recipient Context</name>
        <t indent="0" pn="section-2.2-1">The Sender ID <bcp14>SHALL</bcp14> be unique for each endpoint in a group with a certain triplet (Master Secret, Master Salt, Group Identifier); see <xref section="3.3" sectionFormat="of" target="RFC8613" format="default" derivedLink="https://rfc-editor.org/rfc/rfc8613#section-3.3" derivedContent="RFC8613"/>.</t>
        <t indent="0" pn="section-2.2-2">The maximum length of a Sender ID in bytes equals L minus 6, where L is determined as follows.</t>
        <ul spacing="normal" bare="false" empty="false" indent="3" pn="section-2.2-3">
          <li pn="section-2.2-3.1">
            <t indent="0" pn="section-2.2-3.1.1">If only one among the AEAD Algorithm and the Group Encryption Algorithm is set (see Sections <xref target="ssec-common-context-aead-alg" format="counter" sectionFormat="of" derivedContent="2.1.1"/> and <xref target="ssec-common-context-cs-enc-alg" format="counter" sectionFormat="of" derivedContent="2.1.7"/>), then L is the nonce length for the set algorithm.</t>
          </li>
          <li pn="section-2.2-3.2">
            <t indent="0" pn="section-2.2-3.2.1">If both the AEAD Algorithm and the Group Encryption Algorithm are set, then L is the smallest nonce length among those of the two algorithms.</t>
          </li>
        </ul>
        <t indent="0" pn="section-2.2-4">With the exception of the authentication credential of the sender endpoint, a receiver endpoint can derive a complete Security Context from a received Group OSCORE message and the Common Context (see <xref target="ssec-establishment-context-parameters" format="default" sectionFormat="of" derivedContent="Section 2.3"/>).</t>
        <t indent="0" pn="section-2.2-5">The authentication credentials in the Recipient Contexts and other information (e.g., the Sender IDs) associated with group members can be retrieved from the Group Manager upon joining the group (see <xref target="group-manager" format="default" sectionFormat="of" derivedContent="Section 12"/>). An authentication credential and other information associated with a group member can alternatively be acquired from the Group Manager at a later time, for example, the first time a message is received from a particular endpoint in the group (see Sections <xref target="ssec-verify-request" format="counter" sectionFormat="of" derivedContent="7.2"/> and <xref target="ssec-verify-response" format="counter" sectionFormat="of" derivedContent="7.4"/>).</t>
        <t indent="0" pn="section-2.2-6">For severely constrained devices, it may be infeasible to simultaneously handle the ongoing processing of a recently received message in parallel with the retrieval of the sender endpoint's authentication credential. Such devices can be configured to drop a received message for which there is no (complete) Recipient Context and retrieve the sender endpoint's authentication credential in order to have it available to verify subsequent messages from that endpoint.</t>
        <t indent="0" pn="section-2.2-7">An endpoint may admit a maximum number of Recipient Contexts for the same Security Context, e.g., due to memory limitations. After reaching that limit, the endpoint has to delete a current Recipient Context to install a new one (see <xref target="ssec-loss-mutable-context-overflow" format="default" sectionFormat="of" derivedContent="Section 2.6.1.2"/>). It is up to the application to define the maximum number of Recipient Contexts for the same Security Context as well as policies for deleting Recipient Contexts.</t>
      </section>
      <section anchor="ssec-establishment-context-parameters" numbered="true" removeInRFC="false" toc="include" pn="section-2.3">
        <name slugifiedName="name-establishment-of-security-c">Establishment of Security Context Parameters</name>
        <t indent="0" pn="section-2.3-1">OSCORE defines the derivation of Sender Context and Recipient Context (specifically, of Sender Keys and Recipient Keys) and of the Common IV from a set of input parameters (see <xref section="3.2" sectionFormat="of" target="RFC8613" format="default" derivedLink="https://rfc-editor.org/rfc/rfc8613#section-3.2" derivedContent="RFC8613"/>).</t>
        <t indent="0" pn="section-2.3-2">The derivation of Sender Keys, Recipient Keys, and Common IV defined in OSCORE applies also to Group OSCORE with the following modifications compared to <xref section="3.2.1" sectionFormat="of" target="RFC8613" format="default" derivedLink="https://rfc-editor.org/rfc/rfc8613#section-3.2.1" derivedContent="RFC8613"/>:</t>
        <ul spacing="normal" bare="false" empty="false" indent="3" pn="section-2.3-3">
          <li pn="section-2.3-3.1">
            <t indent="0" pn="section-2.3-3.1.1">If Group Encryption Algorithm in the Common Context is set (see <xref target="ssec-common-context-cs-enc-alg" format="default" sectionFormat="of" derivedContent="Section 2.1.7"/>), then the 'alg_aead' element of the 'info' array <bcp14>MUST</bcp14> specify Group Encryption Algorithm from the Common Context as a CBOR integer or text string, consistently with the "Value" field in the "COSE Algorithms" registry for this algorithm.</t>
          </li>
          <li pn="section-2.3-3.2">
            <t indent="0" pn="section-2.3-3.2.1">If Group Encryption Algorithm in the Common Context is not set, then the 'alg_aead' element of the 'info' array <bcp14>MUST</bcp14> specify AEAD Algorithm from the Common Context (see <xref target="ssec-common-context-aead-alg" format="default" sectionFormat="of" derivedContent="Section 2.1.1"/>), as per <xref section="3.2.1" sectionFormat="of" target="RFC8613" format="default" derivedLink="https://rfc-editor.org/rfc/rfc8613#section-3.2.1" derivedContent="RFC8613"/>.</t>
          </li>
          <li pn="section-2.3-3.3">
            <t indent="0" pn="section-2.3-3.3.1">When deriving the Common IV, the 'L' element of the 'info' array <bcp14>MUST</bcp14> specify the length of the Common IV in bytes, which is determined as defined in <xref target="ssec-common-common-iv" format="default" sectionFormat="of" derivedContent="Section 2.1.4"/>.</t>
          </li>
        </ul>
      </section>
      <section anchor="sec-pub-key-format" numbered="true" removeInRFC="false" toc="include" pn="section-2.4">
        <name slugifiedName="name-authentication-credentials">Authentication Credentials</name>
        <t indent="0" pn="section-2.4-1">The authentication credentials of the endpoints in a group <bcp14>MUST</bcp14> be encoded according to the format used in the group as indicated by the Authentication Credential Format parameter in the Common Context (see <xref target="ssec-common-context-authcred-format" format="default" sectionFormat="of" derivedContent="Section 2.1.5"/>). The authentication credential of the Group Manager <bcp14>SHOULD</bcp14> be encoded according to that same format in order to limit the number of formats that the group members have to support and handle, unless it is infeasible or impractical for the particular realization or instance of the Group Manager to have an own authentication credential encoded in that same format.</t>
        <t indent="0" pn="section-2.4-2">The format of authentication credentials <bcp14>MUST</bcp14> provide the public key and a comprehensive set of information related to the public key algorithm, including, e.g., the used elliptic curve (when applicable). If Group Encryption Algorithm in the Common Context is not set (see <xref target="ssec-common-context-cs-enc-alg" format="default" sectionFormat="of" derivedContent="Section 2.1.7"/>), then the public key algorithm is the Pairwise Key Agreement Algorithm used in the group (see <xref target="ssec-common-context-dh-alg" format="default" sectionFormat="of" derivedContent="Section 2.1.10"/>); otherwise, the Signature Algorithm used in the group (see <xref target="ssec-common-context-cs-alg" format="default" sectionFormat="of" derivedContent="Section 2.1.8"/>).</t>
        <t indent="0" pn="section-2.4-3">Examples of formats of authentication credentials are CWTs and CCSs <xref target="RFC8392" format="default" sectionFormat="of" derivedContent="RFC8392"/>, X.509 certificates <xref target="RFC5280" format="default" sectionFormat="of" derivedContent="RFC5280"/>, and C509 certificates <xref target="I-D.ietf-cose-cbor-encoded-cert" format="default" sectionFormat="of" derivedContent="C509-CERT"/>.</t>
        <t indent="0" pn="section-2.4-4">If the authentication credentials are X.509 certificates or C509 certificates, the public key algorithm is identified by the "algorithm" field of the "SubjectPublicKeyInfo" structure and by the "subjectPublicKeyAlgorithm" element, respectively.</t>
        <t indent="0" pn="section-2.4-5">If authentication credentials are CWTs or CCSs, then a COSE Key structure and its "kty" and "crv" parameters identify the types of pertinent public key algorithms. For example, the pair ("crv" = X25519, "kty" = OKP) indicates that the public key is meant to be used with X25519 ECDH key agreement; the pair ("crv" = Ed25519, "kty" = OKP) indicates that the public key is meant to be used with the Edwards-curve Digital Signature Algorithm (EdDSA); and the pair ("crv" = P-256, "kty" = EC2) indicates that the public key is meant to be used with the Elliptic Curve Digital Signature Algorithm (ECDSA) and/or with P-256 ECDH key agreement.</t>
        <t indent="0" pn="section-2.4-6">Authentication credentials are used to derive pairwise keys (see <xref target="key-derivation-pairwise" format="default" sectionFormat="of" derivedContent="Section 2.5.1"/>) and are included in the external Additional Authenticated Data (AAD) when processing messages (see <xref target="sec-cose-object-ext-aad" format="default" sectionFormat="of" derivedContent="Section 3.4"/>). In both of these cases, an endpoint in a group <bcp14>MUST</bcp14> treat authentication credentials as opaque data, i.e., by considering the same binary representation made available to other endpoints in the group, possibly through a designated trusted source (e.g., the Group Manager).</t>
        <t indent="0" pn="section-2.4-7">For example, an X.509 certificate is provided as its direct binary serialization. If C509 certificates or CWTs are used as authentication credentials, each is provided as the binary serialization of a (possibly tagged) CBOR array. If CCSs are used as authentication credentials, each is provided as the binary serialization of a (possibly tagged) CBOR map.</t>
        <t indent="0" pn="section-2.4-8">If authentication credentials are CWTs or CCSs, then the untagged CWT or CCS associated with an entity is stored in the Security Context and used as authentication credential for that entity.</t>
        <t indent="0" pn="section-2.4-9">If authentication credentials are X.509/C509 certificates, CWTs, or CCSs and the authentication credential associated with an entity is provided within a chain or a bag, then only the end-entity certificate or end-entity untagged CWT/CCS is stored in the Security Context and used as authentication credential for that entity.</t>
        <t indent="0" pn="section-2.4-10">Storing whole authentication credentials rather than only a subset of those may result in a non-negligible storage overhead. On the other hand, it also ensures that authentication credentials are correctly used in a simple, flexible, and non-error-prone way, also taking into account future credential formats as entirely new or extending existing ones. In particular, it is ensured that:</t>
        <ul spacing="normal" bare="false" empty="false" indent="3" pn="section-2.4-11">
          <li pn="section-2.4-11.1">
            <t indent="0" pn="section-2.4-11.1.1">When used to derive pairwise keys and when included in the external AAD, authentication credentials can also specify possible metadata and parameters related to the included public key. Besides the public key algorithm, these comprise other relevant pieces of information such as key usage, expiration time, issuer, and subject.</t>
          </li>
          <li pn="section-2.4-11.2">
            <t indent="0" pn="section-2.4-11.2.1">All endpoints using another endpoint's authentication credential use exactly the same binary serialization, as obtained and distributed by the credential provider (e.g., the Group Manager), and as originally crafted by the credential issuer. In turn, this does not require to define and maintain canonical subsets of authentication credentials and their corresponding encoding and spares endpoints from error-prone re-encoding operations.</t>
          </li>
        </ul>
        <t indent="0" pn="section-2.4-12">Depending on the particular deployment and the intended group size, limiting the storage overhead of endpoints in a group can be an incentive for system/network administrators to prefer using a compact format of authentication credentials in the first place.</t>
      </section>
      <section anchor="sec-derivation-pairwise" numbered="true" removeInRFC="false" toc="include" pn="section-2.5">
        <name slugifiedName="name-pairwise-keys">Pairwise Keys</name>
        <t indent="0" pn="section-2.5-1">In certain Elliptic Curve Cryptographic schemes, it is possible to use public/private key pairs with both signature operations (ECDSA or EdDSA) and key agreement operations (ECDH). This section specifies the derivation of "pairwise keys" for use in the pairwise mode defined in <xref target="sec-pairwise-protection" format="default" sectionFormat="of" derivedContent="Section 8"/>.</t>
        <t indent="0" pn="section-2.5-2">Group OSCORE keys used for both signature operations and key agreement operations <bcp14>MUST</bcp14> be used only for purposes related to Group OSCORE. These include the processing of messages with Group OSCORE, as well as performing proof of possession of private keys, e.g., upon joining a group through the Group Manager (see <xref target="group-manager" format="default" sectionFormat="of" derivedContent="Section 12"/>).</t>
        <section anchor="key-derivation-pairwise" numbered="true" removeInRFC="false" toc="include" pn="section-2.5.1">
          <name slugifiedName="name-derivation-of-pairwise-keys">Derivation of Pairwise Keys</name>
          <t indent="0" pn="section-2.5.1-1">Using the Group OSCORE Security Context (see <xref target="sec-context" format="default" sectionFormat="of" derivedContent="Section 2"/>), a group member can derive AEAD keys to protect point-to-point communication between itself and each other endpoint X in the group by means of the AEAD Algorithm from the Common Context (see <xref target="ssec-common-context-aead-alg" format="default" sectionFormat="of" derivedContent="Section 2.1.1"/>).</t>
          <t indent="0" pn="section-2.5.1-2">Analogous to the construction used by OSCORE in <xref section="3.2.1" sectionFormat="of" target="RFC8613" format="default" derivedLink="https://rfc-editor.org/rfc/rfc8613#section-3.2.1" derivedContent="RFC8613"/>, the key derivation of these so-called pairwise keys relies on an HKDF Algorithm and is as defined below:</t>
          <artwork align="left" pn="section-2.5.1-3">
Pairwise Sender Key    = HKDF(Sender Key, IKM-Sender, info, L)
Pairwise Recipient Key = HKDF(Recipient Key, IKM-Recipient, info, L)

with

IKM-Sender    = Sender Auth Cred | Recipient Auth Cred | Shared Secret
IKM-Recipient = Recipient Auth Cred | Sender Auth Cred | Shared Secret
</artwork>
          <t indent="0" pn="section-2.5.1-4">where:</t>
          <ul spacing="normal" bare="false" empty="false" indent="3" pn="section-2.5.1-5">
            <li pn="section-2.5.1-5.1">
              <t indent="0" pn="section-2.5.1-5.1.1">The Pairwise Sender Key is the AEAD key for processing outgoing messages addressed to endpoint X.</t>
            </li>
            <li pn="section-2.5.1-5.2">
              <t indent="0" pn="section-2.5.1-5.2.1">The Pairwise Recipient Key is the AEAD key for processing incoming messages from endpoint X.</t>
            </li>
            <li pn="section-2.5.1-5.3">
              <t indent="0" pn="section-2.5.1-5.3.1">HKDF is the OSCORE HKDF Algorithm <xref target="RFC8613" format="default" sectionFormat="of" derivedContent="RFC8613"/> from the Common Context.</t>
            </li>
            <li pn="section-2.5.1-5.4">
              <t indent="0" pn="section-2.5.1-5.4.1">The Sender Key from the Sender Context is used as salt in the HKDF when deriving the Pairwise Sender Key.</t>
            </li>
            <li pn="section-2.5.1-5.5">
              <t indent="0" pn="section-2.5.1-5.5.1">The Recipient Key from the Recipient Context associated with endpoint X is used as salt in the HKDF, when deriving the Pairwise Recipient Key.</t>
            </li>
            <li pn="section-2.5.1-5.6">
              <t indent="0" pn="section-2.5.1-5.6.1">Sender Auth Cred is the endpoint's own authentication credential from the Sender Context.</t>
            </li>
            <li pn="section-2.5.1-5.7">
              <t indent="0" pn="section-2.5.1-5.7.1">Recipient Auth Cred is the endpoint X's authentication credential from the Recipient Context associated with endpoint X.</t>
            </li>
            <li pn="section-2.5.1-5.8">
              <t indent="0" pn="section-2.5.1-5.8.1">The Shared Secret is computed as a cofactor Diffie-Hellman shared secret (see Section 5.7.1.2 of <xref target="NIST-800-56A" format="default" sectionFormat="of" derivedContent="NIST-800-56A"/>) using the Pairwise Key Agreement Algorithm. The endpoint uses its private key from the Sender Context and the other endpoint's public key included in Recipient Auth Cred. Note the requirement of validation of public keys in <xref target="ssec-crypto-considerations" format="default" sectionFormat="of" derivedContent="Section 13.16"/>.  </t>
              <t indent="0" pn="section-2.5.1-5.8.2">
If the other endpoint's public key has COSE Key Type "EC2" <xref target="RFC9053" format="default" sectionFormat="of" derivedContent="RFC9053"/> (e.g., for the curves P-256, P-384, and P-521), then the public key is used as is. If the other endpoint's public key has COSE Key Type "OKP" <xref target="RFC9053" format="default" sectionFormat="of" derivedContent="RFC9053"/>, the procedure is described in <xref section="5" sectionFormat="of" target="RFC7748" format="default" derivedLink="https://rfc-editor.org/rfc/rfc7748#section-5" derivedContent="RFC7748"/>. In particular, if the public key is for X25519 or X448, it is used as is. Otherwise, if the public key is for the curve Ed25519 or Ed448, it is first mapped to Montgomery coordinates (see <xref target="montgomery" format="default" sectionFormat="of" derivedContent="Section 2.5.2"/>).</t>
            </li>
            <li pn="section-2.5.1-5.9">
              <t indent="0" pn="section-2.5.1-5.9.1">IKM-Sender is the Input Keying Material (IKM) used in the HKDF for the derivation of the Pairwise Sender Key. IKM-Sender is the byte string concatenation of Sender Auth Cred, Recipient Auth Cred, and the Shared Secret. The authentication credentials Sender Auth Cred and Recipient Auth Cred are binary-encoded as defined in <xref target="sec-pub-key-format" format="default" sectionFormat="of" derivedContent="Section 2.4"/>.</t>
            </li>
            <li pn="section-2.5.1-5.10">
              <t indent="0" pn="section-2.5.1-5.10.1">IKM-Recipient is the IKM used in the HKDF for the derivation of the Pairwise Recipient Key. IKM-Recipient is the byte string concatenation of Recipient Auth Cred, Sender Auth Cred, and the Shared Secret. The authentication credentials Recipient Auth Cred and Sender Auth Cred are binary-encoded as defined in <xref target="sec-pub-key-format" format="default" sectionFormat="of" derivedContent="Section 2.4"/>.</t>
            </li>
            <li pn="section-2.5.1-5.11">
              <t indent="0" pn="section-2.5.1-5.11.1">info and L are as defined in <xref section="3.2.1" sectionFormat="of" target="RFC8613" format="default" derivedLink="https://rfc-editor.org/rfc/rfc8613#section-3.2.1" derivedContent="RFC8613"/>. That is:  </t>
              <ul spacing="normal" bare="false" empty="false" indent="3" pn="section-2.5.1-5.11.2">
                <li pn="section-2.5.1-5.11.2.1">
                  <t indent="0" pn="section-2.5.1-5.11.2.1.1">The 'alg_aead' element of the 'info' array takes the value of AEAD Algorithm from the Common Context (see <xref target="ssec-common-context-aead-alg" format="default" sectionFormat="of" derivedContent="Section 2.1.1"/>).</t>
                </li>
                <li pn="section-2.5.1-5.11.2.2">
                  <t indent="0" pn="section-2.5.1-5.11.2.2.1">L  and the 'L' element of the 'info' array are the size of the key for the AEAD Algorithm from the Common Context (see <xref target="ssec-common-context-aead-alg" format="default" sectionFormat="of" derivedContent="Section 2.1.1"/>) in bytes.</t>
                </li>
              </ul>
            </li>
          </ul>
          <t indent="0" pn="section-2.5.1-6">If EdDSA asymmetric keys are used, the Edward coordinates are mapped to Montgomery coordinates using the maps defined in Sections <xref target="RFC7748" section="4.1" sectionFormat="bare" format="default" derivedLink="https://rfc-editor.org/rfc/rfc7748#section-4.1" derivedContent="RFC7748"/> and <xref target="RFC7748" section="4.2" sectionFormat="bare" format="default" derivedLink="https://rfc-editor.org/rfc/rfc7748#section-4.2" derivedContent="RFC7748"/> of <xref target="RFC7748" format="default" sectionFormat="of" derivedContent="RFC7748"/> before using the X25519 or X448 function defined in <xref section="5" sectionFormat="of" target="RFC7748" format="default" derivedLink="https://rfc-editor.org/rfc/rfc7748#section-5" derivedContent="RFC7748"/>. For further details, see <xref target="montgomery" format="default" sectionFormat="of" derivedContent="Section 2.5.2"/>. Elliptic Curve Cryptography (ECC) asymmetric keys in Montgomery or Weierstrass form are used directly in the key agreement algorithm without coordinate mapping.</t>
          <t indent="0" pn="section-2.5.1-7">As long as any two group members preserve the same asymmetric keys, their Diffie-Hellman shared secret does not change across updates of the group keying material. The lifetime of those keys is the same as the lifetime of the authentication credentials Sender Auth Cred and Recipient Auth Cred.</t>
          <t indent="0" pn="section-2.5.1-8">After establishing a partially or completely new Security Context (see Sections <xref target="ssec-sec-context-persistence" format="counter" sectionFormat="of" derivedContent="2.6"/> and <xref target="sec-group-key-management" format="counter" sectionFormat="of" derivedContent="12.2"/>), the old pairwise keys <bcp14>MUST</bcp14> be deleted. Since new Sender/Recipient Keys are derived from the new group keying material (see <xref target="ssec-sender-recipient-context" format="default" sectionFormat="of" derivedContent="Section 2.2"/>), every group member <bcp14>MUST</bcp14> use the new Sender/Recipient Keys when deriving new pairwise keys.</t>
        </section>
        <section anchor="montgomery" numbered="true" removeInRFC="false" toc="include" pn="section-2.5.2">
          <name slugifiedName="name-ecdh-with-montgomery-coordi">ECDH with Montgomery Coordinates</name>
          <section anchor="curve25519" numbered="true" removeInRFC="false" toc="exclude" pn="section-2.5.2.1">
            <name slugifiedName="name-curve25519">Curve25519</name>
            <t indent="0" pn="section-2.5.2.1-1">The y-coordinate of the other endpoint's Ed25519 public key is decoded as specified in <xref section="5.1.3" sectionFormat="of" target="RFC8032" format="default" derivedLink="https://rfc-editor.org/rfc/rfc8032#section-5.1.3" derivedContent="RFC8032"/>. The Curve25519 u-coordinate is recovered as u = (1 + y) / (1 - y) (mod p) following the map in <xref section="4.1" sectionFormat="of" target="RFC7748" format="default" derivedLink="https://rfc-editor.org/rfc/rfc7748#section-4.1" derivedContent="RFC7748"/>. Note that the mapping is not defined for y = 1, and that y = -1 maps to u = 0, which corresponds to the neutral group element and thus will result in a degenerate shared secret. Therefore, implementations <bcp14>MUST</bcp14> abort if the y-coordinate of the other endpoint's Ed25519 public key is 1 or -1 (mod p).</t>
            <t indent="0" pn="section-2.5.2.1-2">The private signing key byte strings (i.e., the lower 32 bytes used for generating the public key; see Step 1 of <xref section="5.1.5" sectionFormat="of" target="RFC8032" format="default" derivedLink="https://rfc-editor.org/rfc/rfc8032#section-5.1.5" derivedContent="RFC8032"/>) are decoded the same way for signing in Ed25519 and scalar multiplication in X25519. Hence, in order to compute the shared secret, the endpoint applies the X25519 function to the Ed25519 private signing key byte string and the encoded u-coordinate byte string as specified in <xref section="5" sectionFormat="of" target="RFC7748" format="default" derivedLink="https://rfc-editor.org/rfc/rfc7748#section-5" derivedContent="RFC7748"/>.</t>
          </section>
          <section anchor="curve448" numbered="true" removeInRFC="false" toc="exclude" pn="section-2.5.2.2">
            <name slugifiedName="name-curve448">Curve448</name>
            <t indent="0" pn="section-2.5.2.2-1">The y-coordinate of the other endpoint's Ed448 public key is decoded as specified in <xref section="5.2.3" sectionFormat="of" target="RFC8032" format="default" derivedLink="https://rfc-editor.org/rfc/rfc8032#section-5.2.3" derivedContent="RFC8032"/>. The Curve448 u-coordinate is recovered as u = y<sup>2</sup> * (d * y<sup>2</sup> - 1) / (y<sup>2</sup> - 1) (mod p) following the map from "edwards448" in <xref section="4.2" sectionFormat="of" target="RFC7748" format="default" derivedLink="https://rfc-editor.org/rfc/rfc7748#section-4.2" derivedContent="RFC7748"/>, and also using the relation x<sup>2</sup> = (y<sup>2</sup> - 1)/(d * y<sup>2</sup> - 1) from the curve equation. Note that the mapping is not defined for y = 1 or -1. Therefore, implementations <bcp14>MUST</bcp14> abort if the y-coordinate of the peer endpoint's Ed448 public key is 1 or -1 (mod p).</t>
            <t indent="0" pn="section-2.5.2.2-2">The private signing key byte strings (i.e., the lower 57 bytes used for generating the public key, see Step 1 of <xref section="5.2.5" sectionFormat="of" target="RFC8032" format="default" derivedLink="https://rfc-editor.org/rfc/rfc8032#section-5.2.5" derivedContent="RFC8032"/>) are decoded the same way for signing in Ed448 and scalar multiplication in X448. Hence, in order to compute the shared secret, the endpoint applies the X448 function to the Ed448 private signing key byte string and the encoded u-coordinate byte string as specified in <xref section="5" sectionFormat="of" target="RFC7748" format="default" derivedLink="https://rfc-editor.org/rfc/rfc7748#section-5" derivedContent="RFC7748"/>.</t>
          </section>
        </section>
        <section anchor="pairwise-seqno" numbered="true" removeInRFC="false" toc="include" pn="section-2.5.3">
          <name slugifiedName="name-usage-of-sequence-numbers">Usage of Sequence Numbers</name>
          <t indent="0" pn="section-2.5.3-1">When using any of its Pairwise Sender Keys, a sender endpoint including the 'Partial IV' parameter in the protected message <bcp14>MUST</bcp14> use the current fresh value of the Sender Sequence Number from its Sender Context (see <xref target="ssec-sender-recipient-context" format="default" sectionFormat="of" derivedContent="Section 2.2"/>). That is, the same Sender Sequence Number space is used for all outgoing messages protected with Group OSCORE, thus limiting both storage and complexity.</t>
          <t indent="0" pn="section-2.5.3-2">When combining communications with the group mode and the pairwise mode, this may result in the Partial IV values moving forward more often than when using OSCORE <xref target="RFC8613" format="default" sectionFormat="of" derivedContent="RFC8613"/>. This can happen when a client engages in frequent or long sequences of one-to-one exchanges with servers in the group, by sending requests over unicast. In turn, this contributes to a sooner exhaustion of the Sender Sequence Number space of the client, which would then require to take actions for deriving a new Sender Context before resuming communications in the group (see <xref target="ssec-wrap-around-partial-iv" format="default" sectionFormat="of" derivedContent="Section 2.6.2"/>).</t>
        </section>
        <section anchor="pairwise-implementation" numbered="true" removeInRFC="false" toc="include" pn="section-2.5.4">
          <name slugifiedName="name-security-context-for-pairwi">Security Context for Pairwise Mode</name>
          <t indent="0" pn="section-2.5.4-1">If the pairwise mode is supported, the Security Context additionally includes the Pairwise Key Agreement Algorithm and the pairwise keys as described at the beginning of <xref target="sec-context" format="default" sectionFormat="of" derivedContent="Section 2"/>.</t>
          <t indent="0" pn="section-2.5.4-2">The pairwise keys, as well as the shared secrets used in their derivation (see <xref target="key-derivation-pairwise" format="default" sectionFormat="of" derivedContent="Section 2.5.1"/>), may be stored in memory or recomputed every time they are needed. The shared secret only changes when a public/private key pair used for its derivation changes, which results in the pairwise keys also changing. Additionally, the pairwise keys change if the Sender ID changes or if a new Security Context is established for the group (see <xref target="sec-group-re-join" format="default" sectionFormat="of" derivedContent="Section 2.6.3"/>). In order to optimize protocol performance, an endpoint may store the derived pairwise keys for easy retrieval.</t>
          <t indent="0" pn="section-2.5.4-3">In the pairwise mode, the Sender Context includes the Pairwise Sender Keys to use with the other endpoints (see <xref target="fig-additional-context-information" format="default" sectionFormat="of" derivedContent="Figure 1"/>). In order to identify the right key to use, the Pairwise Sender Key for endpoint X may be associated with the Recipient ID of endpoint X, as defined in the Recipient Context (i.e., the Sender ID from the point of view of endpoint X). In this way, the Recipient ID can be used to lookup for the right Pairwise Sender Key. This association may be implemented in different ways, e.g., by storing the pair (Recipient ID, Pairwise Sender Key) or linking a Pairwise Sender Key to a Recipient Context.</t>
        </section>
      </section>
      <section anchor="ssec-sec-context-persistence" numbered="true" removeInRFC="false" toc="include" pn="section-2.6">
        <name slugifiedName="name-update-of-security-context">Update of Security Context</name>
        <t indent="0" pn="section-2.6-1">It is <bcp14>RECOMMENDED</bcp14> that the long-term part of the Security Context is stored in non-volatile memory, or that it can otherwise be reliably accessed throughout the operation of the group, e.g., after device reboots. However, data in the long-term part of the Security Context may also need to be updated, for example, due to scheduled key renewal, new or re-joining members in the group, or the fact that the endpoint changes Sender ID (see <xref target="sec-group-re-join" format="default" sectionFormat="of" derivedContent="Section 2.6.3"/>).</t>
        <t indent="0" pn="section-2.6-2">The data in the varying part of the Security Context are updated by the endpoint when executing the security protocol but may be lost (see <xref target="ssec-loss-mutable-context" format="default" sectionFormat="of" derivedContent="Section 2.6.1"/>) or become outdated by exhaustion of Sender Sequence Numbers (see <xref target="ssec-wrap-around-partial-iv" format="default" sectionFormat="of" derivedContent="Section 2.6.2"/>).</t>
        <section anchor="ssec-loss-mutable-context" numbered="true" removeInRFC="false" toc="include" pn="section-2.6.1">
          <name slugifiedName="name-loss-of-the-varying-part-of">Loss of the Varying Part of the Security Context</name>
          <t indent="0" pn="section-2.6.1-1">An endpoint may lose the varying part of its Security Context due to accidental events, e.g., if a reboot occurred in an unprepared way (see <xref target="ssec-loss-mutable-context-total" format="default" sectionFormat="of" derivedContent="Section 2.6.1.1"/>) or due to a deliberately deleted Recipient Context (see <xref target="ssec-loss-mutable-context-overflow" format="default" sectionFormat="of" derivedContent="Section 2.6.1.2"/>).</t>
          <t indent="0" pn="section-2.6.1-2">If it is not feasible or practically possible to store and maintain up-to-date the varying part in non-volatile memory (e.g., due to limited number of write operations), the endpoint <bcp14>MUST</bcp14> be able to detect a loss of the varying part of the Security Context in order to prevent the reuse of a nonce with the same key and to handle incoming replayed messages.</t>
          <section anchor="ssec-loss-mutable-context-total" numbered="true" removeInRFC="false" toc="exclude" pn="section-2.6.1.1">
            <name slugifiedName="name-accidental-loss-of-sender-c">Accidental Loss of Sender Context and/or Recipient Contexts</name>
            <t indent="0" pn="section-2.6.1.1-1">In the case that a loss of the Sender Context and/or of the Recipient Contexts is detected (e.g., if a reboot occurred in an unprepared way), the endpoint <bcp14>MUST NOT</bcp14> protect further messages using this Security Context to avoid reusing a nonce with the same key.</t>
            <t indent="0" pn="section-2.6.1.1-2">Before resuming its operations in the group, the endpoint <bcp14>MUST</bcp14> retrieve new Security Context parameters from the Group Manager (see <xref target="sec-group-re-join" format="default" sectionFormat="of" derivedContent="Section 2.6.3"/>) and use them to derive a new Sender Context and new Recipient Contexts (see <xref target="ssec-sender-recipient-context" format="default" sectionFormat="of" derivedContent="Section 2.2"/>). Since the new Sender Context includes newly derived encryption keys, an endpoint will not reuse the same pair (key, nonce), even when it is a server using the Partial IV of (old re-injected) requests to build the nonce for protecting the responses.</t>
            <t indent="0" pn="section-2.6.1.1-3">From then on, the endpoint <bcp14>MUST</bcp14> use the latest installed Sender Context to protect outgoing messages. Newly derived Recipient Contexts will have a Replay Window that is initialized as valid.</t>
            <t indent="0" pn="section-2.6.1.1-4">If an endpoint is not configured as a silent server and is not able to establish an updated Sender Context, e.g., because of lack of connectivity with the Group Manager, then the endpoint <bcp14>MUST NOT</bcp14> protect further messages using the current Security Context and <bcp14>MUST NOT</bcp14> accept incoming messages from other group members, as it is currently unable to detect possible replays.</t>
            <t indent="0" pn="section-2.6.1.1-5">If an endpoint is configured as a silent server and is not able to establish an updated Security Context, e.g., because of lack of connectivity with the Group Manager, then the endpoint <bcp14>MUST NOT</bcp14> accept incoming messages from other group members, as it is currently unable to detect possible replays.</t>
          </section>
          <section anchor="ssec-loss-mutable-context-overflow" numbered="true" removeInRFC="false" toc="exclude" pn="section-2.6.1.2">
            <name slugifiedName="name-deliberately-deleted-recipi">Deliberately Deleted Recipient Contexts</name>
            <t indent="0" pn="section-2.6.1.2-1">The Security Context may contain a large and variable number of Recipient Contexts. While Group OSCORE does not establish a maximum number of Recipient Contexts, there are circumstances by which implementations might choose to discard Recipient Contexts or have to do so in accordance with enforced application policies. Such circumstances include the need to reclaim memory or other resources on the node hosting the endpoint, for example, because the predefined maximum number of Recipient Contexts has been reached in the Security Context (see <xref target="ssec-sender-recipient-context" format="default" sectionFormat="of" derivedContent="Section 2.2"/>). Implementations can provide means for the application to gain knowledge about the deliberate deletion of Recipient Contexts, e.g., through notifications sent to the application and/or logs made available to the application.</t>
            <t indent="0" pn="section-2.6.1.2-2">When a Recipient Context is deleted, this not only results in losing information about previously received messages from the corresponding other endpoint, but it also results in the inability to be aware of the Security Contexts from which information has been lost.</t>
            <t indent="0" pn="section-2.6.1.2-3">Therefore, if the Recipient Context is derived again from the same Security Context, there is a risk that a replayed message is not detected. If any Recipient Context associated with any peer has ever been deleted from the current Security Context, then the Replay Window of any new Recipient Context in this Security Context <bcp14>MUST</bcp14> be initialized as invalid. An exception applies when the deleted Recipient Context was created upon receiving a message and that message was not verified successfully (see Sections <xref target="ssec-verify-request" format="counter" sectionFormat="of" derivedContent="7.2"/>, <xref target="ssec-verify-response" format="counter" sectionFormat="of" derivedContent="7.4"/>, <xref target="sec-pairwise-verify-req" format="counter" sectionFormat="of" derivedContent="8.4"/>, and <xref target="sec-pairwise-verify-resp" format="counter" sectionFormat="of" derivedContent="8.6"/>). Messages associated with a Recipient Context that has an invalid Replay Window <bcp14>MUST NOT</bcp14> be delivered to the application.</t>
            <t indent="0" pn="section-2.6.1.2-4">If the endpoint receives a message to be processed with any such new Recipient Context whose Replay Window is invalid, then the endpoint <bcp14>MUST</bcp14> take one of the following courses of action:</t>
            <ul spacing="normal" bare="false" empty="false" indent="3" pn="section-2.6.1.2-5">
              <li pn="section-2.6.1.2-5.1">
                <t indent="0" pn="section-2.6.1.2-5.1.1">The endpoint discards the message.</t>
              </li>
              <li pn="section-2.6.1.2-5.2">
                <t indent="0" pn="section-2.6.1.2-5.2.1">The endpoint follows the procedure based on the CoAP Echo Option <xref target="RFC9175" format="default" sectionFormat="of" derivedContent="RFC9175"/> and specified in <xref target="sec-synch-challenge-response" format="default" sectionFormat="of" derivedContent="Section 9"/> in order to establish a valid Replay Window. In particular, the endpoint <bcp14>MUST</bcp14> use its Partial IV when generating the nonce and <bcp14>MUST</bcp14> include the Partial IV in the response message conveying the Echo Option. If the endpoint supports the CoAP Echo Option, then it is <bcp14>RECOMMENDED</bcp14> to take this course of action.</t>
              </li>
              <li pn="section-2.6.1.2-5.3">
                <t indent="0" pn="section-2.6.1.2-5.3.1">The endpoint retrieves or waits for new Security Context parameters from the Group Manager and derives new Sender and Recipient Contexts as defined in <xref target="ssec-loss-mutable-context-total" format="default" sectionFormat="of" derivedContent="Section 2.6.1.1"/>. In this case, the Replay Windows of all Recipient Contexts become valid if they are not already. In particular, any invalid Replay Window is re-initialized as valid and with 0 as its current lower limit.</t>
              </li>
            </ul>
          </section>
        </section>
        <section anchor="ssec-wrap-around-partial-iv" numbered="true" removeInRFC="false" toc="include" pn="section-2.6.2">
          <name slugifiedName="name-exhaustion-of-sender-sequen">Exhaustion of Sender Sequence Number Space</name>
          <t indent="0" pn="section-2.6.2-1">Since an endpoint increments its Sender Sequence Number for each new outgoing message including a Partial IV, an endpoint can eventually exhaust the Sender Sequence Number space.</t>
          <t indent="0" pn="section-2.6.2-2">Implementations <bcp14>MUST</bcp14> be able to detect an exhaustion of Sender Sequence Number space after the endpoint has consumed the largest usable value. This may be influenced by additional limitations besides the mere 40-bit size limit of the Partial IV.</t>
          <t indent="0" pn="section-2.6.2-3">Upon exhausting the Sender Sequence Number space, the endpoint <bcp14>MUST NOT</bcp14> use this Security Context to protect further messages including a Partial IV.</t>
          <t indent="0" pn="section-2.6.2-4">When approaching the exhaustion of the Sender Sequence Number space, the endpoint <bcp14>SHOULD</bcp14> inform the Group Manager, retrieve new Security Context parameters from the Group Manager (see <xref target="sec-group-re-join" format="default" sectionFormat="of" derivedContent="Section 2.6.3"/>), and use them to derive a new Sender Context (see <xref target="ssec-sender-recipient-context" format="default" sectionFormat="of" derivedContent="Section 2.2"/>). It is <bcp14>RECOMMENDED</bcp14> that the endpoint takes this course of action with some margin, i.e., well before exhausting the Sender Sequence Number space, in order to avoid a period of inability to protect messages including a Partial IV.</t>
          <t indent="0" pn="section-2.6.2-5">From then on, the endpoint <bcp14>MUST</bcp14> use its latest installed Sender Context to protect outgoing messages.</t>
        </section>
        <section anchor="sec-group-re-join" numbered="true" removeInRFC="false" toc="include" pn="section-2.6.3">
          <name slugifiedName="name-retrieving-new-security-con">Retrieving New Security Context Parameters</name>
          <t indent="0" pn="section-2.6.3-1">The Group Manager can assist an endpoint with an incomplete Sender Context to retrieve missing data of the Security Context and thereby become fully operational in the group again. The two main options for the Group Manager are i) assignment of a new Sender ID to the endpoint (see <xref target="new-sender-id" format="default" sectionFormat="of" derivedContent="Section 2.6.3.1"/>), and ii) establishment of a new Security Context for the group (see <xref target="new-sec-context" format="default" sectionFormat="of" derivedContent="Section 2.6.3.2"/>). The update of the Replay Window in each of the Recipient Contexts is discussed in <xref target="ssec-loss-mutable-context" format="default" sectionFormat="of" derivedContent="Section 2.6.1"/>.</t>
          <t indent="0" pn="section-2.6.3-2">As group membership changes, or as group members get new Sender IDs (see <xref target="new-sender-id" format="default" sectionFormat="of" derivedContent="Section 2.6.3.1"/>), so do the relevant Recipient IDs that the other endpoints need to keep track of. As a consequence, group members may end up retaining stale Recipient Contexts that are no longer useful to verify incoming secure messages.</t>
          <t indent="0" pn="section-2.6.3-3">The Recipient ID ('kid') <bcp14>SHOULD NOT</bcp14> be considered as a persistent and reliable identifier of a group member. Such an indication can be achieved only by using that member's public key, when verifying countersignatures of received messages (in group mode), or when verifying messages integrity-protected with pairwise keying material derived from authentication credentials and associated asymmetric keys (in pairwise mode).</t>
          <t indent="0" pn="section-2.6.3-4">Furthermore, applications <bcp14>MAY</bcp14> define policies to delete (long-)unused Recipient Contexts and reduce the impact on storage space, and to check with the Group Manager that an authentication credential with the public key included therein is currently the one associated with a 'kid' value after a number of consecutive failed verifications.</t>
          <section anchor="new-sender-id" numbered="true" removeInRFC="false" toc="exclude" pn="section-2.6.3.1">
            <name slugifiedName="name-new-sender-id-for-the-endpo">New Sender ID for the Endpoint</name>
            <t indent="0" pn="section-2.6.3.1-1">The Group Manager may assign a new Sender ID to an endpoint, while leaving the Gid, Master Secret, and Master Salt unchanged in the group. In this case, the Group Manager assigns a Sender ID that has not been used in the group since the latest time when the current Gid value was assigned to the group (see <xref target="sec-group-key-management" format="default" sectionFormat="of" derivedContent="Section 12.2"/>).</t>
            <t indent="0" pn="section-2.6.3.1-2">Having retrieved the new Sender ID, and potentially other missing data for the long-term part of the Security Context, the endpoint can derive a new Sender Context (see <xref target="ssec-sender-recipient-context" format="default" sectionFormat="of" derivedContent="Section 2.2"/>). When doing so, the endpoint resets the Sender Sequence Number in its Sender Context to 0 and derives a new Sender Key. This is, in turn, used to possibly derive new Pairwise Sender Keys.</t>
            <t indent="0" pn="section-2.6.3.1-3">From then on, the endpoint <bcp14>MUST</bcp14> use its latest installed Sender Context to protect outgoing messages.</t>
            <t indent="0" pn="section-2.6.3.1-4">The assignment of a new Sender ID may be the result of different processes. The endpoint may request a new Sender ID, e.g., because of the impending exhaustion of the Sender Sequence Number space (see <xref target="ssec-wrap-around-partial-iv" format="default" sectionFormat="of" derivedContent="Section 2.6.2"/>). An endpoint may request to re-join the group, e.g., because of losing the varying part of its Security Context (see <xref target="ssec-loss-mutable-context" format="default" sectionFormat="of" derivedContent="Section 2.6.1"/>), and is provided with a new Sender ID together with the latest data for the long-term part of the Security Context.</t>
            <t indent="0" pn="section-2.6.3.1-5">For the other group members, the Recipient Context corresponding to the old Sender ID becomes stale (see <xref target="sec-group-key-management" format="default" sectionFormat="of" derivedContent="Section 12.2"/>).</t>
          </section>
          <section anchor="new-sec-context" numbered="true" removeInRFC="false" toc="exclude" pn="section-2.6.3.2">
            <name slugifiedName="name-new-security-context-for-th">New Security Context for the Group</name>
            <t indent="0" pn="section-2.6.3.2-1">The Group Manager may establish a new Security Context for the group (see <xref target="sec-group-key-management" format="default" sectionFormat="of" derivedContent="Section 12.2"/>). The Group Manager does not necessarily establish a new Security Context for the group if one member has an outdated Security Context (see <xref target="new-sender-id" format="default" sectionFormat="of" derivedContent="Section 2.6.3.1"/>) unless that was already planned or required for other reasons.</t>
            <t indent="0" pn="section-2.6.3.2-2">All the group members need to acquire new Security Context parameters from the Group Manager. Once having acquired new Security Context parameters, each group member performs the following actions:</t>
            <ul spacing="normal" bare="false" empty="false" indent="3" pn="section-2.6.3.2-3">
              <li pn="section-2.6.3.2-3.1">
                <t indent="0" pn="section-2.6.3.2-3.1.1">From then on, it <bcp14>MUST NOT</bcp14> use the current Security Context to start processing new messages for the considered group.</t>
              </li>
              <li pn="section-2.6.3.2-3.2">
                <t indent="0" pn="section-2.6.3.2-3.2.1">It completes any ongoing message processing for the considered group.</t>
              </li>
              <li pn="section-2.6.3.2-3.3">
                <t indent="0" pn="section-2.6.3.2-3.3.1">It derives and installs a new Security Context. In particular:  </t>
                <ul spacing="normal" bare="false" empty="false" indent="3" pn="section-2.6.3.2-3.3.2">
                  <li pn="section-2.6.3.2-3.3.2.1">
                    <t indent="0" pn="section-2.6.3.2-3.3.2.1.1">It re-derives the keying material stored in its Sender Context and Recipient Contexts (see <xref target="ssec-sender-recipient-context" format="default" sectionFormat="of" derivedContent="Section 2.2"/>). The Master Salt used for the re-derivations is the updated Master Salt parameter if provided by the Group Manager, or the empty byte string otherwise.</t>
                  </li>
                  <li pn="section-2.6.3.2-3.3.2.2">
                    <t indent="0" pn="section-2.6.3.2-3.3.2.2.1">It resets its Sender Sequence Number in its Sender Context to 0.</t>
                  </li>
                  <li pn="section-2.6.3.2-3.3.2.3">
                    <t indent="0" pn="section-2.6.3.2-3.3.2.3.1">It re-initializes the Replay Window of each Recipient Context as valid and with 0 as its current lower limit.</t>
                  </li>
                  <li pn="section-2.6.3.2-3.3.2.4">
                    <t indent="0" pn="section-2.6.3.2-3.3.2.4.1">For each long exchange where it is a client and that it wants to keep active, it sets the Response Number of each associated server as not initialized (see <xref target="sec-long-exchanges" format="default" sectionFormat="of" derivedContent="Section 5.1"/>).</t>
                  </li>
                </ul>
              </li>
            </ul>
            <t indent="0" pn="section-2.6.3.2-4">From then on, it can resume processing new messages for the considered group. In particular:</t>
            <ul spacing="normal" bare="false" empty="false" indent="3" pn="section-2.6.3.2-5">
              <li pn="section-2.6.3.2-5.1">
                <t indent="0" pn="section-2.6.3.2-5.1.1">It <bcp14>MUST</bcp14> use its latest installed Sender Context to protect outgoing messages.</t>
              </li>
              <li pn="section-2.6.3.2-5.2">
                <t indent="0" pn="section-2.6.3.2-5.2.1">It <bcp14>SHOULD</bcp14> use only its latest installed Recipient Contexts to process incoming messages, unless application policies admit to temporarily retain and use the old and recent Security Context (see <xref target="ssec-key-rotation-late-sender" format="default" sectionFormat="of" derivedContent="Section 13.5.1"/>).</t>
              </li>
            </ul>
            <t indent="0" pn="section-2.6.3.2-6">The distribution of a new Gid and Master Secret may result in temporarily misaligned Security Contexts among group members. In particular, this may result in a group member not being able to process messages received right after a new Gid and Master Secret have been distributed. A discussion on practical consequences and possible ways to address them, as well as on how to handle the old Security Context, is provided in <xref target="ssec-key-rotation" format="default" sectionFormat="of" derivedContent="Section 13.5"/>.</t>
          </section>
        </section>
      </section>
    </section>
    <section anchor="sec-cose-object" numbered="true" removeInRFC="false" toc="include" pn="section-3">
      <name slugifiedName="name-the-cose-object">The COSE Object</name>
      <t indent="0" pn="section-3-1">Building on <xref section="5" sectionFormat="of" target="RFC8613" format="default" derivedLink="https://rfc-editor.org/rfc/rfc8613#section-5" derivedContent="RFC8613"/>, this section defines how to use COSE <xref target="RFC9052" format="default" sectionFormat="of" derivedContent="RFC9052"/> to wrap and protect data in the original message. Like OSCORE, Group OSCORE uses the untagged COSE_Encrypt0 structure with an AEAD algorithm. Unless otherwise specified, the following modifications to what is defined for OSCORE apply for both the group mode and the pairwise mode of Group OSCORE.</t>
      <section anchor="sec-cose-object-unprotected-field" numbered="true" removeInRFC="false" toc="include" pn="section-3.1">
        <name slugifiedName="name-countersignature">Countersignature</name>
        <t indent="0" pn="section-3.1-1">When protecting a message in group mode, the 'unprotected' field <bcp14>MUST</bcp14> additionally include the following parameter:</t>
        <dl indent="3" newline="false" spacing="normal" pn="section-3.1-2">
          <dt pn="section-3.1-2.1">Countersignature0 version 2:</dt>
          <dd pn="section-3.1-2.2">
            <t indent="0" pn="section-3.1-2.2.1">Its value is set to the countersignature of the COSE object.</t>
          </dd>
          <dt pn="section-3.1-2.3"/>
          <dd pn="section-3.1-2.4">
            <t indent="0" pn="section-3.1-2.4.1">The countersignature is computed by the sender as described in Sections <xref target="RFC9338" section="3.2" sectionFormat="bare" format="default" derivedLink="https://rfc-editor.org/rfc/rfc9338#section-3.2" derivedContent="RFC9338"/> and <xref target="RFC9338" section="3.3" sectionFormat="bare" format="default" derivedLink="https://rfc-editor.org/rfc/rfc9338#section-3.3" derivedContent="RFC9338"/> of <xref target="RFC9338" format="default" sectionFormat="of" derivedContent="RFC9338"/> by using its private key and according to the Signature Algorithm in the Security Context.</t>
          </dd>
          <dt pn="section-3.1-2.5"/>
          <dd pn="section-3.1-2.6">
            <t indent="0" pn="section-3.1-2.6.1">In particular, the Countersign_structure contains the context text string "CounterSignature0", the external_aad as defined in <xref target="sec-cose-object-ext-aad" format="default" sectionFormat="of" derivedContent="Section 3.4"/> of this document, and the ciphertext of the COSE object as payload.</t>
          </dd>
        </dl>
        <section anchor="clarifications-on-using-a-countersignature" numbered="true" removeInRFC="false" toc="include" pn="section-3.1.1">
          <name slugifiedName="name-clarifications-on-using-a-c">Clarifications on Using a Countersignature</name>
          <t indent="0" pn="section-3.1.1-1">The literature commonly refers to a countersignature as a signature computed by an entity A over a document already protected by a different entity B.</t>
          <t indent="0" pn="section-3.1.1-2">However, the COSE_Countersignature0 structure belongs to the set of abbreviated countersignatures defined in Sections <xref target="RFC9338" section="3.2" sectionFormat="bare" format="default" derivedLink="https://rfc-editor.org/rfc/rfc9338#section-3.2" derivedContent="RFC9338"/> and <xref target="RFC9338" section="3.3" sectionFormat="bare" format="default" derivedLink="https://rfc-editor.org/rfc/rfc9338#section-3.3" derivedContent="RFC9338"/> of <xref target="RFC9338" format="default" sectionFormat="of" derivedContent="RFC9338"/>, which were designed primarily to deal with the problem of encrypted group messaging, but where it is required to know who originated the message.</t>
          <t indent="0" pn="section-3.1.1-3">Since the parameters for computing or verifying the abbreviated countersignature generated by A are provided by the same context used to describe the security processing performed by B and to be countersigned, these structures are applicable also when the two entities A and B are actually the same one, like the sender of a Group OSCORE message protected in group mode.</t>
        </section>
      </section>
      <section anchor="sec-cose-object-kid" numbered="true" removeInRFC="false" toc="include" pn="section-3.2">
        <name slugifiedName="name-the-kid-and-kid-context-par">The 'kid' and 'kid context' Parameters</name>
        <t indent="0" pn="section-3.2-1">The value of the 'kid' parameter in the 'unprotected' field of response messages <bcp14>MUST</bcp14> be set to the Sender ID of the endpoint transmitting the message if the request was protected in group mode. That is, unlike in <xref target="RFC8613" format="default" sectionFormat="of" derivedContent="RFC8613"/>, the 'kid' parameter is always present in responses to a request that was protected in group mode.</t>
        <t indent="0" pn="section-3.2-2">The value of the 'kid context' parameter in the 'unprotected' field of request messages <bcp14>MUST</bcp14> be set to the ID Context, i.e., the Gid of the group. That is, unlike in <xref target="RFC8613" format="default" sectionFormat="of" derivedContent="RFC8613"/>, the 'kid context' parameter is always present in requests.</t>
      </section>
      <section anchor="sec-cose-object-aead-nonce" numbered="true" removeInRFC="false" toc="include" pn="section-3.3">
        <name slugifiedName="name-nonce-computation">Nonce Computation</name>
        <t indent="0" pn="section-3.3-1">The nonce is constructed like in OSCORE, with the difference that Step 4 in <xref section="5.2" sectionFormat="of" target="RFC8613" format="default" derivedLink="https://rfc-editor.org/rfc/rfc8613#section-5.2" derivedContent="RFC8613"/> is replaced with:</t>
        <ol spacing="normal" type="1" start="4" indent="adaptive" pn="section-3.3-2"><li pn="section-3.3-2.1" derivedCounter="4.">
            <t indent="0" pn="section-3.3-2.1.1">and then XOR with X bytes from the Common IV's start, where X is the length in bytes of the nonce.</t>
          </li>
        </ol>
        <t indent="0" pn="section-3.3-3">For example, if X = 7 and the Common IV is 0x00112233445566778899aabbcc (13 bytes), then the bytes to XOR are 0x00112233445566 (7 bytes).</t>
        <t indent="0" pn="section-3.3-4">The constructed nonce is used both by the AEAD Algorithm (see <xref target="ssec-common-context-aead-alg" format="default" sectionFormat="of" derivedContent="Section 2.1.1"/>) and by the Group Encryption Algorithm (see <xref target="ssec-common-context-cs-enc-alg" format="default" sectionFormat="of" derivedContent="Section 2.1.7"/>), independent of whether they are AEAD or plain encryption algorithms. Algorithms that do not use a nonce are not supported, as per <xref target="ssec-common-context-cs-enc-alg" format="default" sectionFormat="of" derivedContent="Section 2.1.7"/>.</t>
      </section>
      <section anchor="sec-cose-object-ext-aad" numbered="true" removeInRFC="false" toc="include" pn="section-3.4">
        <name slugifiedName="name-additional-authenticated-da">Additional Authenticated Data</name>
        <t indent="0" pn="section-3.4-1">The external_aad of the AAD is different compared to OSCORE <xref target="RFC8613" format="default" sectionFormat="of" derivedContent="RFC8613"/> and is defined in this section.</t>
        <t indent="0" pn="section-3.4-2">The same external_aad structure is used in group mode and pairwise mode for encryption/decryption (see <xref section="5.3" sectionFormat="of" target="RFC9052" format="default" derivedLink="https://rfc-editor.org/rfc/rfc9052#section-5.3" derivedContent="RFC9052"/>), as well as in group mode for computing and verifying the countersignature (see Sections <xref target="RFC9338" section="3.2" sectionFormat="bare" format="default" derivedLink="https://rfc-editor.org/rfc/rfc9338#section-3.2" derivedContent="RFC9338"/> and <xref target="RFC9338" section="3.3" sectionFormat="bare" format="default" derivedLink="https://rfc-editor.org/rfc/rfc9338#section-3.3" derivedContent="RFC9338"/> of <xref target="RFC9338" format="default" sectionFormat="of" derivedContent="RFC9338"/>).</t>
        <t indent="0" pn="section-3.4-3">In particular, the external_aad includes also the Signature Algorithm, the Group Encryption Algorithm, the Pairwise Key Agreement Algorithm, the value of the 'kid context' in the COSE object of the request, the OSCORE Option of the protected message, the sender's authentication credential, and the Group Manager's authentication credential.</t>
        <t indent="0" pn="section-3.4-4">The external_aad <bcp14>SHALL</bcp14> be a CBOR array wrapped in a bstr object as defined below, following the notation of <xref target="RFC8610" format="default" sectionFormat="of" derivedContent="RFC8610"/>:</t>
        <figure anchor="fig-ext-aad" align="left" suppress-title="false" pn="figure-2">
          <name slugifiedName="name-external_aad">external_aad</name>
          <sourcecode type="cddl" markers="false" pn="section-3.4-5.1">
external_aad = bstr .cbor aad_array

aad_array = [
   oscore_version : uint,
   algorithms : [alg_aead : int / tstr / null,
                 alg_group_enc : int / tstr / null,
                 alg_signature : int / tstr / null,
                 alg_pairwise_key_agreement : int / tstr / null],
   request_kid : bstr,
   request_piv : bstr,
   options : bstr,
   request_kid_context : bstr,
   OSCORE_option : bstr,
   sender_cred : bstr,
   gm_cred : bstr
]
</sourcecode>
        </figure>
        <t indent="0" pn="section-3.4-6">Compared with <xref section="5.4" sectionFormat="of" target="RFC8613" format="default" derivedLink="https://rfc-editor.org/rfc/rfc8613#section-5.4" derivedContent="RFC8613"/>, the aad_array has the following differences:</t>
        <ul spacing="normal" bare="false" empty="false" indent="3" pn="section-3.4-7">
          <li pn="section-3.4-7.1">
            <t indent="0" pn="section-3.4-7.1.1">The 'algorithms' array is extended as follows.  </t>
            <t indent="0" pn="section-3.4-7.1.2">
The parameter 'alg_aead' <bcp14>MUST</bcp14> be set to the CBOR simple value <tt>null</tt> (0xf6) if the parameter AEAD Algorithm is not set in the Common Context of the Security Context used (see <xref target="ssec-common-context-aead-alg" format="default" sectionFormat="of" derivedContent="Section 2.1.1"/>). Otherwise, regardless of whether the endpoint supports the pairwise mode or not, this parameter <bcp14>MUST</bcp14> specify AEAD Algorithm from the Common Context (see <xref target="ssec-common-context-aead-alg" format="default" sectionFormat="of" derivedContent="Section 2.1.1"/>) as per <xref section="5.4" sectionFormat="of" target="RFC8613" format="default" derivedLink="https://rfc-editor.org/rfc/rfc8613#section-5.4" derivedContent="RFC8613"/>.  </t>
            <t indent="0" pn="section-3.4-7.1.3">
Furthermore, the 'algorithms' array additionally includes:  </t>
            <ul spacing="normal" bare="false" empty="false" indent="3" pn="section-3.4-7.1.4">
              <li pn="section-3.4-7.1.4.1">
                <t indent="0" pn="section-3.4-7.1.4.1.1">'alg_group_enc', which specifies Group Encryption Algorithm from the Common Context of the Security Context used (see <xref target="ssec-common-context-cs-enc-alg" format="default" sectionFormat="of" derivedContent="Section 2.1.7"/>). This parameter <bcp14>MUST</bcp14> be set to the CBOR simple value <tt>null</tt> (0xf6) if the parameter Group Encryption Algorithm in the Common Context is not set. Otherwise, regardless of whether the endpoint supports the group mode or not, this parameter <bcp14>MUST</bcp14> specify Group Encryption Algorithm as a CBOR integer or text string, consistently with the "Value" field in the "COSE Algorithms" registry for this algorithm.</t>
              </li>
              <li pn="section-3.4-7.1.4.2">
                <t indent="0" pn="section-3.4-7.1.4.2.1">'alg_signature', which specifies Signature Algorithm from the Common Context of the Security Context used (see <xref target="ssec-common-context-cs-alg" format="default" sectionFormat="of" derivedContent="Section 2.1.8"/>). This parameter <bcp14>MUST</bcp14> be set to the CBOR simple value <tt>null</tt> (0xf6) if the parameter Signature Algorithm in the Common Context is not set. Otherwise, regardless of whether the endpoint supports the group mode or not, this parameter <bcp14>MUST</bcp14> specify Signature Algorithm as a CBOR integer or text string, consistently with the "Value" field in the "COSE Algorithms" registry for this algorithm.</t>
              </li>
              <li pn="section-3.4-7.1.4.3">
                <t indent="0" pn="section-3.4-7.1.4.3.1">'alg_pairwise_key_agreement', which specifies Pairwise Key Agreement Algorithm from the Common Context of the Security Context used (see <xref target="ssec-common-context-dh-alg" format="default" sectionFormat="of" derivedContent="Section 2.1.10"/>). This parameter <bcp14>MUST</bcp14> be set to the CBOR simple value <tt>null</tt> (0xf6) if the parameter Pairwise Key Agreement Algorithm in the Common Context is not set. Otherwise, regardless of whether the endpoint supports the pairwise mode or not, this parameter <bcp14>MUST</bcp14> specify Pairwise Key Agreement Algorithm as a CBOR integer or text string, consistently with the "Value" field in the "COSE Algorithms" registry for this algorithm.</t>
              </li>
            </ul>
          </li>
          <li pn="section-3.4-7.2">
            <t indent="0" pn="section-3.4-7.2.1">The new element 'request_kid_context' contains the value of the 'kid context' in the COSE object of the request (see <xref target="sec-cose-object-kid" format="default" sectionFormat="of" derivedContent="Section 3.2"/>).  </t>
            <t indent="0" pn="section-3.4-7.2.2">
This enables endpoints to safely keep a long exchange active beyond a possible change of Gid (i.e., of ID Context), following a group rekeying (see <xref target="sec-group-key-management" format="default" sectionFormat="of" derivedContent="Section 12.2"/>). In fact, it ensures that every response within a long exchange cryptographically matches with only one request (i.e., the request associated with that long exchange) rather than with multiple requests that were protected with different keying material but share the same 'request_kid' and 'request_piv' values.</t>
          </li>
          <li pn="section-3.4-7.3">
            <t indent="0" pn="section-3.4-7.3.1">The new element 'OSCORE_option', containing the value of the OSCORE Option present in the protected message, encoded as a binary string. This prevents the attack described in <xref target="ssec-cross-group-injection" format="default" sectionFormat="of" derivedContent="Section 13.7"/> when using the group mode, as further explained  in <xref target="sssec-cross-group-injection-group-mode" format="default" sectionFormat="of" derivedContent="Section 13.7.2"/>.  </t>
            <t indent="0" pn="section-3.4-7.3.2">
Note for implementation: This construction requires the OSCORE Option of the message to be generated and finalized before computing the ciphertext of the COSE_Encrypt0 object (when using the group mode or the pairwise mode) and before calculating the countersignature (when using the group mode). Also, the aad_array needs to be large enough to contain the largest possible OSCORE Option.</t>
          </li>
          <li pn="section-3.4-7.4">
            <t indent="0" pn="section-3.4-7.4.1">The new element 'sender_cred', containing the sender's authentication credential. This parameter <bcp14>MUST</bcp14> be set to a CBOR byte string, which encodes the sender's authentication credential in its original binary representation made available to other endpoints in the group (see <xref target="sec-pub-key-format" format="default" sectionFormat="of" derivedContent="Section 2.4"/>).</t>
          </li>
          <li pn="section-3.4-7.5">
            <t indent="0" pn="section-3.4-7.5.1">The new element 'gm_cred', containing the Group Manager's authentication credential. This parameter <bcp14>MUST</bcp14> be set to a CBOR byte string, which encodes the Group Manager's authentication credential in its original binary representation made available to other endpoints in the group (see <xref target="sec-pub-key-format" format="default" sectionFormat="of" derivedContent="Section 2.4"/>). This prevents the attack described in <xref target="ssec-group-cloning" format="default" sectionFormat="of" derivedContent="Section 13.8"/>.</t>
          </li>
        </ul>
      </section>
    </section>
    <section anchor="compression" numbered="true" removeInRFC="false" toc="include" pn="section-4">
      <name slugifiedName="name-oscore-header-compression">OSCORE Header Compression</name>
      <t indent="0" pn="section-4-1">Group OSCORE relies on a header compression mechanism similar to the one used by OSCORE and specified in <xref target="compression-details" format="default" sectionFormat="of" derivedContent="Section 4.1"/>. Examples are provided in <xref target="compression-examples" format="default" sectionFormat="of" derivedContent="Section 4.3"/>.</t>
      <section anchor="compression-details" numbered="true" removeInRFC="false" toc="include" pn="section-4.1">
        <name slugifiedName="name-encoding-of-the-oscore-opti">Encoding of the OSCORE Option Value and Group OSCORE Payload</name>
        <t indent="0" pn="section-4.1-1">The OSCORE header compression defined in <xref section="6" sectionFormat="of" target="RFC8613" format="default" derivedLink="https://rfc-editor.org/rfc/rfc8613#section-6" derivedContent="RFC8613"/> is used for compactly encoding the COSE_Encrypt0 object specified in <xref target="sec-cose-object" format="default" sectionFormat="of" derivedContent="Section 3"/> of this document with the following differences:</t>
        <ul spacing="normal" bare="false" empty="false" indent="3" pn="section-4.1-2">
          <li pn="section-4.1-2.1">
            <t indent="0" pn="section-4.1-2.1.1">When the Group OSCORE message is protected in group mode, the message payload <bcp14>SHALL</bcp14> encode the ciphertext of the COSE object, concatenated with the encrypted countersignature of the COSE object. That is:  </t>
            <ul spacing="normal" bare="false" empty="false" indent="3" pn="section-4.1-2.1.2">
              <li pn="section-4.1-2.1.2.1">
                <t indent="0" pn="section-4.1-2.1.2.1.1">The plain, original countersignature of the COSE object, namely SIGNATURE, is specified in the "Countersignature0 version 2" parameter within the 'unprotected' field of the COSE object (see <xref target="sec-cose-object-unprotected-field" format="default" sectionFormat="of" derivedContent="Section 3.1"/>).</t>
              </li>
              <li pn="section-4.1-2.1.2.2">
                <t indent="0" pn="section-4.1-2.1.2.2.1">The encrypted countersignature, namely ENC_SIGNATURE, is computed as      </t>
                <t indent="0" pn="section-4.1-2.1.2.2.2">
ENC_SIGNATURE = SIGNATURE XOR KEYSTREAM      </t>
                <t indent="0" pn="section-4.1-2.1.2.2.3">
where KEYSTREAM is derived as per <xref target="sssec-encrypted-signature-keystream" format="default" sectionFormat="of" derivedContent="Section 4.2"/>.</t>
              </li>
            </ul>
          </li>
          <li pn="section-4.1-2.2">
            <t indent="0" pn="section-4.1-2.2.1">When the Group OSCORE message is protected in pairwise mode, the message payload <bcp14>SHALL</bcp14> encode the ciphertext of the COSE object.</t>
          </li>
          <li pn="section-4.1-2.3">
            <t indent="0" pn="section-4.1-2.3.1">This document defines the usage of the sixth least significant bit, called "Group Flag", in the first byte of the OSCORE Option value containing the OSCORE flag bits. This flag bit is specified in <xref target="iana-cons-flag-bits" format="default" sectionFormat="of" derivedContent="Section 14.1"/>.</t>
          </li>
          <li pn="section-4.1-2.4">
            <t indent="0" pn="section-4.1-2.4.1">The Group Flag <bcp14>MUST</bcp14> be set to 1 if the Group OSCORE message is protected using the group mode (see <xref target="mess-processing" format="default" sectionFormat="of" derivedContent="Section 7"/>).</t>
          </li>
          <li pn="section-4.1-2.5">
            <t indent="0" pn="section-4.1-2.5.1">The Group Flag <bcp14>MUST</bcp14> be set to 0 if the Group OSCORE message is protected using the pairwise mode (see <xref target="sec-pairwise-protection" format="default" sectionFormat="of" derivedContent="Section 8"/>). The Group Flag <bcp14>MUST</bcp14> also be set to 0 for ordinary OSCORE messages processed according to <xref target="RFC8613" format="default" sectionFormat="of" derivedContent="RFC8613"/>.</t>
          </li>
        </ul>
      </section>
      <section anchor="sssec-encrypted-signature-keystream" numbered="true" removeInRFC="false" toc="include" pn="section-4.2">
        <name slugifiedName="name-keystream-derivation-for-co">Keystream Derivation for Countersignature Encryption/Decryption</name>
        <t indent="0" pn="section-4.2-1">This section defines how an endpoint derives the keystream KEYSTREAM, which is used to encrypt/decrypt the countersignature of an outgoing/incoming message M protected in group mode.</t>
        <t indent="0" pn="section-4.2-2">The keystream <bcp14>SHALL</bcp14> be derived as follows by using the HKDF Algorithm from the Common Context (see <xref target="ssec-common-context-hkdf-alg" format="default" sectionFormat="of" derivedContent="Section 2.1.2"/>) analogously to <xref section="3.2.1" sectionFormat="of" target="RFC8613" format="default" derivedLink="https://rfc-editor.org/rfc/rfc8613#section-3.2.1" derivedContent="RFC8613"/>, i.e., by composing the HKDF-Extract and HKDF-Expand steps <xref target="RFC5869" format="default" sectionFormat="of" derivedContent="RFC5869"/>.</t>
        <t indent="0" pn="section-4.2-3">KEYSTREAM = HKDF(salt, IKM, info, L)</t>
        <t indent="0" pn="section-4.2-4">The input parameters of HKDF are as follows:</t>
        <ul spacing="normal" bare="false" empty="false" indent="3" pn="section-4.2-5">
          <li pn="section-4.2-5.1">
            <t indent="0" pn="section-4.2-5.1.1">salt takes as its value the Partial IV (PIV) used to protect M. Note that, if M is a response, salt takes as its value either the fresh Partial IV generated by the server and included in the response or the same Partial IV of the request generated by the client and not included in the response.</t>
          </li>
          <li pn="section-4.2-5.2">
            <t indent="0" pn="section-4.2-5.2.1">IKM is the Signature Encryption Key from the Common Context (see <xref target="ssec-common-context-group-enc-key" format="default" sectionFormat="of" derivedContent="Section 2.1.9"/>).</t>
          </li>
          <li pn="section-4.2-5.3">
            <t indent="0" pn="section-4.2-5.3.1">info is the serialization of a CBOR array with the structure defined below, following the notation of <xref target="RFC8610" format="default" sectionFormat="of" derivedContent="RFC8610"/>:</t>
          </li>
        </ul>
        <sourcecode type="cddl" markers="false" pn="section-4.2-6">
   info = [
     id : bstr,
     id_context : bstr,
     type : bool,
     L : uint
   ]
</sourcecode>
        <t indent="0" pn="section-4.2-7">where:</t>
        <ul spacing="normal" bare="false" empty="false" indent="3" pn="section-4.2-8">
          <li pn="section-4.2-8.1">
            <t indent="0" pn="section-4.2-8.1.1">id is the Sender ID of the endpoint that generated PIV.</t>
          </li>
          <li pn="section-4.2-8.2">
            <t indent="0" pn="section-4.2-8.2.1">id_context is the ID Context (Gid) used when protecting M.  </t>
            <t indent="0" pn="section-4.2-8.2.2">
Note that, in the case of group rekeying, a server might use a different Gid when protecting a response compared to the Gid that it used to verify (that the client used to protect) the request; see <xref target="ssec-protect-response" format="default" sectionFormat="of" derivedContent="Section 7.3"/>.</t>
          </li>
          <li pn="section-4.2-8.3">
            <t indent="0" pn="section-4.2-8.3.1">type is the CBOR simple value <tt>true</tt> (0xf5) if M is a request or the CBOR simple value <tt>false</tt> (0xf4) otherwise.</t>
          </li>
          <li pn="section-4.2-8.4">
            <t indent="0" pn="section-4.2-8.4.1">L is the size of the countersignature, as per Signature Algorithm from the Common Context (see <xref target="ssec-common-context-cs-alg" format="default" sectionFormat="of" derivedContent="Section 2.1.8"/>) in bytes.</t>
          </li>
        </ul>
      </section>
      <section anchor="compression-examples" numbered="true" removeInRFC="false" toc="include" pn="section-4.3">
        <name slugifiedName="name-examples-of-compressed-cose">Examples of Compressed COSE Objects</name>
        <t indent="0" pn="section-4.3-1">This section covers a list of OSCORE header compression examples of Group OSCORE used in group mode (see <xref target="sssec-example-cose-group" format="default" sectionFormat="of" derivedContent="Section 4.3.1"/>) or in pairwise mode (see <xref target="sssec-example-cose-pairwise" format="default" sectionFormat="of" derivedContent="Section 4.3.2"/>).</t>
        <t indent="0" pn="section-4.3-2">The examples assume that the COSE_Encrypt0 object is set (which means the CoAP message and cryptographic material is known). Note that the examples do not include the full CoAP unprotected message or the full Security Context, but only the input necessary to the compression mechanism, i.e., the COSE_Encrypt0 object. The output is the compressed COSE object as defined in <xref target="compression-details" format="default" sectionFormat="of" derivedContent="Section 4.1"/> and divided into two parts, since the object is transported in two CoAP fields: OSCORE Option and payload.</t>
        <t indent="0" pn="section-4.3-3">The examples assume that the plaintext (see <xref section="5.3" sectionFormat="of" target="RFC8613" format="default" derivedLink="https://rfc-editor.org/rfc/rfc8613#section-5.3" derivedContent="RFC8613"/>) is 6 bytes long, and that the AEAD tag is 8 bytes long, hence resulting in a ciphertext that is 14 bytes long. When using the group mode, the COSE_Countersignature0 byte string as described in <xref target="sec-cose-object" format="default" sectionFormat="of" derivedContent="Section 3"/> is assumed to be 64 bytes long.</t>
        <section anchor="sssec-example-cose-group" numbered="true" removeInRFC="false" toc="include" pn="section-4.3.1">
          <name slugifiedName="name-examples-in-group-mode">Examples in Group Mode</name>
          <t indent="0" pn="section-4.3.1-1">Request with ciphertext = 0xaea0155667924dff8a24e4cb35b9, kid = 0x25, Partial IV = 5, and kid context = 0x44616c.</t>
          <ul spacing="normal" bare="false" empty="false" indent="3" pn="section-4.3.1-2">
            <li pn="section-4.3.1-2.1">
              <t indent="0" pn="section-4.3.1-2.1.1">Before compression (96 bytes):</t>
            </li>
          </ul>
          <sourcecode type="cbor-diag" markers="false" pn="section-4.3.1-3">
   [
     / protected / h'',
     / unprotected / {
       / kid /                           4 : h'25',
       / Partial IV /                    6 : h'05',
       / kid context /                  10 : h'44616c',
       / Countersignature0 version 2 /  12 : h'66e6d9b0
       db009f3e105a673f8855611726caed57f530f8cae9d0b168
       513ab949fedc3e80a96ebe94ba08d3f8d3bf83487458e2ab
       4c2f936ff78b50e33c885e35'
     },
     / ciphertext / h'aea0155667924dff8a24e4cb35b9'
   ]
</sourcecode>
          <ul spacing="normal" bare="false" empty="false" indent="3" pn="section-4.3.1-4">
            <li pn="section-4.3.1-4.1">
              <t indent="0" pn="section-4.3.1-4.1.1">After compression (85 bytes):</t>
            </li>
          </ul>
          <artwork align="left" pn="section-4.3.1-5">
   Flag byte: 0b00111001 = 0x39 (1 byte)

   Option Value: 0x39 05 03 44 61 6c 25 (7 bytes)

   Payload: 0xaea0155667924dff8a24e4cb35b9 de9e ... f1
   (14 bytes + size of the encrypted countersignature)
</artwork>
          <t indent="0" pn="section-4.3.1-6"> </t>
          <t indent="0" pn="section-4.3.1-7">Response with ciphertext = 0x60b035059d9ef5667c5a0710823b, kid = 0x52, and no Partial IV.</t>
          <ul spacing="normal" bare="false" empty="false" indent="3" pn="section-4.3.1-8">
            <li pn="section-4.3.1-8.1">
              <t indent="0" pn="section-4.3.1-8.1.1">Before compression (88 bytes):</t>
            </li>
          </ul>
          <sourcecode type="cbor-diag" markers="false" pn="section-4.3.1-9">
   [
     / protected / h'',
     / unprotected / {
       / kid /                           4 : h'52',
       / Countersignature0 version 2 /  12 : h'f5b659b8
       24487eb349c5c5c8a3fe401784cade2892725438e8be0fab
       daa2867ee6d29f68edb0818e50ebf98c28b923d0205f5162
       e73662e27c1a3ec562a49b80'
     },
     / ciphertext / h'60b035059d9ef5667c5a0710823b'
   ]
</sourcecode>
          <ul spacing="normal" bare="false" empty="false" indent="3" pn="section-4.3.1-10">
            <li pn="section-4.3.1-10.1">
              <t indent="0" pn="section-4.3.1-10.1.1">After compression (80 bytes):</t>
            </li>
          </ul>
          <artwork align="left" pn="section-4.3.1-11">
   Flag byte: 0b00101000 = 0x28 (1 byte)

   Option Value: 0x28 52 (2 bytes)

   Payload: 0x60b035059d9ef5667c5a0710823b ca1e ... b3
   (14 bytes + size of the encrypted countersignature)
</artwork>
        </section>
        <section anchor="sssec-example-cose-pairwise" numbered="true" removeInRFC="false" toc="include" pn="section-4.3.2">
          <name slugifiedName="name-examples-in-pairwise-mode">Examples in Pairwise Mode</name>
          <t indent="0" pn="section-4.3.2-1">Request with ciphertext = 0xaea0155667924dff8a24e4cb35b9, kid = 0x25, Partial IV = 5, and kid context = 0x44616c.</t>
          <ul spacing="normal" bare="false" empty="false" indent="3" pn="section-4.3.2-2">
            <li pn="section-4.3.2-2.1">
              <t indent="0" pn="section-4.3.2-2.1.1">Before compression (29 bytes):</t>
            </li>
          </ul>
          <sourcecode type="cbor-diag" markers="false" pn="section-4.3.2-3">
   [
     / protected / h'',
     / unprotected / {
       / kid /           4 : h'25',
       / Partial IV /    6 : h'05',
       / kid context /  10 : h'44616c'
     },
     / ciphertext / h'aea0155667924dff8a24e4cb35b9'
   ]
</sourcecode>
          <ul spacing="normal" bare="false" empty="false" indent="3" pn="section-4.3.2-4">
            <li pn="section-4.3.2-4.1">
              <t indent="0" pn="section-4.3.2-4.1.1">After compression (21 bytes):</t>
            </li>
          </ul>
          <artwork align="left" pn="section-4.3.2-5">
   Flag byte: 0b00011001 = 0x19 (1 byte)

   Option Value: 0x19 05 03 44 61 6c 25 (7 bytes)

   Payload: 0xaea0155667924dff8a24e4cb35b9 (14 bytes)
</artwork>
          <t indent="0" pn="section-4.3.2-6"> </t>
          <t indent="0" pn="section-4.3.2-7">Response with ciphertext = 0x60b035059d9ef5667c5a0710823b and no Partial IV.</t>
          <ul spacing="normal" bare="false" empty="false" indent="3" pn="section-4.3.2-8">
            <li pn="section-4.3.2-8.1">
              <t indent="0" pn="section-4.3.2-8.1.1">Before compression (18 bytes):</t>
            </li>
          </ul>
          <sourcecode type="cbor-diag" markers="false" pn="section-4.3.2-9">
   [
     / protected / h'',
     / unprotected / {},
     / ciphertext / h'60b035059d9ef5667c5a0710823b'
   ]
</sourcecode>
          <ul spacing="normal" bare="false" empty="false" indent="3" pn="section-4.3.2-10">
            <li pn="section-4.3.2-10.1">
              <t indent="0" pn="section-4.3.2-10.1.1">After compression (14 bytes):</t>
            </li>
          </ul>
          <artwork align="left" pn="section-4.3.2-11">
   Flag byte: 0b00000000 = 0x00 (1 byte)

   Option Value: 0x (0 bytes)

   Payload: 0x60b035059d9ef5667c5a0710823b (14 bytes)
</artwork>
        </section>
      </section>
    </section>
    <section anchor="message-binding-sequence-numbers-freshness-and-replay-protection" numbered="true" removeInRFC="false" toc="include" pn="section-5">
      <name slugifiedName="name-message-binding-sequence-nu">Message Binding, Sequence Numbers, Freshness, and Replay Protection</name>
      <t indent="0" pn="section-5-1">Like OSCORE, Group OSCORE provides message binding of responses to requests, as well as uniqueness of (key, nonce) pairs (see Sections <xref target="RFC8613" section="7.1" sectionFormat="bare" format="default" derivedLink="https://rfc-editor.org/rfc/rfc8613#section-7.1" derivedContent="RFC8613"/> and <xref target="RFC8613" section="7.2" sectionFormat="bare" format="default" derivedLink="https://rfc-editor.org/rfc/rfc8613#section-7.2" derivedContent="RFC8613"/> of <xref target="RFC8613" format="default" sectionFormat="of" derivedContent="RFC8613"/>, respectively).</t>
      <section anchor="sec-long-exchanges" numbered="true" removeInRFC="false" toc="include" pn="section-5.1">
        <name slugifiedName="name-supporting-multiple-respons">Supporting Multiple Responses in Long Exchanges</name>
        <t indent="0" pn="section-5.1-1">For each of its ongoing long exchanges, a client maintains one Response Number for each different server. Then, separately for each server, the client uses the associated Response Number to perform ordering and replay protection of responses received from that server within that long exchange (see <xref target="sec-replay-protection-responses" format="default" sectionFormat="of" derivedContent="Section 5.3.1"/>).</t>
        <t indent="0" pn="section-5.1-2">That is, the Response Number has the same purpose that the Notification Number has in OSCORE (see <xref section="4.1.3.5.2" sectionFormat="of" target="RFC8613" format="default" derivedLink="https://rfc-editor.org/rfc/rfc8613#section-4.1.3.5.2" derivedContent="RFC8613"/>), but a client uses it for handling any response from the associated server within a long exchange.</t>
        <t indent="0" pn="section-5.1-3">Group OSCORE allows a long exchange to remain active, even if the group is rekeyed (thus changing the ID Context) or the client obtains a new Sender ID.</t>
        <t indent="0" pn="section-5.1-4">As defined in <xref target="mess-processing" format="default" sectionFormat="of" derivedContent="Section 7"/>, this is achieved by the client and server(s) storing the 'kid' and 'kid context' used in the original request throughout the whole duration of the long exchange.</t>
        <t indent="0" pn="section-5.1-5">Upon leaving the group or before re-joining the group, a group member <bcp14>MUST</bcp14> terminate all the ongoing long exchanges that it has started in the group as a client. This frees up the CoAP Token associated with the corresponding request.</t>
      </section>
      <section anchor="sec-freshness" numbered="true" removeInRFC="false" toc="include" pn="section-5.2">
        <name slugifiedName="name-freshness">Freshness</name>
        <t indent="0" pn="section-5.2-1">If the application requires freshness, e.g., according to time- or event-based policies (see <xref section="2.5.1" sectionFormat="of" target="RFC9175" format="default" derivedLink="https://rfc-editor.org/rfc/rfc9175#section-2.5.1" derivedContent="RFC9175"/>), a server can use the approach in <xref target="sec-synch-challenge-response" format="default" sectionFormat="of" derivedContent="Section 9"/> as a variant of the Challenge-Response procedure based on the Echo Option <xref target="RFC9175" format="default" sectionFormat="of" derivedContent="RFC9175"/> before delivering request messages from a client to the application.</t>
        <t indent="0" pn="section-5.2-2">Like in OSCORE <xref target="RFC8613" format="default" sectionFormat="of" derivedContent="RFC8613"/>, assuming an honest server, the message binding guarantees that a response is not older than the request it replies to. Therefore, building on <xref section="7.3" sectionFormat="of" target="RFC8613" format="default" derivedLink="https://rfc-editor.org/rfc/rfc8613#section-7.3" derivedContent="RFC8613"/>, the following properties apply for Group OSCORE:</t>
        <ul spacing="normal" bare="false" empty="false" indent="3" pn="section-5.2-3">
          <li pn="section-5.2-3.1">
            <t indent="0" pn="section-5.2-3.1.1">The freshness of a response can be assessed if it is received soon after the request.  </t>
            <t indent="0" pn="section-5.2-3.1.2">
For responses within a long exchange, this assessment gets weaker with time. If such responses are Observe notifications <xref target="RFC7641" format="default" sectionFormat="of" derivedContent="RFC7641"/>, it is <bcp14>RECOMMENDED</bcp14> that the client regularly re-registers the observation.  </t>
            <t indent="0" pn="section-5.2-3.1.3">
If the request was neither a group request nor an Observe request, there is at most a single valid response and only from one individually targeted server in the group. Thus, freshness can be assessed depending on when the request was sent.</t>
          </li>
          <li pn="section-5.2-3.2">
            <t indent="0" pn="section-5.2-3.2.1">It is not guaranteed that a misbehaving server did not create the response before receiving the request, i.e., Group OSCORE does not verify server aliveness.</t>
          </li>
          <li pn="section-5.2-3.3">
            <t indent="0" pn="section-5.2-3.3.1">For requests and responses, the received Partial IV allows a recipient to determine the relative order of requests or responses.</t>
          </li>
        </ul>
      </section>
      <section anchor="sec-replay-protection" numbered="true" removeInRFC="false" toc="include" pn="section-5.3">
        <name slugifiedName="name-replay-protection">Replay Protection</name>
        <t indent="0" pn="section-5.3-1">Like in OSCORE <xref target="RFC8613" format="default" sectionFormat="of" derivedContent="RFC8613"/>, the replay protection relies on the Partial IV of incoming messages. A server updates the Replay Window of its Recipient Contexts based on the Partial IV values in received request messages, which correspond to the Sender Sequence Numbers of the clients. Note that there can be large jumps in these Sender Sequence Number values, e.g., when a client exchanges unicast messages with other servers. The operation of validating the Partial IV and performing replay protection <bcp14>MUST</bcp14> be atomic. Sections <xref target="ssec-loss-mutable-context" format="counter" sectionFormat="of" derivedContent="2.6.1"/> and <xref target="new-sec-context" format="counter" sectionFormat="of" derivedContent="2.6.3.2"/> describe the update of Replay Windows after the loss of data from the Security Context and the retrieving of new Security Context parameters.</t>
        <t indent="0" pn="section-5.3-2">The protection from replay of requests is performed as per <xref section="7.4" sectionFormat="of" target="RFC8613" format="default" derivedLink="https://rfc-editor.org/rfc/rfc8613#section-7.4" derivedContent="RFC8613"/> separately for each client and by leveraging the Replay Window in the corresponding Recipient Context. The protection from replay of responses in a long exchange is performed as defined in <xref target="sec-replay-protection-responses" format="default" sectionFormat="of" derivedContent="Section 5.3.1"/> of this document.</t>
        <section anchor="sec-replay-protection-responses" numbered="true" removeInRFC="false" toc="include" pn="section-5.3.1">
          <name slugifiedName="name-replay-protection-of-respon">Replay Protection of Responses</name>
          <t indent="0" pn="section-5.3.1-1">A client uses the method defined in this section in order to check whether a received response is a replay.</t>
          <t indent="0" pn="section-5.3.1-2">This especially applies to responses received within a long exchange during which multiple such responses can be received from the same server to the corresponding request. These include Observe notifications <xref target="RFC7641" format="default" sectionFormat="of" derivedContent="RFC7641"/> and non-notification responses as a reply to a group request, which the client can receive until the CoAP Token value associated with the group request is freed up (see <xref section="3.1.6" sectionFormat="of" target="RFC10020" format="default" derivedLink="https://rfc-editor.org/rfc/rfc10020#section-3.1.6" derivedContent="RFC10020"/>).</t>
          <t indent="0" pn="section-5.3.1-3">When sending a response (both successful and error), a server <bcp14>MUST</bcp14> include its Sender Sequence Number as Partial IV in the response except when sending the first response to the corresponding request, in which case, the Partial IV in the response <bcp14>MAY</bcp14> be omitted.</t>
          <t indent="0" pn="section-5.3.1-4">In order to protect against replay, the client <bcp14>SHALL</bcp14> maintain for each ongoing long exchange one Response Number for each different server. The Response Number is a non-negative integer containing the largest Partial IV of the responses received from that server during the long exchange while using the same Security Context.</t>
          <t indent="0" pn="section-5.3.1-5">Then, separately for each server, the client uses the associated Response Number to perform ordering and replay protection of the responses from that server during the long exchange by comparing their Partial IVs with one another and against the Response Number.</t>
          <t indent="0" pn="section-5.3.1-6">For every long exchange, the Response Number associated with a server is initialized to the Partial IV of the response from that server such that, within the long exchange, it is the first response from that server to include a Partial IV and to be successfully verified with the used Security Context. Note that, when a new Security Context is established in the group, the client sets the Response Number of each associated server as not initialized (see <xref target="new-sec-context" format="default" sectionFormat="of" derivedContent="Section 2.6.3.2"/>), hence later responses within the same long exchange and protected with the new Security Context will result in a new initialization of Response Numbers. Furthermore, for every long exchange, a client <bcp14>MUST</bcp14> only accept at most one response without Partial IV from each server and treat it as the oldest response from that server within that long exchange.</t>
          <t indent="0" pn="section-5.3.1-7">During a long exchange, a client receiving a response containing a Partial IV <bcp14>SHALL</bcp14> compare the Partial IV with the Response Number associated with the replying server within that long exchange. The client <bcp14>MUST</bcp14> stop processing a response from a server if that response has a Partial IV that has been previously received from that server during that long exchange, while using the same Security Context.</t>
          <t indent="0" pn="section-5.3.1-8">Applications <bcp14>MAY</bcp14> decide that a client only processes responses within a long exchange if those have a greater Partial IV than the Response Number associated with the replying server within that long exchange. This limits the storage overhead on the client to maintaining one Response Number per replying server within the long exchange. Conversely, more permissive applications can allow clients to also process responses that have a smaller Partial IV than the Response Number associated with the replying server. For a client, the ability to detect previously received Partial IVs while admitting the processing of such responses comes at the cost of additional storage overhead, for which a reasonable bound has to be defined by the application. A possible way to achieve that relies on using a sliding Replay Window uniquely paired with the replying server within the long exchange, similarly to that used by a server for detecting replayed requests.</t>
          <t indent="0" pn="section-5.3.1-9">If the verification of the response succeeds, and the received Partial IV (when included) was greater than the Response Number associated with the replying server, then the client <bcp14>SHALL</bcp14> overwrite that Response Number with the received Partial IV.</t>
          <t indent="0" pn="section-5.3.1-10">As long as a server uses the same Security Context to protect its responses to the same request, the client <bcp14>MUST</bcp14> consider the response with the highest Partial IV as the freshest response from that server among those protected with that Security Context, regardless of the order of arrival. Within a long exchange, implementations need to make sure that a response without Partial IV is considered the oldest response from the replying server within that long exchange.</t>
          <t indent="0" pn="section-5.3.1-11">The method defined in this section is not relevant for responses to requests that are neither group requests nor Observe requests. In fact, for each of such requests, there is at most one response and only from one individually targeted server in the group.</t>
        </section>
      </section>
    </section>
    <section anchor="sec-message-reception" numbered="true" removeInRFC="false" toc="include" pn="section-6">
      <name slugifiedName="name-message-reception">Message Reception</name>
      <t indent="0" pn="section-6-1">Upon receiving a protected message, a recipient endpoint retrieves a Security Context as in <xref target="RFC8613" format="default" sectionFormat="of" derivedContent="RFC8613"/>. An endpoint <bcp14>MUST</bcp14> be able to distinguish between a Security Context to process OSCORE messages as in <xref target="RFC8613" format="default" sectionFormat="of" derivedContent="RFC8613"/> and a Group OSCORE Security Context to process Group OSCORE messages as defined in this document.</t>
      <t indent="0" pn="section-6-2">The way to accomplish this distinction is implementation specific. For example, an endpoint can take into account the different structure of the Security Context defined in <xref target="sec-context" format="default" sectionFormat="of" derivedContent="Section 2"/>, e.g., based on the presence of Signature Algorithm and Pairwise Key Agreement Algorithm in the Common Context. Alternatively, at the cost of increasing storage, implementations can use an additional parameter in the Security Context to explicitly mark that it is intended for processing Group OSCORE messages.</t>
      <t indent="0" pn="section-6-3">If either of the following conditions applies, a recipient endpoint <bcp14>MUST</bcp14> discard the incoming protected message:</t>
      <ul spacing="normal" bare="false" empty="false" indent="3" pn="section-6-4">
        <li pn="section-6-4.1">
          <t indent="0" pn="section-6-4.1.1">The Group Flag is set to 0 and the retrieved Security Context is associated with an OSCORE group, but the endpoint does not support the pairwise mode or any of the following parameters is not set in the Security Context: the AEAD Algorithm and the Pairwise Key Agreement Algorithm.</t>
        </li>
        <li pn="section-6-4.2">
          <t indent="0" pn="section-6-4.2.1">The Group Flag is set to 1 and the retrieved Security Context is associated with an OSCORE group, but the endpoint does not support the group mode or any of the following parameters is not set in the Security Context: the Group Encryption Algorithm and the Signature Algorithm.</t>
        </li>
        <li pn="section-6-4.3">
          <t indent="0" pn="section-6-4.3.1">The Group Flag is set to 1, but there is no Security Context associated with an OSCORE group.  </t>
          <t indent="0" pn="section-6-4.3.2">
Future specifications may define how to process incoming messages protected with Security Contexts as in <xref target="RFC8613" format="default" sectionFormat="of" derivedContent="RFC8613"/> when the Group Flag bit is set to 1.</t>
        </li>
      </ul>
      <t indent="0" pn="section-6-5">Otherwise, if a Security Context associated with an OSCORE group is retrieved, the recipient endpoint processes the message with Group OSCORE using the group mode (see <xref target="mess-processing" format="default" sectionFormat="of" derivedContent="Section 7"/>) if the Group Flag is set to 1 or the pairwise mode (see <xref target="sec-pairwise-protection" format="default" sectionFormat="of" derivedContent="Section 8"/>) if the Group Flag is set to 0.</t>
      <t indent="0" pn="section-6-6">Note that if the Group Flag is set to 0 and the recipient endpoint retrieves a Security Context that is valid to process the message but is not associated with an OSCORE group, then the message is processed according to <xref target="RFC8613" format="default" sectionFormat="of" derivedContent="RFC8613"/>.</t>
    </section>
    <section anchor="mess-processing" numbered="true" removeInRFC="false" toc="include" pn="section-7">
      <name slugifiedName="name-message-processing-in-group">Message Processing in Group Mode</name>
      <t indent="0" pn="section-7-1">When using the group mode, messages are protected and processed as specified in <xref target="RFC8613" format="default" sectionFormat="of" derivedContent="RFC8613"/> with the modifications described in this section. The security objectives of the group mode are discussed in <xref target="ssec-sec-objectives" format="default" sectionFormat="of" derivedContent="Appendix A.2"/>.</t>
      <t indent="0" pn="section-7-2">The possible use of the group mode is indicated by the Group Manager as part of the group data provided to new group members when joining the group, according to which the parameters Group Encryption Algorithm and Signature Algorithm in the Security Context are set (see <xref target="sec-context" format="default" sectionFormat="of" derivedContent="Section 2"/>).</t>
      <t indent="0" pn="section-7-3">During all the steps of the message processing, an endpoint <bcp14>MUST</bcp14> use the same Security Context for the considered group. That is, an endpoint <bcp14>MUST NOT</bcp14> install a new Security Context for that group (see <xref target="new-sec-context" format="default" sectionFormat="of" derivedContent="Section 2.6.3.2"/>) until the message processing is completed.</t>
      <t indent="0" pn="section-7-4">The group mode <bcp14>SHOULD</bcp14> be used to protect group requests intended for multiple recipients or for the whole group. This applies to both requests directly addressed to multiple recipients, e.g., sent by the client over multicast, as well as requests sent by the client over unicast to a proxy that forwards them to the intended recipients over multicast <xref target="RFC10020" format="default" sectionFormat="of" derivedContent="RFC10020"/>. Exceptions where the requirement above is not fulfilled and the pairwise mode is used to protect group requests include: the efficient discovery of a server's address in the group (see <xref target="ssec-pre-conditions" format="default" sectionFormat="of" derivedContent="Section 8.1"/>) or the enabling of simple constructions where a variation of the pairwise mode protects requests possibly intended to multiple servers in such a way that the corresponding responses are effectively cacheable by intermediaries (e.g., see <xref target="I-D.ietf-core-cacheable-oscore" format="default" sectionFormat="of" derivedContent="CACHEABLE-OSCORE"/>).</t>
      <t indent="0" pn="section-7-5">As per <xref target="RFC7252" format="default" sectionFormat="of" derivedContent="RFC7252"/> and <xref target="RFC10020" format="default" sectionFormat="of" derivedContent="RFC10020"/>, group requests sent over multicast are always Non-confirmable and thus are not retransmitted by the CoAP messaging layer. Instead, applications should store such outgoing messages for a predefined, sufficient amount of time in order to correctly perform potential retransmissions at the application layer. If performed, these retransmissions are repetitions of previous protected messages, which the sender endpoint does not protect again with Group OSCORE.</t>
      <t indent="0" pn="section-7-6">According to <xref section="5.2.3" sectionFormat="of" target="RFC7252" format="default" derivedLink="https://rfc-editor.org/rfc/rfc7252#section-5.2.3" derivedContent="RFC7252"/>:</t>
      <blockquote pn="section-7-7">
        <t indent="0" pn="section-7-7.1">If the request message is Non-confirmable, then the response <bcp14>SHOULD</bcp14> be returned in a Non-confirmable message as well. However, an endpoint <bcp14>MUST</bcp14> be prepared to receive ... a Confirmable response in reply to a Non-confirmable request.</t>
      </blockquote>
      <t indent="0" pn="section-7-8">Confirmable group requests are acknowledged when sent over non-multicast transports as specified in <xref target="RFC7252" format="default" sectionFormat="of" derivedContent="RFC7252"/>.</t>
      <t indent="0" pn="section-7-9">Furthermore, endpoints in the group locally perform error handling and processing of invalid messages according to the same principles adopted in <xref target="RFC8613" format="default" sectionFormat="of" derivedContent="RFC8613"/>. In addition, a recipient <bcp14>MUST</bcp14> stop processing and reject any message that is malformed and that does not follow the format specified in <xref target="sec-cose-object" format="default" sectionFormat="of" derivedContent="Section 3"/> of this document or that is not cryptographically validated in a successful way as per the processing defined in Sections <xref target="ssec-verify-request" format="counter" sectionFormat="of" derivedContent="7.2"/> and <xref target="ssec-verify-response" format="counter" sectionFormat="of" derivedContent="7.4"/>.</t>
      <t indent="0" pn="section-7-10">In either case, it is <bcp14>RECOMMENDED</bcp14> that a server does not send back any error message in reply to a received request if either of the following conditions applies:</t>
      <ul spacing="normal" bare="false" empty="false" indent="3" pn="section-7-11">
        <li pn="section-7-11.1">
          <t indent="0" pn="section-7-11.1.1">The server is not able to identify whether the received request is a group request, i.e., as sent to all servers in the group.</t>
        </li>
        <li pn="section-7-11.2">
          <t indent="0" pn="section-7-11.2.1">The server identifies the received request as a group request.</t>
        </li>
      </ul>
      <t indent="0" pn="section-7-12">This prevents servers from replying with multiple error messages to a client sending a group request, avoiding the risk of flooding and possibly congesting the network.</t>
      <section anchor="ssec-protect-request" numbered="true" removeInRFC="false" toc="include" pn="section-7.1">
        <name slugifiedName="name-protecting-the-request">Protecting the Request</name>
        <t indent="0" pn="section-7.1-1">When using the group mode to protect a request, a client proceeds as described in <xref section="8.1" sectionFormat="of" target="RFC8613" format="default" derivedLink="https://rfc-editor.org/rfc/rfc8613#section-8.1" derivedContent="RFC8613"/> with the following modifications.</t>
        <ul spacing="normal" bare="false" empty="false" indent="3" pn="section-7.1-2">
          <li pn="section-7.1-2.1">
            <t indent="0" pn="section-7.1-2.1.1">In Step 2, the AAD is modified as described in <xref target="sec-cose-object-ext-aad" format="default" sectionFormat="of" derivedContent="Section 3.4"/> of this document.</t>
          </li>
          <li pn="section-7.1-2.2">
            <t indent="0" pn="section-7.1-2.2.1">In Step 4, the encryption of the COSE object is modified as described in <xref target="sec-cose-object" format="default" sectionFormat="of" derivedContent="Section 3"/> of this document. The encoding of the compressed COSE object is modified as described in <xref target="compression" format="default" sectionFormat="of" derivedContent="Section 4"/> of this document. In particular, the Group Flag <bcp14>MUST</bcp14> be set to 1. The Group Encryption Algorithm from the Common Context <bcp14>MUST</bcp14> be used.</t>
          </li>
          <li pn="section-7.1-2.3">
            <t indent="0" pn="section-7.1-2.3.1">In Step 5, the countersignature is computed and the format of the OSCORE message is modified as described in Sections <xref target="sec-cose-object" format="counter" sectionFormat="of" derivedContent="3"/> and <xref target="compression" format="counter" sectionFormat="of" derivedContent="4"/> of this document. In particular, the payload of the Group OSCORE message includes also the encrypted countersignature.</t>
          </li>
        </ul>
        <t indent="0" pn="section-7.1-3">In addition, the following applies when sending a request that establishes a long exchange:</t>
        <ul spacing="normal" bare="false" empty="false" indent="3" pn="section-7.1-4">
          <li pn="section-7.1-4.1">
            <t indent="0" pn="section-7.1-4.1.1">If the client intends to keep the long exchange active beyond a possible change of Sender ID, the client <bcp14>MUST</bcp14> store the value of the 'kid' parameter from the request and retain it until the long exchange is terminated. Even in the case that the client is individually rekeyed and receives a new Sender ID from the Group Manager (see <xref target="new-sender-id" format="default" sectionFormat="of" derivedContent="Section 2.6.3.1"/>), the client <bcp14>MUST NOT</bcp14> update the stored 'kid' parameter value associated with the long exchange and the corresponding request.</t>
          </li>
          <li pn="section-7.1-4.2">
            <t indent="0" pn="section-7.1-4.2.1">If the client intends to keep the long exchange active beyond a possible change of ID Context following a group rekeying (see <xref target="sec-group-key-management" format="default" sectionFormat="of" derivedContent="Section 12.2"/>), then the following applies:  </t>
            <ul spacing="normal" bare="false" empty="false" indent="3" pn="section-7.1-4.2.2">
              <li pn="section-7.1-4.2.2.1">
                <t indent="0" pn="section-7.1-4.2.2.1.1">The client <bcp14>MUST</bcp14> store the value of the 'kid context' parameter from the request and retain it until the long exchange is terminated. Upon establishing a new Security Context with a new Gid as ID Context (see <xref target="new-sec-context" format="default" sectionFormat="of" derivedContent="Section 2.6.3.2"/>), the client <bcp14>MUST NOT</bcp14> update the stored 'kid context' parameter value associated with the long exchange and the corresponding request.</t>
              </li>
              <li pn="section-7.1-4.2.2.2">
                <t indent="0" pn="section-7.1-4.2.2.2.1">The client <bcp14>MUST</bcp14> store an invariant identifier of the group, which is immutable even if the Security Context of the group is re-established.  For example, this invariant identifier can be the "group name" in <xref target="I-D.ietf-ace-key-groupcomm-oscore" format="default" sectionFormat="of" derivedContent="ACE-KEY-GROUP-OSCORE"/>, where it is used for joining the group and retrieving the current group keying material from the Group Manager.      </t>
                <t indent="0" pn="section-7.1-4.2.2.2.2">
After a group rekeying, the client might have missed both the rekeying messages and the servers' first responses that are protected with the new Security Context and include the new ID Context (Gid) in the 'kid context' parameter (see <xref target="ssec-protect-response" format="default" sectionFormat="of" derivedContent="Section 7.3"/>). In such a case, while still not knowing the new ID Context (Gid) used in the group, the client is able to retrieve the current group keying material from the Group Manager using the invariant identifier to unambiguously refer to the group.</t>
              </li>
            </ul>
          </li>
        </ul>
      </section>
      <section anchor="ssec-verify-request" numbered="true" removeInRFC="false" toc="include" pn="section-7.2">
        <name slugifiedName="name-verifying-the-request">Verifying the Request</name>
        <t indent="0" pn="section-7.2-1">Upon receiving a protected request with the Group Flag set to 1, following the procedure in <xref target="sec-message-reception" format="default" sectionFormat="of" derivedContent="Section 6"/>, a server proceeds as described in <xref section="8.2" sectionFormat="of" target="RFC8613" format="default" derivedLink="https://rfc-editor.org/rfc/rfc8613#section-8.2" derivedContent="RFC8613"/> with the following modifications.</t>
        <ul spacing="normal" bare="false" empty="false" indent="3" pn="section-7.2-2">
          <li pn="section-7.2-2.1">
            <t indent="0" pn="section-7.2-2.1.1">In Step 2, the decoding of the compressed COSE object follows <xref target="compression" format="default" sectionFormat="of" derivedContent="Section 4"/> of this document. In particular:  </t>
            <ul spacing="normal" bare="false" empty="false" indent="3" pn="section-7.2-2.1.2">
              <li pn="section-7.2-2.1.2.1">
                <t indent="0" pn="section-7.2-2.1.2.1.1">If the server discards the request due to not retrieving a Security Context associated with the OSCORE group, the server <bcp14>MAY</bcp14> respond with a 4.01 (Unauthorized) error message. When doing so, the server <bcp14>MAY</bcp14> set an Outer Max-Age Option with value zero and <bcp14>MAY</bcp14> include a descriptive string as diagnostic payload.</t>
              </li>
              <li pn="section-7.2-2.1.2.2">
                <t indent="0" pn="section-7.2-2.1.2.2.1">If the received 'kid context' matches an existing ID Context (Gid) but the received 'kid' does not match any Recipient ID in this Security Context, then the server <bcp14>MAY</bcp14> create a new Recipient Context for this Recipient ID and initialize it according to <xref section="3" sectionFormat="of" target="RFC8613" format="default" derivedLink="https://rfc-editor.org/rfc/rfc8613#section-3" derivedContent="RFC8613"/>, and also retrieve the authentication credential associated with the Recipient ID to be stored in the new Recipient Context. Such a configuration is application-specific. If the application does not specify dynamic derivation of new Recipient Contexts, then the server <bcp14>SHALL</bcp14> stop processing the request.</t>
              </li>
            </ul>
          </li>
          <li pn="section-7.2-2.2">
            <t indent="0" pn="section-7.2-2.2.1">In Step 4, the AAD is modified as described in <xref target="sec-cose-object-ext-aad" format="default" sectionFormat="of" derivedContent="Section 3.4"/> of this document.</t>
          </li>
          <li pn="section-7.2-2.3">
            <t indent="0" pn="section-7.2-2.3.1">In Step 6, the server also verifies the countersignature by using the public key from the client's authentication credential stored in the associated Recipient Context. In particular:  </t>
            <ul spacing="normal" bare="false" empty="false" indent="3" pn="section-7.2-2.3.2">
              <li pn="section-7.2-2.3.2.1">
                <t indent="0" pn="section-7.2-2.3.2.1.1">If the server does not have the public key of the client yet, the server <bcp14>MUST</bcp14> stop processing the request and <bcp14>MAY</bcp14> respond with a 5.03 (Service Unavailable) response. The response <bcp14>MAY</bcp14> include a Max-Age Option, indicating to the client the number of seconds after which to retry. If the Max-Age Option is not present, <xref section="5.10.5" sectionFormat="of" target="RFC7252" format="default" derivedLink="https://rfc-editor.org/rfc/rfc7252#section-5.10.5" derivedContent="RFC7252"/> specifies a default retry time of 60 seconds.</t>
              </li>
              <li pn="section-7.2-2.3.2.2">
                <t indent="0" pn="section-7.2-2.3.2.2.1">The signature verification as defined below <bcp14>SHOULD</bcp14> be performed before decrypting the COSE object. An exception applies to implementations that cannot perform the two steps in this order. Those implementations <bcp14>MUST</bcp14> ensure that no access to the plaintext is possible before a successful signature verification and <bcp14>MUST</bcp14> prevent any possible leak of time-related information that can yield side-channel attacks.</t>
              </li>
              <li pn="section-7.2-2.3.2.3">
                <t indent="0" pn="section-7.2-2.3.2.3.1">The server retrieves the encrypted countersignature ENC_SIGNATURE from the message payload and computes the original countersignature SIGNATURE as:      </t>
                <t indent="0" pn="section-7.2-2.3.2.3.2">
SIGNATURE = ENC_SIGNATURE XOR KEYSTREAM      </t>
                <t indent="0" pn="section-7.2-2.3.2.3.3">
where KEYSTREAM is derived as per <xref target="sssec-encrypted-signature-keystream" format="default" sectionFormat="of" derivedContent="Section 4.2"/>.</t>
              </li>
              <li pn="section-7.2-2.3.2.4">
                <t indent="0" pn="section-7.2-2.3.2.4.1">The server verifies the original countersignature SIGNATURE as described in Sections <xref target="RFC9338" section="3.2" sectionFormat="bare" format="default" derivedLink="https://rfc-editor.org/rfc/rfc9338#section-3.2" derivedContent="RFC9338"/> and <xref target="RFC9338" section="3.3" sectionFormat="bare" format="default" derivedLink="https://rfc-editor.org/rfc/rfc9338#section-3.3" derivedContent="RFC9338"/> of <xref target="RFC9338" format="default" sectionFormat="of" derivedContent="RFC9338"/> by using the client's public key and according to the Signature Algorithm in the Security Context.      </t>
                <t indent="0" pn="section-7.2-2.3.2.4.2">
In particular, the Countersign_structure contains the context text string "CounterSignature0", the external_aad as defined in <xref target="sec-cose-object-ext-aad" format="default" sectionFormat="of" derivedContent="Section 3.4"/> of this document, and the ciphertext of the COSE object as payload.</t>
              </li>
              <li pn="section-7.2-2.3.2.5">
                <t indent="0" pn="section-7.2-2.3.2.5.1">If the signature verification fails, the server <bcp14>SHALL</bcp14> stop processing the request, <bcp14>SHALL NOT</bcp14> update the Replay Window, and <bcp14>MAY</bcp14> respond with a 4.00 (Bad Request) response. Such a response <bcp14>MAY</bcp14> include an Outer Max-Age Option with value zero, and its diagnostic payload <bcp14>MAY</bcp14> contain a string, which, if present, <bcp14>MUST</bcp14> be "Decryption failed" as if the decryption of the COSE object had failed.</t>
              </li>
              <li pn="section-7.2-2.3.2.6">
                <t indent="0" pn="section-7.2-2.3.2.6.1">When decrypting the COSE object using the Recipient Key, the Group Encryption Algorithm from the Common Context <bcp14>MUST</bcp14> be used.</t>
              </li>
            </ul>
          </li>
          <li pn="section-7.2-2.4">
            <t indent="0" pn="section-7.2-2.4.1">Additionally, if the used Recipient Context was created upon receiving
this request and the message is not verified successfully, the server
<bcp14>MAY</bcp14> delete that Recipient Context. When this behavior is specified by
the application, it mitigates attacks that aim at overloading the
server's storage.  </t>
            <t indent="0" pn="section-7.2-2.4.2">
If the server deletes the used Recipient Context in this particular circumstance, then this deletion does not require the server to initialize the Replay Window of any new Recipient Context created later within the Security Context as invalid (see <xref target="ssec-loss-mutable-context-overflow" format="default" sectionFormat="of" derivedContent="Section 2.6.1.2"/>).</t>
          </li>
        </ul>
        <t indent="0" pn="section-7.2-3">A server <bcp14>SHOULD NOT</bcp14> process a request if the received Recipient ID ('kid') is equal to its own Sender ID in its own Sender Context. However, in some applications, the server can prepare a request to be sent to itself (e.g., see <xref target="I-D.ietf-core-observe-multicast-notifications" format="default" sectionFormat="of" derivedContent="CoAP-MULT-NOTIF"/>), in which case such requests would be expected.</t>
        <t indent="0" pn="section-7.2-4">In addition, the following applies if the request establishes a long exchange and the server intends to reply with multiple responses:</t>
        <ul spacing="normal" bare="false" empty="false" indent="3" pn="section-7.2-5">
          <li pn="section-7.2-5.1">
            <t indent="0" pn="section-7.2-5.1.1">The server <bcp14>MUST</bcp14> store the value of the 'kid' parameter from the request and retain it until the last response has been sent. The server <bcp14>MUST NOT</bcp14> update the stored value of the 'kid' parameter associated with the request, even if the client is individually rekeyed and starts using a new Sender ID received from the Group Manager (see <xref target="new-sender-id" format="default" sectionFormat="of" derivedContent="Section 2.6.3.1"/>).</t>
          </li>
          <li pn="section-7.2-5.2">
            <t indent="0" pn="section-7.2-5.2.1">The server <bcp14>MUST</bcp14> store the value of the 'kid context' parameter from the request and retain it until the last response has been sent, i.e., beyond a possible change of ID Context following a group rekeying (see <xref target="sec-group-key-management" format="default" sectionFormat="of" derivedContent="Section 12.2"/>). That is, upon establishing a new Security Context with a new Gid as ID Context (see <xref target="new-sec-context" format="default" sectionFormat="of" derivedContent="Section 2.6.3.2"/>), the server <bcp14>MUST NOT</bcp14> update the stored value of a 'kid context' parameter associated with the request.</t>
          </li>
        </ul>
      </section>
      <section anchor="ssec-protect-response" numbered="true" removeInRFC="false" toc="include" pn="section-7.3">
        <name slugifiedName="name-protecting-the-response">Protecting the Response</name>
        <t indent="0" pn="section-7.3-1">When using the group mode to protect a response, a server proceeds as described in <xref section="8.3" sectionFormat="of" target="RFC8613" format="default" derivedLink="https://rfc-editor.org/rfc/rfc8613#section-8.3" derivedContent="RFC8613"/> with the following modifications.</t>
        <t indent="0" pn="section-7.3-2">Note that the server always protects a response with the Sender Context from its latest Security Context, and that establishing a new Security Context resets the Sender Sequence Number to 0 (see Sections <xref target="new-sender-id" format="counter" sectionFormat="of" derivedContent="2.6.3.1"/> and <xref target="new-sec-context" format="counter" sectionFormat="of" derivedContent="2.6.3.2"/>).</t>
        <ul spacing="normal" bare="false" empty="false" indent="3" pn="section-7.3-3">
          <li pn="section-7.3-3.1">
            <t indent="0" pn="section-7.3-3.1.1">In Step 2, the AAD is modified as described in <xref target="sec-cose-object-ext-aad" format="default" sectionFormat="of" derivedContent="Section 3.4"/> of this document.  </t>
            <t indent="0" pn="section-7.3-3.1.2">
In addition, the following applies if the server intends to reply with multiple responses within the long exchange established by the corresponding request:  </t>
            <ul spacing="normal" bare="false" empty="false" indent="3" pn="section-7.3-3.1.3">
              <li pn="section-7.3-3.1.3.1">
                <t indent="0" pn="section-7.3-3.1.3.1.1">The server <bcp14>MUST</bcp14> use the stored value of the 'kid' parameter from the request (see <xref target="ssec-verify-request" format="default" sectionFormat="of" derivedContent="Section 7.2"/>) as the value for the 'request_kid' parameter in the external_aad (see <xref target="sec-cose-object-ext-aad" format="default" sectionFormat="of" derivedContent="Section 3.4"/>).</t>
              </li>
              <li pn="section-7.3-3.1.3.2">
                <t indent="0" pn="section-7.3-3.1.3.2.1">The server <bcp14>MUST</bcp14> use the stored value of the 'kid context' parameter from the request (see <xref target="ssec-verify-request" format="default" sectionFormat="of" derivedContent="Section 7.2"/>) as the value for the 'request_kid_context' parameter in the external_aad (see <xref target="sec-cose-object-ext-aad" format="default" sectionFormat="of" derivedContent="Section 3.4"/>).</t>
              </li>
            </ul>
          </li>
          <li pn="section-7.3-3.2">
            <t indent="0" pn="section-7.3-3.2.1">In Step 3, if either of the following conditions applies, the server <bcp14>MUST</bcp14> include its Sender Sequence Number as Partial IV in the response and use it to build the nonce to protect the response. This prevents the server from reusing the nonce from the request together with the same encryption key.  </t>
            <ul spacing="normal" bare="false" empty="false" indent="3" pn="section-7.3-3.2.2">
              <li pn="section-7.3-3.2.2.1">
                <t indent="0" pn="section-7.3-3.2.2.1.1">The response is not the first response that the server sends to the request.</t>
              </li>
              <li pn="section-7.3-3.2.2.2">
                <t indent="0" pn="section-7.3-3.2.2.2.1">The server is using a different Security Context for the response than the one that was used to verify the request (see <xref target="sec-group-key-management" format="default" sectionFormat="of" derivedContent="Section 12.2"/>).</t>
              </li>
            </ul>
          </li>
          <li pn="section-7.3-3.3">
            <t indent="0" pn="section-7.3-3.3.1">In Step 4, the encryption of the COSE object is modified as described in <xref target="sec-cose-object" format="default" sectionFormat="of" derivedContent="Section 3"/> of this document. The encoding of the compressed COSE object is modified as described in <xref target="compression" format="default" sectionFormat="of" derivedContent="Section 4"/> of this document. In particular, the Group Flag <bcp14>MUST</bcp14> be set to 1. The Group Encryption Algorithm from the Common Context <bcp14>MUST</bcp14> be used.  </t>
            <t indent="0" pn="section-7.3-3.3.2">
In addition, the following applies:  </t>
            <ul spacing="normal" bare="false" empty="false" indent="3" pn="section-7.3-3.3.3">
              <li pn="section-7.3-3.3.3.1">
                <t indent="0" pn="section-7.3-3.3.3.1.1">If the server is using a different ID Context (Gid) for the response than the one that was used to verify the request (see <xref target="sec-group-key-management" format="default" sectionFormat="of" derivedContent="Section 12.2"/>) and this is the first response from the server to that request, then the new ID Context <bcp14>MUST</bcp14> be included in the 'kid context' parameter of the response.</t>
              </li>
              <li pn="section-7.3-3.3.3.2">
                <t indent="0" pn="section-7.3-3.3.3.2.1">The server may be replying to a request that was protected with an old Security Context. After completing the establishment of a new Security Context, the server <bcp14>MUST</bcp14> protect all the responses to that request with the Sender Context of the new Security Context.      </t>
                <t indent="0" pn="section-7.3-3.3.3.2.2">
For each ongoing long exchange, the server can help the client to synchronize by also including the 'kid context' parameter in responses following a group rekeying, with the value set to the ID Context (Gid) of the new Security Context.      </t>
                <t indent="0" pn="section-7.3-3.3.3.2.3">
If there is a known upper limit to the duration of a group rekeying, the server <bcp14>SHOULD</bcp14> include the 'kid context' parameter during that time. Otherwise, the server <bcp14>SHOULD</bcp14> include it until the Max-Age has expired for the last response sent before the installation of the new Security Context.</t>
              </li>
              <li pn="section-7.3-3.3.3.3">
                <t indent="0" pn="section-7.3-3.3.3.3.1">The server can obtain a new Sender ID from the Group Manager when individually rekeyed (see <xref target="new-sender-id" format="default" sectionFormat="of" derivedContent="Section 2.6.3.1"/>) or when re-joining the group. In such a case, the server can help the client to synchronize by including the 'kid' parameter in a response protected in group mode even when the request was protected in pairwise mode (see <xref target="sec-pairwise-protection-req" format="default" sectionFormat="of" derivedContent="Section 8.3"/>).      </t>
                <t indent="0" pn="section-7.3-3.3.3.3.2">
That is, when responding to a request protected in pairwise mode, the server <bcp14>SHOULD</bcp14> include the 'kid' parameter in a response protected in group mode, if it is replying to that client for the first time since the assignment of its new Sender ID.</t>
              </li>
            </ul>
          </li>
          <li pn="section-7.3-3.4">
            <t indent="0" pn="section-7.3-3.4.1">In Step 5, the countersignature is computed and the format of the OSCORE message is modified as described in Sections <xref target="sec-cose-object" format="counter" sectionFormat="of" derivedContent="3"/> and <xref target="compression" format="counter" sectionFormat="of" derivedContent="4"/> of this document. In particular the payload of the Group OSCORE message includes also the encrypted countersignature (see <xref target="compression-details" format="default" sectionFormat="of" derivedContent="Section 4.1"/>).</t>
          </li>
        </ul>
      </section>
      <section anchor="ssec-verify-response" numbered="true" removeInRFC="false" toc="include" pn="section-7.4">
        <name slugifiedName="name-verifying-the-response">Verifying the Response</name>
        <t indent="0" pn="section-7.4-1">Upon receiving a protected response with the Group Flag set to 1, following the procedure in <xref target="sec-message-reception" format="default" sectionFormat="of" derivedContent="Section 6"/>, a client proceeds as described in <xref section="8.4" sectionFormat="of" target="RFC8613" format="default" derivedLink="https://rfc-editor.org/rfc/rfc8613#section-8.4" derivedContent="RFC8613"/> with the following modifications.</t>
        <t indent="0" pn="section-7.4-2">Note that a client may receive a response protected with a Security Context different from the one used to protect the corresponding request, and that, upon the establishment of a new Security Context, the client re-initializes its Replay Windows in its Recipient Contexts (see <xref target="new-sec-context" format="default" sectionFormat="of" derivedContent="Section 2.6.3.2"/>).</t>
        <ul spacing="normal" bare="false" empty="false" indent="3" pn="section-7.4-3">
          <li pn="section-7.4-3.1">
            <t indent="0" pn="section-7.4-3.1.1">In Step 2, the decoding of the compressed COSE object is modified as described in <xref target="compression" format="default" sectionFormat="of" derivedContent="Section 4"/> of this document. In particular, a 'kid' may not be present if the response is a reply to a request protected in pairwise mode. In such a case, the client assumes the response 'kid' to be the Recipient ID for the server for which the request protected in pairwise mode was intended.  </t>
            <t indent="0" pn="section-7.4-3.1.2">
If the response 'kid context' matches an existing ID Context (Gid) but the received/assumed 'kid' does not match any Recipient ID in this Security Context, then the client <bcp14>MAY</bcp14> create a new Recipient Context for this Recipient ID and initialize it according to <xref section="3" sectionFormat="of" target="RFC8613" format="default" derivedLink="https://rfc-editor.org/rfc/rfc8613#section-3" derivedContent="RFC8613"/>, and also retrieve the authentication credential associated with the Recipient ID to be stored in the new Recipient Context. If the application does not specify dynamic derivation of new Recipient Contexts, then the client <bcp14>SHALL</bcp14> stop processing the response.</t>
          </li>
          <li pn="section-7.4-3.2">
            <t indent="0" pn="section-7.4-3.2.1">In Step 3, the AAD is modified as described in <xref target="sec-cose-object-ext-aad" format="default" sectionFormat="of" derivedContent="Section 3.4"/> of this document.  </t>
            <t indent="0" pn="section-7.4-3.2.2">
In addition, the following applies if the client processes a response to a request within a long exchange:  </t>
            <ul spacing="normal" bare="false" empty="false" indent="3" pn="section-7.4-3.2.3">
              <li pn="section-7.4-3.2.3.1">
                <t indent="0" pn="section-7.4-3.2.3.1.1">The client <bcp14>MUST</bcp14> use the stored value of the 'kid' parameter from the request (see <xref target="ssec-protect-request" format="default" sectionFormat="of" derivedContent="Section 7.1"/>) as the value for the 'request_kid' parameter in the external_aad (see <xref target="sec-cose-object-ext-aad" format="default" sectionFormat="of" derivedContent="Section 3.4"/>).</t>
              </li>
              <li pn="section-7.4-3.2.3.2">
                <t indent="0" pn="section-7.4-3.2.3.2.1">The client <bcp14>MUST</bcp14> use the stored value of the 'kid context' parameter from the request (see <xref target="ssec-protect-request" format="default" sectionFormat="of" derivedContent="Section 7.1"/>) as the value for the 'request_kid_context' parameter in the external_aad (see <xref target="sec-cose-object-ext-aad" format="default" sectionFormat="of" derivedContent="Section 3.4"/>).</t>
              </li>
            </ul>
            <t indent="0" pn="section-7.4-3.2.4">
This ensures that, throughout a long exchange, the client can correctly verify the received responses, even if the client is individually rekeyed and starts using a new Sender ID received from the Group Manager (see <xref target="new-sender-id" format="default" sectionFormat="of" derivedContent="Section 2.6.3.1"/>), as well as when it installs a new Security Context with a new ID Context (Gid) following a group rekeying (see <xref target="new-sec-context" format="default" sectionFormat="of" derivedContent="Section 2.6.3.2"/>).</t>
          </li>
          <li pn="section-7.4-3.3">
            <t indent="0" pn="section-7.4-3.3.1">In Step 5, the client also verifies the countersignature by using the public key from the server's authentication credential stored in the associated Recipient Context. In particular:  </t>
            <ul spacing="normal" bare="false" empty="false" indent="3" pn="section-7.4-3.3.2">
              <li pn="section-7.4-3.3.2.1">
                <t indent="0" pn="section-7.4-3.3.2.1.1">The signature verification as defined below <bcp14>SHOULD</bcp14> be performed before decrypting the COSE object. An exception applies to implementations that cannot perform the two steps in this order. Those implementations <bcp14>MUST</bcp14> ensure that no access to the plaintext is possible before a successful signature verification and <bcp14>MUST</bcp14> prevent any possible leak of time-related information that can yield side-channel attacks.</t>
              </li>
              <li pn="section-7.4-3.3.2.2">
                <t indent="0" pn="section-7.4-3.3.2.2.1">The client retrieves the encrypted countersignature ENC_SIGNATURE from the message payload and computes the original countersignature SIGNATURE as:      </t>
                <t indent="0" pn="section-7.4-3.3.2.2.2">
SIGNATURE = ENC_SIGNATURE XOR KEYSTREAM      </t>
                <t indent="0" pn="section-7.4-3.3.2.2.3">
where KEYSTREAM is derived as per <xref target="sssec-encrypted-signature-keystream" format="default" sectionFormat="of" derivedContent="Section 4.2"/>.      </t>
                <t indent="0" pn="section-7.4-3.3.2.2.4">
The client verifies the original countersignature SIGNATURE. This is analogous to what is defined in <xref target="ssec-verify-request" format="default" sectionFormat="of" derivedContent="Section 7.2"/> for the signature verification of a request, with the client using the server's public key and referring to the present response and the COSE object conveyed therein.</t>
              </li>
              <li pn="section-7.4-3.3.2.3">
                <t indent="0" pn="section-7.4-3.3.2.3.1">If the signature verification fails, the client <bcp14>SHALL</bcp14> stop processing the response and <bcp14>SHALL NOT</bcp14> update the Response Number associated with the server.</t>
              </li>
              <li pn="section-7.4-3.3.2.4">
                <t indent="0" pn="section-7.4-3.3.2.4.1">After a successful signature verification, the client also performs the following actions if the request was protected in pairwise mode (see <xref target="sec-pairwise-protection-req" format="default" sectionFormat="of" derivedContent="Section 8.3"/>):      </t>
                <ul spacing="normal" bare="false" empty="false" indent="3" pn="section-7.4-3.3.2.4.2">
                  <li pn="section-7.4-3.3.2.4.2.1">
                    <t indent="0" pn="section-7.4-3.3.2.4.2.1.1">If the 'kid' parameter is present in the response, the client checks whether this received 'kid' is equal to the expected 'kid', i.e., the known Recipient ID for the server for which the request was intended.</t>
                  </li>
                  <li pn="section-7.4-3.3.2.4.2.2">
                    <t indent="0" pn="section-7.4-3.3.2.4.2.2.1">If the 'kid' parameter is not present in the response, the client checks whether the server that has sent the response is the same one for which the request was intended. This can be done by checking that the public key used to verify the countersignature of the response is equal to the public key included in the authentication credential Recipient Auth Cred, which was taken as input to derive the Pairwise Sender Key used for protecting the request (see <xref target="key-derivation-pairwise" format="default" sectionFormat="of" derivedContent="Section 2.5.1"/>).</t>
                  </li>
                </ul>
                <t indent="0" pn="section-7.4-3.3.2.4.3">
In either case, if the client determines that the response has come from a different server than the expected one, then the client: i) <bcp14>SHALL</bcp14> discard the response and <bcp14>SHALL NOT</bcp14> deliver it to the application, and ii) <bcp14>SHALL NOT</bcp14> update the Response Number associated with the server.      </t>
                <t indent="0" pn="section-7.4-3.3.2.4.4">
Otherwise, the client hereafter considers the received 'kid' as the current Recipient ID for the server.</t>
              </li>
            </ul>
          </li>
          <li pn="section-7.4-3.4">
            <t indent="0" pn="section-7.4-3.4.1">In Step 5, when decrypting the COSE object using the Recipient Key, the Group Encryption Algorithm from the Common Context <bcp14>MUST</bcp14> be used.  </t>
            <t indent="0" pn="section-7.4-3.4.2">
In addition, the client performs the following actions if the response is received within a long exchange.  </t>
            <ul spacing="normal" bare="false" empty="false" indent="3" pn="section-7.4-3.4.3">
              <li pn="section-7.4-3.4.3.1">
                <t indent="0" pn="section-7.4-3.4.3.1.1">The ordering and the replay protection of responses received from the server during the long exchange are performed as per <xref target="sec-replay-protection-responses" format="default" sectionFormat="of" derivedContent="Section 5.3.1"/> of this document by using the Response Number associated with that server within that long exchange. In the case of unsuccessful decryption and verification of a response, the client <bcp14>SHALL NOT</bcp14> update the Response Number associated with the server.</t>
              </li>
              <li pn="section-7.4-3.4.3.2">
                <t indent="0" pn="section-7.4-3.4.3.2.1">When receiving the first valid response from the server within the long exchange, the client <bcp14>MUST</bcp14> store the kid "kid1" of that server for that long exchange. If the 'kid' field is included in the OSCORE Option of the response, its value specifies "kid1". If the request was protected in pairwise mode (see <xref target="sec-pairwise-protection-req" format="default" sectionFormat="of" derivedContent="Section 8.3"/>), the 'kid' field may not be present in the OSCORE Option of the response (see <xref target="sec-cose-object-kid" format="default" sectionFormat="of" derivedContent="Section 3.2"/>). In this case, the client assumes "kid1" to be the Recipient ID for the server for which the request was intended.</t>
              </li>
              <li pn="section-7.4-3.4.3.3">
                <t indent="0" pn="section-7.4-3.4.3.3.1">When receiving another valid response to the same request from the same server -- which can be identified and recognized through the same public key used to verify the countersignature and included in the server's authentication credential -- the client determines the kid "kid2" of the server as above for "kid1", and it <bcp14>MUST</bcp14> check whether "kid2" is equal to the stored "kid1".      </t>
                <t indent="0" pn="section-7.4-3.4.3.3.2">
If "kid1" and "kid2" are different, the client <bcp14>SHOULD NOT</bcp14> accept the response as valid to be delivered to the application and <bcp14>SHOULD NOT</bcp14> update the Response Number associated with the server. Exceptions can apply as the client can retain the information required to order the responses, or if the client application does not require response ordering altogether. Servers <bcp14>MUST NOT</bcp14> rely on clients tolerating this unless it was explicitly agreed on (e.g., as part of the group's setup).</t>
              </li>
            </ul>
            <t indent="0" pn="section-7.4-3.4.4">
Note that, if "kid2" is different from "kid1" and the 'kid' field is omitted from the response -- which is possible if the request was protected in pairwise mode -- then the client will compute a wrong keystream to decrypt the countersignature (i.e., by using "kid1" rather than "kid2" in the 'id' field of the 'info' array in <xref target="sssec-encrypted-signature-keystream" format="default" sectionFormat="of" derivedContent="Section 4.2"/>), thus subsequently failing to verify the countersignature and discarding the response.  </t>
            <t indent="0" pn="section-7.4-3.4.5">
This ensures that the client remains able to correctly perform the ordering and replay protection of responses within a long exchange, even if the server legitimately starts using a new Sender ID, as received from the Group Manager when individually rekeyed (see <xref target="new-sender-id" format="default" sectionFormat="of" derivedContent="Section 2.6.3.1"/>) or when re-joining the group.</t>
          </li>
          <li pn="section-7.4-3.5">
            <t indent="0" pn="section-7.4-3.5.1">In Step 8, if the used Recipient Context was created upon receiving this response and the message is not verified successfully, the client <bcp14>MAY</bcp14> delete that Recipient Context. When this behavior is specified by the application, it mitigates attacks that aim at overloading the client's storage.  </t>
            <t indent="0" pn="section-7.4-3.5.2">
If the client deletes the used Recipient Context in this particular circumstance, then this deletion does not require the client to initialize the Replay Window of any new Recipient Context created later within the Security Context as invalid (see <xref target="ssec-loss-mutable-context-overflow" format="default" sectionFormat="of" derivedContent="Section 2.6.1.2"/>).</t>
          </li>
        </ul>
      </section>
      <section anchor="sec-processing-signature-checker" numbered="true" removeInRFC="false" toc="include" pn="section-7.5">
        <name slugifiedName="name-external-signature-checkers">External Signature Checkers</name>
        <t indent="0" pn="section-7.5-1">When a message is protected in group mode, it is possible for designated external signature checkers to verify the countersignature of the message.  For example, an external signature checker can be an intermediary gateway that intercepts messages protected in group mode and ensures that they reach the intended recipients only if it successfully verifies their countersignatures.</t>
        <t indent="0" pn="section-7.5-2">Since they do not join a group as members, external signature checkers need to retrieve the authentication credentials and other information (e.g., the Sender IDs) associated with group members from the Group Manager, together with other selected group data such as the current Signature Encryption Key (see <xref target="ssec-common-context-group-enc-key" format="default" sectionFormat="of" derivedContent="Section 2.1.9"/>). <xref target="sec-additional-entities" format="default" sectionFormat="of" derivedContent="Section 12.3"/> describes how the Group Manager supports signature checkers.</t>
        <t indent="0" pn="section-7.5-3">When receiving a message protected in group mode, a signature checker proceeds as follows.</t>
        <ul spacing="normal" bare="false" empty="false" indent="3" pn="section-7.5-4">
          <li pn="section-7.5-4.1">
            <t indent="0" pn="section-7.5-4.1.1">The signature checker retrieves the encrypted countersignature ENC_SIGNATURE from the message payload and computes the original countersignature SIGNATURE as:  </t>
            <t indent="0" pn="section-7.5-4.1.2">
SIGNATURE = ENC_SIGNATURE XOR KEYSTREAM  </t>
            <t indent="0" pn="section-7.5-4.1.3">
where KEYSTREAM is derived as per <xref target="sssec-encrypted-signature-keystream" format="default" sectionFormat="of" derivedContent="Section 4.2"/>.</t>
          </li>
          <li pn="section-7.5-4.2">
            <t indent="0" pn="section-7.5-4.2.1">The signature checker verifies the original countersignature SIGNATURE according to what is defined in <xref target="ssec-verify-request" format="default" sectionFormat="of" derivedContent="Section 7.2"/> for requests and in <xref target="ssec-verify-response" format="default" sectionFormat="of" derivedContent="Section 7.4"/> for responses by using the public key of the sender endpoint as included in that endpoint's authentication credential. The signature checker determines the right authentication credential based on the ID Context (Gid) and the Sender ID of the sender endpoint.</t>
          </li>
        </ul>
        <t indent="0" pn="section-7.5-5">Note that the following applies when attempting to verify the countersignature of a response message:</t>
        <ul spacing="normal" bare="false" empty="false" indent="3" pn="section-7.5-6">
          <li pn="section-7.5-6.1">
            <t indent="0" pn="section-7.5-6.1.1">The response may not include a Partial IV. In such a case, the signature checker considers the same value of the Partial IV from the corresponding request, i.e., the request matching with the response by CoAP Token value.</t>
          </li>
          <li pn="section-7.5-6.2">
            <t indent="0" pn="section-7.5-6.2.1">The response may not include an ID Context. In such a case, the signature checker considers the current ID Context used in the group. By default, such ID Context has the same value of the ID Context from the corresponding request, i.e., the request matching with the response by CoAP Token value.</t>
            <t indent="0" pn="section-7.5-6.2.2">Since the ID Context (Gid) changes every time the group is rekeyed (see <xref target="sec-group-key-management" format="default" sectionFormat="of" derivedContent="Section 12.2"/>), the server that originated the response could have used a different ID Context when protecting the response compared to the ID Context that it used to verify (that the client used to protect) the request matching with the response (see <xref target="ssec-protect-response" format="default" sectionFormat="of" derivedContent="Section 7.3"/>). In particular, <xref target="ssec-protect-response" format="default" sectionFormat="of" derivedContent="Section 7.3"/> defines the rules for the inclusion of the ID Context in responses protected in group mode, e.g., following a group rekeying.</t>
            <t indent="0" pn="section-7.5-6.2.3">When the signature checker receives a response protected in group mode that includes an ID Context different from the one known to be current, the signature checker takes that as an indication that a group rekeying has occurred. Then, the signature checker retrieves updated group data from the Group Manager, such as the current ID Context and Signature Encryption Key used in the group (see <xref target="sec-additional-entities" format="default" sectionFormat="of" derivedContent="Section 12.3"/>). From then on, the signature checker considers the ID Context retrieved from the Group Manager as the current ID Context used in the group.</t>
          </li>
          <li pn="section-7.5-6.3">
            <t indent="0" pn="section-7.5-6.3.1">The response may not include a Sender ID. This can happen when the response protected in group mode matches a request protected in pairwise mode (see Sections <xref target="sec-cose-object-kid" format="counter" sectionFormat="of" derivedContent="3.2"/> and <xref target="sec-pairwise-protection-req" format="counter" sectionFormat="of" derivedContent="8.3"/>) with a case in point provided by <xref target="I-D.ietf-core-cacheable-oscore" format="default" sectionFormat="of" derivedContent="CACHEABLE-OSCORE"/>. In such a case, the signature checker needs to use other means (e.g., source addressing information of the server endpoint) to identify the correct authentication credential including the public key to use for verifying the countersignature of the response.</t>
          </li>
        </ul>
        <t indent="0" pn="section-7.5-7">The particular actions following a successful or unsuccessful verification of the countersignature are application-specific and out of the scope of this document.</t>
      </section>
    </section>
    <section anchor="sec-pairwise-protection" numbered="true" removeInRFC="false" toc="include" pn="section-8">
      <name slugifiedName="name-message-processing-in-pairw">Message Processing in Pairwise Mode</name>
      <t indent="0" pn="section-8-1">When using the pairwise mode of Group OSCORE, messages are protected and processed as in <xref target="RFC8613" format="default" sectionFormat="of" derivedContent="RFC8613"/> with the modifications described in this section. The security objectives of the pairwise mode are discussed in <xref target="ssec-sec-objectives" format="default" sectionFormat="of" derivedContent="Appendix A.2"/>.</t>
      <t indent="0" pn="section-8-2">The possible use of the pairwise mode is indicated by the Group Manager as part of the group data provided to new group members when joining the group, according to which the parameters AEAD Algorithm and Pairwise Key Agreement Algorithm in the Security Context are set (see <xref target="sec-context" format="default" sectionFormat="of" derivedContent="Section 2"/>).</t>
      <t indent="0" pn="section-8-3">The pairwise mode takes advantage of an existing Security Context to establish keying material shared exclusively with each other member. For encryption and decryption operations in pairwise mode, the AEAD Algorithm from the Common Context is used (see <xref target="ssec-common-context-aead-alg" format="default" sectionFormat="of" derivedContent="Section 2.1.1"/>).</t>
      <t indent="0" pn="section-8-4">In order to use the pairwise mode in a group where the group mode is also used (i.e., Group Encryption Algorithm and Signature Algorithm in the Security Context are set), the public/private key pairs used for signature operations of the group mode <bcp14>MUST</bcp14> be possible to also use for key agreement operations. For example, this can rely on signing operations using ECDSA and encryption operations using AES Counter Mode with CBC-MAC (AES-CCM) with keying material derived through ECDH.</t>
      <t indent="0" pn="section-8-5">The pairwise mode does not support external verifiers of source authentication and message integrity like the group mode does, e.g., for external signature checkers (see <xref target="sec-processing-signature-checker" format="default" sectionFormat="of" derivedContent="Section 7.5"/>).</t>
      <t indent="0" pn="section-8-6">An endpoint implementing only a silent server does not support the pairwise mode.</t>
      <t indent="0" pn="section-8-7">Endpoints using the CoAP Echo Option <xref target="RFC9175" format="default" sectionFormat="of" derivedContent="RFC9175"/> in a group where the AEAD Algorithm and Pairwise Key Agreement Algorithm are set <bcp14>MUST</bcp14> support the pairwise mode. When using the challenge-response method defined in <xref target="sec-synch-challenge-response" format="default" sectionFormat="of" derivedContent="Section 9"/>, this prevents the attack described in <xref target="ssec-unicast-requests" format="default" sectionFormat="of" derivedContent="Section 13.9"/>, which leverages requests sent over unicast to a single group member and protected in group mode.</t>
      <t indent="0" pn="section-8-8">The pairwise mode cannot be used to protect messages intended for multiple recipients, as the keying material used for the pairwise mode is shared only between two endpoints.</t>
      <t indent="0" pn="section-8-9">However, a sender can use the pairwise mode to protect a message sent to (but not intended for) multiple recipients, if interested in a response from only one of them. For instance, this is useful to support the address discovery service defined in <xref target="ssec-pre-conditions" format="default" sectionFormat="of" derivedContent="Section 8.1"/> when a single 'kid' value is indicated in the payload of a request sent to multiple recipients, e.g., over multicast.</t>
      <section anchor="ssec-pre-conditions" numbered="true" removeInRFC="false" toc="include" pn="section-8.1">
        <name slugifiedName="name-preconditions">Preconditions</name>
        <t indent="0" pn="section-8.1-1">In order to protect an outgoing message in pairwise mode, the sender needs to know the authentication credential and the Recipient ID for the recipient endpoint as stored in the Recipient Context associated with that endpoint (see <xref target="pairwise-implementation" format="default" sectionFormat="of" derivedContent="Section 2.5.4"/>).</t>
        <t indent="0" pn="section-8.1-2">Typically, the sender endpoint sends the message protected in pairwise mode over unicast, so that the message is delivered only to the intended recipient endpoint for which it is protected. This requires the sender to know the individual address of that recipient endpoint, which the sender may not know at any given point in time. For instance, right after having joined the group, a client may know the authentication credential and Recipient ID for a given server, but not the addressing information required to reach it with an individual, one-to-one request.</t>
        <t indent="0" pn="section-8.1-3">In order to make addressing information of individual endpoints available, servers in the group <bcp14>MAY</bcp14> expose a resource to which a client can send a request targeting a set of servers, identified by their 'kid' values specified in the request payload, or implicitly if the request is sent in pairwise mode. Further details of such an interface are out of scope for this document.</t>
      </section>
      <section anchor="sec-differences-oscore-pairwise" numbered="true" removeInRFC="false" toc="include" pn="section-8.2">
        <name slugifiedName="name-main-differences-from-oscor">Main Differences from OSCORE</name>
        <t indent="0" pn="section-8.2-1">The pairwise mode protects messages between two members of a group, essentially following <xref target="RFC8613" format="default" sectionFormat="of" derivedContent="RFC8613"/> but with the following notable differences:</t>
        <ul spacing="normal" bare="false" empty="false" indent="3" pn="section-8.2-2">
          <li pn="section-8.2-2.1">
            <t indent="0" pn="section-8.2-2.1.1">The 'kid' and 'kid context' parameters of the COSE object are used as defined in <xref target="sec-cose-object-kid" format="default" sectionFormat="of" derivedContent="Section 3.2"/> of this document.</t>
          </li>
          <li pn="section-8.2-2.2">
            <t indent="0" pn="section-8.2-2.2.1">The external_aad defined in <xref target="sec-cose-object-ext-aad" format="default" sectionFormat="of" derivedContent="Section 3.4"/> of this document is used for the encryption and decryption process.</t>
          </li>
          <li pn="section-8.2-2.3">
            <t indent="0" pn="section-8.2-2.3.1">The Pairwise Sender/Recipient Keys defined in <xref target="sec-derivation-pairwise" format="default" sectionFormat="of" derivedContent="Section 2.5"/> of this document are used for the encryption and decryption process, instead of the Sender Keys and Recipient Keys.</t>
          </li>
        </ul>
      </section>
      <section anchor="sec-pairwise-protection-req" numbered="true" removeInRFC="false" toc="include" pn="section-8.3">
        <name slugifiedName="name-protecting-the-request-2">Protecting the Request</name>
        <t indent="0" pn="section-8.3-1">When using the pairwise mode to protect a request, a client <bcp14>SHALL</bcp14> proceed as described in <xref section="8.1" sectionFormat="of" target="RFC8613" format="default" derivedLink="https://rfc-editor.org/rfc/rfc8613#section-8.1" derivedContent="RFC8613"/> with the differences summarized in <xref target="sec-differences-oscore-pairwise" format="default" sectionFormat="of" derivedContent="Section 8.2"/> of this document.</t>
        <t indent="0" pn="section-8.3-2">Furthermore, when sending a request that establishes a long exchange, what is specified in <xref target="ssec-protect-request" format="default" sectionFormat="of" derivedContent="Section 7.1"/> of this document applies, with respect to storing the value of the 'kid' and 'kid context' parameters and to storing an invariant identifier of the group.</t>
      </section>
      <section anchor="sec-pairwise-verify-req" numbered="true" removeInRFC="false" toc="include" pn="section-8.4">
        <name slugifiedName="name-verifying-the-request-2">Verifying the Request</name>
        <t indent="0" pn="section-8.4-1">Upon receiving a protected request with the Group Flag set to 0, following the procedure in <xref target="sec-message-reception" format="default" sectionFormat="of" derivedContent="Section 6"/>, a server <bcp14>SHALL</bcp14> proceed as described in <xref section="8.2" sectionFormat="of" target="RFC8613" format="default" derivedLink="https://rfc-editor.org/rfc/rfc8613#section-8.2" derivedContent="RFC8613"/> with the differences summarized in <xref target="sec-differences-oscore-pairwise" format="default" sectionFormat="of" derivedContent="Section 8.2"/> of this document. The following differences also apply:</t>
        <ul spacing="normal" bare="false" empty="false" indent="3" pn="section-8.4-2">
          <li pn="section-8.4-2.1">
            <t indent="0" pn="section-8.4-2.1.1">If the server discards the request due to not retrieving a Security Context associated with the OSCORE group or to not supporting the pairwise mode, the server <bcp14>MAY</bcp14> respond with a 4.01 (Unauthorized) error message or a 4.02 (Bad Option) error message, respectively. When doing so, the server <bcp14>MAY</bcp14> set an Outer Max-Age Option with value zero and <bcp14>MAY</bcp14> include a descriptive string as diagnostic payload.</t>
          </li>
          <li pn="section-8.4-2.2">
            <t indent="0" pn="section-8.4-2.2.1">If a new Recipient Context is created for this Recipient ID, new Pairwise Sender/Recipient Keys are also derived (see <xref target="key-derivation-pairwise" format="default" sectionFormat="of" derivedContent="Section 2.5.1"/>). The new Pairwise Sender/Recipient Keys are deleted if the Recipient Context is deleted as a result of the message not being successfully verified.</t>
          </li>
          <li pn="section-8.4-2.3">
            <t indent="0" pn="section-8.4-2.3.1">What is specified in <xref target="ssec-verify-request" format="default" sectionFormat="of" derivedContent="Section 7.2"/> of this document applies with respect to the following points:  </t>
            <ul spacing="normal" bare="false" empty="false" indent="3" pn="section-8.4-2.3.2">
              <li pn="section-8.4-2.3.2.1">
                <t indent="0" pn="section-8.4-2.3.2.1.1">The possible, dynamic creation and configuration of a Recipient Context upon receiving the request.</t>
              </li>
              <li pn="section-8.4-2.3.2.2">
                <t indent="0" pn="section-8.4-2.3.2.2.1">The possible deletion of a Recipient Context created upon receiving the request, in the case that the request is not verified successfully.</t>
              </li>
              <li pn="section-8.4-2.3.2.3">
                <t indent="0" pn="section-8.4-2.3.2.3.1">The rule about processing the request where the received Recipient ID ('kid') is equal to the server's Sender ID.</t>
              </li>
              <li pn="section-8.4-2.3.2.4">
                <t indent="0" pn="section-8.4-2.3.2.4.1">The storing of the value of the 'kid' and 'kid context' parameters from the request if the server intends to reply with multiple responses within the long exchange established by the request.</t>
              </li>
            </ul>
          </li>
        </ul>
      </section>
      <section anchor="sec-pairwise-protection-resp" numbered="true" removeInRFC="false" toc="include" pn="section-8.5">
        <name slugifiedName="name-protecting-the-response-2">Protecting the Response</name>
        <t indent="0" pn="section-8.5-1">When using the pairwise mode to protect a response, a server <bcp14>SHALL</bcp14> proceed as described in <xref section="8.3" sectionFormat="of" target="RFC8613" format="default" derivedLink="https://rfc-editor.org/rfc/rfc8613#section-8.3" derivedContent="RFC8613"/> with the differences summarized in <xref target="sec-differences-oscore-pairwise" format="default" sectionFormat="of" derivedContent="Section 8.2"/> of this document. The following differences also apply:</t>
        <ul spacing="normal" bare="false" empty="false" indent="3" pn="section-8.5-2">
          <li pn="section-8.5-2.1">
            <t indent="0" pn="section-8.5-2.1.1">What is specified in <xref target="ssec-protect-response" format="default" sectionFormat="of" derivedContent="Section 7.3"/> of this document applies with respect to the following points.  </t>
            <ul spacing="normal" bare="false" empty="false" indent="3" pn="section-8.5-2.1.2">
              <li pn="section-8.5-2.1.2.1">
                <t indent="0" pn="section-8.5-2.1.2.1.1">The protection of a response when using a different Security Context than the one used to verify the corresponding request (see <xref target="sec-group-key-management" format="default" sectionFormat="of" derivedContent="Section 12.2"/>). That is, the server always protects a response with the Sender Context from its latest Security Context, and establishing a new Security Context resets the Sender Sequence Number to 0 (see Sections <xref target="new-sender-id" format="counter" sectionFormat="of" derivedContent="2.6.3.1"/> and <xref target="new-sec-context" format="counter" sectionFormat="of" derivedContent="2.6.3.2"/>).</t>
              </li>
              <li pn="section-8.5-2.1.2.2">
                <t indent="0" pn="section-8.5-2.1.2.2.1">The use of the stored value of the 'kid' and 'kid context' parameters, if the server intends to reply with multiple responses within the long exchange established by the request.</t>
              </li>
              <li pn="section-8.5-2.1.2.3">
                <t indent="0" pn="section-8.5-2.1.2.3.1">The rules for the inclusion of the server's Sender Sequence Number as Partial IV in a response, as used to build the nonce to protect the response.</t>
              </li>
              <li pn="section-8.5-2.1.2.4">
                <t indent="0" pn="section-8.5-2.1.2.4.1">The rules for the inclusion of the ID Context (Gid) in the 'kid context' parameter of a response, if the ID Context used for the response differs from the one used to verify the request (see <xref target="sec-group-key-management" format="default" sectionFormat="of" derivedContent="Section 12.2"/>), also for helping the client to synchronize.</t>
              </li>
              <li pn="section-8.5-2.1.2.5">
                <t indent="0" pn="section-8.5-2.1.2.5.1">The rules for the inclusion of the Sender ID in the 'kid' parameter of a response to a request that was protected in pairwise mode, if the server has obtained a new Sender ID from the Group Manager when individually rekeyed (see <xref target="new-sender-id" format="default" sectionFormat="of" derivedContent="Section 2.6.3.1"/>), thus helping the client to synchronize.</t>
              </li>
            </ul>
          </li>
        </ul>
      </section>
      <section anchor="sec-pairwise-verify-resp" numbered="true" removeInRFC="false" toc="include" pn="section-8.6">
        <name slugifiedName="name-verifying-the-response-2">Verifying the Response</name>
        <t indent="0" pn="section-8.6-1">Upon receiving a protected response with the Group Flag set to 0, following the procedure in <xref target="sec-message-reception" format="default" sectionFormat="of" derivedContent="Section 6"/>, a client <bcp14>SHALL</bcp14> proceed as described in <xref section="8.4" sectionFormat="of" target="RFC8613" format="default" derivedLink="https://rfc-editor.org/rfc/rfc8613#section-8.4" derivedContent="RFC8613"/> with the differences summarized in <xref target="sec-differences-oscore-pairwise" format="default" sectionFormat="of" derivedContent="Section 8.2"/> of this document. The following differences also apply:</t>
        <ul spacing="normal" bare="false" empty="false" indent="3" pn="section-8.6-2">
          <li pn="section-8.6-2.1">
            <t indent="0" pn="section-8.6-2.1.1">The client may receive a response protected with a Security Context different from the one used to protect the corresponding request. Also, upon the establishment of a new Security Context, the client re-initializes its Replay Windows in its Recipient Contexts (see Sections <xref target="ssec-sender-recipient-context" format="counter" sectionFormat="of" derivedContent="2.2"/> and <xref target="sec-group-re-join" format="counter" sectionFormat="of" derivedContent="2.6.3"/>).</t>
          </li>
          <li pn="section-8.6-2.2">
            <t indent="0" pn="section-8.6-2.2.1">The same as described in <xref target="ssec-verify-response" format="default" sectionFormat="of" derivedContent="Section 7.4"/> applies with respect to handling the 'kid' parameter of the response, when received as a reply to a request protected in pairwise mode. In this case too, the client can check whether the replying server is the expected one by relying on the server's public key. However, since the response is protected in pairwise mode, the public key is not used for verifying a countersignature as in <xref target="ssec-verify-response" format="default" sectionFormat="of" derivedContent="Section 7.4"/>. Instead, the expected server's authentication credential -- namely Recipient Auth Cred and including the server's public key -- was taken as input to derive the Pairwise Recipient Key used to decrypt and verify the response (see <xref target="key-derivation-pairwise" format="default" sectionFormat="of" derivedContent="Section 2.5.1"/>).</t>
          </li>
          <li pn="section-8.6-2.3">
            <t indent="0" pn="section-8.6-2.3.1">If a new Recipient Context is created for this Recipient ID, new Pairwise Sender/Recipient Keys are also derived (see <xref target="key-derivation-pairwise" format="default" sectionFormat="of" derivedContent="Section 2.5.1"/>). The new Pairwise Sender/Recipient Keys are deleted if the Recipient Context is deleted as a result of the message not being successfully verified.</t>
          </li>
          <li pn="section-8.6-2.4">
            <t indent="0" pn="section-8.6-2.4.1">What is specified in <xref target="ssec-verify-response" format="default" sectionFormat="of" derivedContent="Section 7.4"/> of this document applies with respect to the following points.  </t>
            <ul spacing="normal" bare="false" empty="false" indent="3" pn="section-8.6-2.4.2">
              <li pn="section-8.6-2.4.2.1">
                <t indent="0" pn="section-8.6-2.4.2.1.1">The possible, dynamic creation and configuration of a Recipient Context upon receiving the response.</t>
              </li>
              <li pn="section-8.6-2.4.2.2">
                <t indent="0" pn="section-8.6-2.4.2.2.1">The use of the stored value of the 'kid' and 'kid context' parameters when processing a response received within a long exchange.</t>
              </li>
              <li pn="section-8.6-2.4.2.3">
                <t indent="0" pn="section-8.6-2.4.2.3.1">The performing of ordering and replay protection for responses received within a long exchange.</t>
              </li>
              <li pn="section-8.6-2.4.2.4">
                <t indent="0" pn="section-8.6-2.4.2.4.1">The possible deletion of a Recipient Context created upon receiving the response in the case that the response is not verified successfully.</t>
              </li>
            </ul>
          </li>
        </ul>
      </section>
    </section>
    <section anchor="sec-synch-challenge-response" numbered="true" removeInRFC="false" toc="include" pn="section-9">
      <name slugifiedName="name-challenge-response-based-fr">Challenge-Response-Based Freshness and Replay Window Recovery</name>
      <t indent="0" pn="section-9-1">This section describes how a server endpoint can verify freshness of a request by means of a challenge-response exchange with a client using the Echo Option for CoAP specified in <xref section="2" sectionFormat="of" target="RFC9175" format="default" derivedLink="https://rfc-editor.org/rfc/rfc9175#section-2" derivedContent="RFC9175"/>. The same mechanism, with small alterations, is also used by the server when first processing a request using a Recipient Context whose Replay Window was initialized as invalid.</t>
      <t indent="0" pn="section-9-2">If the application requires freshness, e.g., according to time- or event-based policies (see <xref section="2.5.1" sectionFormat="of" target="RFC9175" format="default" derivedLink="https://rfc-editor.org/rfc/rfc9175#section-2.5.1" derivedContent="RFC9175"/>), a server proceeds as described below upon receiving a request from a particular client for the first time.</t>
      <t indent="0" pn="section-9-3">The server processes the message as described in this document but does not deliver it to the application, even if the message is valid. Instead, the server replies to the client with a Group OSCORE-protected 4.01 (Unauthorized) response message, including only the Echo Option and no diagnostic payload. The server <bcp14>MUST</bcp14> use its Partial IV when generating the nonce for protecting the response conveying the Echo Option and <bcp14>MUST</bcp14> include the Partial IV in the response.</t>
      <t indent="0" pn="section-9-4">The Echo Option value <bcp14>SHOULD NOT</bcp14> be reused; if it is reused, it <bcp14>MUST</bcp14> be highly unlikely to have been recently used with this client. Since this response is protected with the Security Context used in the group, the client will consider the response valid upon successfully decrypting and verifying it.</t>
      <t indent="0" pn="section-9-5">The server stores the Echo Option value included in the response together with the pair (gid,kid), where 'gid' is the Group Identifier of the OSCORE group and 'kid' is the Sender ID of the client in the group. These are specified in the 'kid context' and 'kid' fields of the OSCORE Option of the request, respectively. After a group rekeying has been completed and a new Security Context has been established in the group, which also results in a new Group Identifier (see <xref target="sec-group-key-management" format="default" sectionFormat="of" derivedContent="Section 12.2"/>), the server <bcp14>MUST</bcp14> delete all the stored Echo values associated with members of the group.</t>
      <t indent="0" pn="section-9-6">After receiving a 4.01 (Unauthorized) response that includes an Echo Option and originates from a verified group member, a subsequent client request sent to that server and echoing the Echo Option value <bcp14>MUST</bcp14> be a message sent unicast to that server.</t>
      <t indent="0" pn="section-9-7">In the group, if the AEAD Algorithm and Pairwise Key Agreement Algorithm are set in the Security Context, the client <bcp14>MUST</bcp14> use the pairwise mode to protect the request as per <xref target="sec-pairwise-protection-req" format="default" sectionFormat="of" derivedContent="Section 8.3"/>. Note that, as defined in <xref target="sec-pairwise-protection" format="default" sectionFormat="of" derivedContent="Section 8"/>, endpoints that are members of such a group and that use the Echo Option support the pairwise mode. In a group where the AEAD Algorithm and Pairwise Key Agreement Algorithm are not set, only the group mode can be used. Hence, requests including the Echo Option can be protected only with the group mode, with the caveat due to the risk for those requests to be redirected to a different server than the intended one as discussed in <xref target="ssec-unicast-requests" format="default" sectionFormat="of" derivedContent="Section 13.9"/>.</t>
      <t indent="0" pn="section-9-8">The client does not necessarily resend the same request, but can instead send a more recent one if the application permits it. This allows the client to not retain previously sent requests for full retransmission unless the application explicitly requires otherwise. In either case, the client uses a fresh Sender Sequence Number value from its own Sender Context. If the client stores requests for possible retransmission with the Echo Option, it should not store a given request for longer than a preconfigured time interval. Note that the unicast request echoing the Echo Option is correctly treated and processed since the 'kid context' field including the Group Identifier of the OSCORE group is still present in the OSCORE Option as part of the COSE object (see <xref target="sec-cose-object" format="default" sectionFormat="of" derivedContent="Section 3"/>).</t>
      <t indent="0" pn="section-9-9">Upon receiving the unicast request including the Echo Option, the server performs the following verifications:</t>
      <ul spacing="normal" bare="false" empty="false" indent="3" pn="section-9-10">
        <li pn="section-9-10.1">
          <t indent="0" pn="section-9-10.1.1">If the server does not store an Echo Option value for the pair (gid,kid), it considers i) the time t1 when it has established the Security Context used to protect the received request, and ii) the time t2 when the request has been received. Since a valid request cannot be older than the Security Context used to protect it, the server verifies that (t2 - t1) is less than the largest amount of time acceptable to consider the request fresh.</t>
        </li>
        <li pn="section-9-10.2">
          <t indent="0" pn="section-9-10.2.1">If the server stores an Echo Option value for the pair (gid,kid) associated with that same client in the same group, the server verifies that the option value equals that same stored value previously sent to that client.</t>
        </li>
      </ul>
      <t indent="0" pn="section-9-11">If the verifications above fail, the server <bcp14>MUST NOT</bcp14> process the request further and <bcp14>MAY</bcp14> send a 4.01 (Unauthorized) response including an Echo Option, hence performing a new challenge-response exchange.</t>
      <t indent="0" pn="section-9-12">If the verifications above are successful, the server considers the Recipient Context associated with the sender client and proceeds as follows:</t>
      <ul spacing="normal" bare="false" empty="false" indent="3" pn="section-9-13">
        <li pn="section-9-13.1">
          <t indent="0" pn="section-9-13.1.1">If the Replay Window is invalid, the steps below occur:  </t>
          <ol spacing="normal" type="1" indent="adaptive" start="1" pn="section-9-13.1.2"><li pn="section-9-13.1.2.1" derivedCounter="1.">
              <t indent="0" pn="section-9-13.1.2.1.1">The server updates the Replay Window by marking as received the Sender Sequence Number from the latest received request. This becomes the lower limit of the Replay Window while all the greater Sender Sequence Number values within the Replay Window are marked as not received.</t>
            </li>
            <li pn="section-9-13.1.2.2" derivedCounter="2.">
              <t indent="0" pn="section-9-13.1.2.2.1">The server makes the Replay Window valid and accepts the request as fresh.</t>
            </li>
          </ol>
        </li>
        <li pn="section-9-13.2">
          <t indent="0" pn="section-9-13.2.1">If the Replay Window is already valid, the server discards the verification result and accepts the request as fresh or treats it as a replay according to the existing Replay Window.</t>
        </li>
      </ul>
      <t indent="0" pn="section-9-14">A server should not deliver requests from a given client to the application until one valid request from that same client has been verified as fresh via an echoed Echo Option included therein. A server may perform the challenge-response described above at any time, e.g., after a device reboot occurred in an unprepared way. A client has to be ready to perform the challenge-response based on the Echo Option if a server starts it.</t>
      <t indent="0" pn="section-9-15">Message freshness is further discussed in <xref target="ssec-seccons-freshness" format="default" sectionFormat="of" derivedContent="Section 13.14"/>.</t>
    </section>
    <section anchor="implementation-compliance" numbered="true" removeInRFC="false" toc="include" pn="section-10">
      <name slugifiedName="name-implementation-compliance">Implementation Compliance</name>
      <t indent="0" pn="section-10-1">Like in <xref target="RFC8613" format="default" sectionFormat="of" derivedContent="RFC8613"/>, HKDF SHA-256 is the mandatory-to-implement HKDF.</t>
      <t indent="0" pn="section-10-2">An endpoint may support only the group mode, or only the pairwise mode, or both.</t>
      <t indent="0" pn="section-10-3">For endpoints that support the group mode, the following applies:</t>
      <ul spacing="normal" bare="false" empty="false" indent="3" pn="section-10-4">
        <li pn="section-10-4.1">
          <t indent="0" pn="section-10-4.1.1">For endpoints that use authenticated encryption, the AEAD algorithm AES-CCM-16-64-128 defined in <xref section="4.2" sectionFormat="of" target="RFC9053" format="default" derivedLink="https://rfc-editor.org/rfc/rfc9053#section-4.2" derivedContent="RFC9053"/> is mandatory to implement as Group Encryption Algorithm (see <xref target="ssec-common-context-cs-enc-alg" format="default" sectionFormat="of" derivedContent="Section 2.1.7"/>).</t>
        </li>
        <li pn="section-10-4.2">
          <t indent="0" pn="section-10-4.2.1">For endpoints that use non-authenticated encryption, the algorithm A128CTR defined in <xref section="4" sectionFormat="of" target="RFC9459" format="default" derivedLink="https://rfc-editor.org/rfc/rfc9459#section-4" derivedContent="RFC9459"/> is mandatory to implement as Group Encryption Algorithm (see <xref target="ssec-common-context-cs-enc-alg" format="default" sectionFormat="of" derivedContent="Section 2.1.7"/>).</t>
        </li>
        <li pn="section-10-4.3">
          <t indent="0" pn="section-10-4.3.1"><xref section="6" sectionFormat="of" target="RFC9459" format="default" derivedLink="https://rfc-editor.org/rfc/rfc9459#section-6" derivedContent="RFC9459"/> mandates that COSE libraries supporting the AES-CTR algorithm and accepting AAD as input must return an error if AAD is provided when such a non-AEAD content encryption algorithm is selected.  </t>
          <t indent="0" pn="section-10-4.3.2">
If the used Group Encryption Algorithm (see <xref target="ssec-common-context-cs-enc-alg" format="default" sectionFormat="of" derivedContent="Section 2.1.7"/>) does not provide integrity protection, the following applies:  </t>
          <t indent="0" pn="section-10-4.3.3">
When invoking the execution of the Group Encryption Algorithm, the Group OSCORE implementation <bcp14>MUST NOT</bcp14> provide any AAD to the COSE library, unless AAD is always expected as input. In the latter case, the AAD will not be protected by the Group Encryption Algorithm, which is unable to do so.  </t>
          <t indent="0" pn="section-10-4.3.4">
If the used COSE library adheres to the mandate in <xref section="6" sectionFormat="of" target="RFC9459" format="default" derivedLink="https://rfc-editor.org/rfc/rfc9459#section-6" derivedContent="RFC9459"/>, then a Group OSCORE implementation requires that the COSE library supports using the Group Encryption Algorithm without taking AAD as input.</t>
        </li>
        <li pn="section-10-4.4">
          <t indent="0" pn="section-10-4.4.1">For many constrained Internet of Things (IoT) devices, it is problematic to support more than one signature algorithm. The following applies with respect to the Signature Algorithm (see <xref target="ssec-common-context-cs-alg" format="default" sectionFormat="of" derivedContent="Section 2.1.8"/>).  </t>
          <t indent="0" pn="section-10-4.4.2">
Less constrained endpoints <bcp14>MUST</bcp14> implement at least one of the following and <bcp14>SHOULD</bcp14> implement both: the EdDSA signature algorithm together with the elliptic curve Ed25519 <xref target="RFC8032" format="default" sectionFormat="of" derivedContent="RFC8032"/> and/or the ECDSA signature algorithm together with the elliptic curve P-256.  </t>
          <t indent="0" pn="section-10-4.4.3">
Constrained endpoints <bcp14>MUST</bcp14> implement at least one of the following and, if affordable, <bcp14>SHOULD</bcp14> implement both: the EdDSA signature algorithm together with the elliptic curve Ed25519 <xref target="RFC8032" format="default" sectionFormat="of" derivedContent="RFC8032"/> and/or the ECDSA signature algorithm together with the elliptic curve P-256.</t>
        </li>
        <li pn="section-10-4.5">
          <t indent="0" pn="section-10-4.5.1">Endpoints that implement the ECDSA signature algorithm <bcp14>MAY</bcp14> use "deterministic ECDSA" as specified in <xref target="RFC6979" format="default" sectionFormat="of" derivedContent="RFC6979"/>. Pure deterministic elliptic-curve signature algorithms such as deterministic ECDSA and EdDSA have the advantage of not requiring access to a source of high-quality randomness. However, these signature algorithms have been shown vulnerable to some side-channel and fault injection attacks due to their determinism, which can result in extracting a device's private key. As suggested in <xref section="2.1.1" sectionFormat="of" target="RFC9053" format="default" derivedLink="https://rfc-editor.org/rfc/rfc9053#section-2.1.1" derivedContent="RFC9053"/>, this can be addressed by combining both randomness and determinism <xref target="I-D.irtf-cfrg-det-sigs-with-noise" format="default" sectionFormat="of" derivedContent="SIGS-WITH-NOISE"/>.</t>
        </li>
      </ul>
      <t indent="0" pn="section-10-5">For endpoints that support the pairwise mode, the following applies:</t>
      <ul spacing="normal" bare="false" empty="false" indent="3" pn="section-10-6">
        <li pn="section-10-6.1">
          <t indent="0" pn="section-10-6.1.1">The AEAD algorithm AES-CCM-16-64-128 defined in <xref section="4.2" sectionFormat="of" target="RFC9053" format="default" derivedLink="https://rfc-editor.org/rfc/rfc9053#section-4.2" derivedContent="RFC9053"/> is mandatory to implement as AEAD Algorithm (see <xref target="ssec-common-context-aead-alg" format="default" sectionFormat="of" derivedContent="Section 2.1.1"/>).</t>
        </li>
        <li pn="section-10-6.2">
          <t indent="0" pn="section-10-6.2.1">The ECDH-SS + HKDF-256 algorithm specified in <xref section="6.3.1" sectionFormat="of" target="RFC9053" format="default" derivedLink="https://rfc-editor.org/rfc/rfc9053#section-6.3.1" derivedContent="RFC9053"/> is mandatory to implement as Pairwise Key Agreement Algorithm (see <xref target="ssec-common-context-dh-alg" format="default" sectionFormat="of" derivedContent="Section 2.1.10"/>).</t>
        </li>
        <li pn="section-10-6.3">
          <t indent="0" pn="section-10-6.3.1">The following applies with respect to ECDH curves.  </t>
          <t indent="0" pn="section-10-6.3.2">
Less constrained endpoints <bcp14>MUST</bcp14> implement at least one of the following ECDH curves and <bcp14>SHOULD</bcp14> implement both: the X25519 curve <xref target="RFC7748" format="default" sectionFormat="of" derivedContent="RFC7748"/> and/or the P-256 curve.  </t>
          <t indent="0" pn="section-10-6.3.3">
Constrained endpoints <bcp14>MUST</bcp14> implement at least one of the following ECDH curves and, if affordable, <bcp14>SHOULD</bcp14> implement both: the X25519 curve <xref target="RFC7748" format="default" sectionFormat="of" derivedContent="RFC7748"/> and/or the P-256 curve.</t>
        </li>
      </ul>
      <t indent="0" pn="section-10-7">Constrained IoT devices may alternatively represent Montgomery curves and (twisted) Edwards curves <xref target="RFC7748" format="default" sectionFormat="of" derivedContent="RFC7748"/> in the short-Weierstrass form Wei25519, with which the algorithms ECDSA25519 and ECDH25519 can be used for signature operations and Diffie-Hellman secret calculation, respectively <xref target="I-D.ietf-lwig-curve-representations" format="default" sectionFormat="of" derivedContent="CURVE-REPR"/>.</t>
    </section>
    <section anchor="web-linking" numbered="true" removeInRFC="false" toc="include" pn="section-11">
      <name slugifiedName="name-web-linking">Web Linking</name>
      <t indent="0" pn="section-11-1">The use of Group OSCORE or OSCORE <xref target="RFC8613" format="default" sectionFormat="of" derivedContent="RFC8613"/> <bcp14>MAY</bcp14> be indicated by a target "gosc" attribute in a web link <xref target="RFC8288" format="default" sectionFormat="of" derivedContent="RFC8288"/> to a resource, e.g., using a CoRE link-format document <xref target="RFC6690" format="default" sectionFormat="of" derivedContent="RFC6690"/> if the resource is accessible over CoAP.</t>
      <t indent="0" pn="section-11-2">The "gosc" attribute is a hint indicating that the destination of that link is only accessible using Group OSCORE or OSCORE, and unprotected access to it is not supported. Note that this is simply a hint; it does not include any security context material or any other information required to run Group OSCORE or OSCORE.</t>
      <t indent="0" pn="section-11-3">A value <bcp14>MUST NOT</bcp14> be given for the "gosc" attribute; any present value <bcp14>MUST</bcp14> be ignored by parsers. The "gosc" attribute <bcp14>MUST NOT</bcp14> appear more than once in a given link-value; occurrences after the first <bcp14>MUST</bcp14> be ignored by parsers.</t>
      <t indent="0" pn="section-11-4">When a link-value includes the "gosc" attribute, the link-value <bcp14>MUST</bcp14> also include the "osc" attribute defined in <xref section="9" sectionFormat="of" target="RFC8613" format="default" derivedLink="https://rfc-editor.org/rfc/rfc8613#section-9" derivedContent="RFC8613"/>. If the endpoint parsing the link-value supports Group OSCORE and understands the "gosc" attribute, then the parser <bcp14>MUST</bcp14> ignore the "osc" attribute, which is overshadowed by the "gosc" attribute.</t>
      <t indent="0" pn="section-11-5">The example in <xref target="fig-web-link-example" format="default" sectionFormat="of" derivedContent="Figure 3"/> shows a use of the "gosc" attribute: the client does resource discovery on a server and gets back a list of resources, one of which includes the "gosc" attribute indicating that the resource is protected with Group OSCORE or OSCORE. The link-format notation (see <xref section="5" sectionFormat="of" target="RFC6690" format="default" derivedLink="https://rfc-editor.org/rfc/rfc6690#section-5" derivedContent="RFC6690"/>) is used.</t>
      <figure anchor="fig-web-link-example" align="left" suppress-title="false" pn="figure-3">
        <name slugifiedName="name-example-of-using-the-gosc-a">Example of Using the "gosc" Attribute in a Web Link</name>
        <artwork align="left" pn="section-11-6.1">
REQ: GET /.well-known/core

RES: 2.05 Content
    &lt;/sensors/temp&gt;;gosc;osc,
    &lt;/sensors/light&gt;;if="sensor"
</artwork>
      </figure>
    </section>
    <section anchor="group-manager" numbered="true" removeInRFC="false" toc="include" pn="section-12">
      <name slugifiedName="name-the-group-manager">The Group Manager</name>
      <t indent="0" pn="section-12-1">As with OSCORE, endpoints communicating with Group OSCORE need to establish the relevant Security Context. Group OSCORE endpoints need to acquire OSCORE input parameters, information about the group(s), and information about other endpoints in the group(s).</t>
      <t indent="0" pn="section-12-2">Every group is associated with a Group Manager that is responsible for distributing security parameters and keying material within the group, among other tasks. The details of how the Group Manager interacts with (candidate) group members or with external entities like signature checkers, as well as the protocols used for those interactions, are out of scope.</t>
      <t indent="0" pn="section-12-3">The Group Manager assigns unique Group Identifiers (Gids) to the groups under its control. Within each of such groups, the Group Manager assigns unique Sender IDs (and thus Recipient IDs) to the respective group members. The maximum length of Sender IDs depends on the length of the nonce for the algorithms used in the group (see <xref target="ssec-sender-recipient-context" format="default" sectionFormat="of" derivedContent="Section 2.2"/>).</t>
      <t indent="0" pn="section-12-4">The Gid value assigned to a group is associated with a dedicated space for the values of Sender ID and Recipient ID of the members of that group. When an endpoint (re-)joins a group, it is provided with the current Gid to use in the group. The Group Manager also assigns an integer Key Generation Number counter to each of its groups, identifying the current version of the keying material used in that group. Further details about identifiers and keys are provided in <xref target="sec-group-key-management" format="default" sectionFormat="of" derivedContent="Section 12.2"/>.</t>
      <t indent="0" pn="section-12-5">The Group Manager maintains records of the authentication credentials of endpoints in a group, and provides members of the group with information about the group and other group members (see <xref target="setup" format="default" sectionFormat="of" derivedContent="Section 12.1"/>). Optionally, the Group Manager provides information about the group and its members to external entities with a specific role, such as signature checkers (see <xref target="sec-additional-entities" format="default" sectionFormat="of" derivedContent="Section 12.3"/>).</t>
      <t indent="0" pn="section-12-6">The list of responsibilities of the Group Manager is compiled in <xref target="sec-group-manager" format="default" sectionFormat="of" derivedContent="Appendix D"/>.</t>
      <t indent="0" pn="section-12-7">One realization of Group Manager is specified in <xref target="I-D.ietf-ace-key-groupcomm-oscore" format="default" sectionFormat="of" derivedContent="ACE-KEY-GROUP-OSCORE"/>, where the process by which an endpoint (re-)joins a group is based on the Authentication and Authorization for Constrained Environments (ACE) framework <xref target="RFC9200" format="default" sectionFormat="of" derivedContent="RFC9200"/>.</t>
      <section anchor="setup" numbered="true" removeInRFC="false" toc="include" pn="section-12.1">
        <name slugifiedName="name-setup-of-new-endpoints">Setup of New Endpoints</name>
        <t indent="0" pn="section-12.1-1">From the Group Manager, an endpoint acquires group data such as the Gid and OSCORE input parameters including its own Sender ID, with which it can derive the Sender Context.</t>
        <t indent="0" pn="section-12.1-2">When joining the group or later on as a group member, an endpoint can also retrieve from the Group Manager the authentication credential of the Group Manager as well as the authentication credentials and other information (e.g., the Sender IDs) associated with other members of the group, with which it can derive the corresponding Recipient Context. An application can configure a group member to asynchronously retrieve information about Recipient Contexts, e.g., by observing <xref target="RFC7641" format="default" sectionFormat="of" derivedContent="RFC7641"/> a resource at the Group Manager to get updates on the group membership.</t>
        <t indent="0" pn="section-12.1-3">When endpoints join the group, the Group Manager collects the endpoints' authentication credentials and <bcp14>MUST</bcp14> verify proof of possession of the respective private key. As an example, such proof of possession is possible to achieve during the join process provided by the realization of Group Manager specified in <xref target="I-D.ietf-ace-key-groupcomm-oscore" format="default" sectionFormat="of" derivedContent="ACE-KEY-GROUP-OSCORE"/>. Together with the requested authentication credentials of other group members, the Group Manager <bcp14>MUST</bcp14> provide the joining endpoints with the Sender ID of the associated group members and the current Key Generation Number in the group (see <xref target="sec-group-key-management" format="default" sectionFormat="of" derivedContent="Section 12.2"/>).</t>
        <t indent="0" pn="section-12.1-4">An endpoint may join a group, for example, by explicitly interacting with the responsible Group Manager or by being configured with some tool performing the tasks of the Group Manager. When becoming members of a group, endpoints are not required to know how many and what endpoints are in the same group.</t>
        <t indent="0" pn="section-12.1-5">Communications that the Group Manager has with joining endpoints and group members <bcp14>MUST</bcp14> be secured. Specific details on how to secure such communications are out of the scope of this document.</t>
        <t indent="0" pn="section-12.1-6">The Group Manager <bcp14>MUST</bcp14> verify that the joining endpoint is authorized to join the group. To this end, the Group Manager can directly authorize the joining endpoint or expect it to provide authorization evidence previously obtained from a trusted entity. Further details about the authorization of joining endpoints are out of the scope of this document.</t>
        <t indent="0" pn="section-12.1-7">In the case of successful authorization check, the Group Manager provides the joining endpoint with the keying material to initialize the Security Context. The actual provisioning of keying material and parameters to the joining endpoint is out of the scope of this document.</t>
      </section>
      <section anchor="sec-group-key-management" numbered="true" removeInRFC="false" toc="include" pn="section-12.2">
        <name slugifiedName="name-management-of-group-keying-">Management of Group Keying Material</name>
        <t indent="0" pn="section-12.2-1">In order to establish a new Security Context for a group, the Group Manager <bcp14>MUST</bcp14> generate and assign to the group a new Group Identifier (Gid) and a new value for the Master Secret parameter. When doing so, a new value for the Master Salt parameter <bcp14>MAY</bcp14> also be generated and assigned to the group. When establishing the new Security Context, the Group Manager <bcp14>SHOULD</bcp14> preserve the current value of the Sender ID of each group member in order to ensure an efficient key rollover. Exceptions can apply if there are compelling reasons for making available again some of the Sender ID values currently used.</t>
        <t indent="0" pn="section-12.2-2">The specific group key management scheme used to distribute new keying material is out of the scope of this document. A simple group key management scheme is defined in <xref target="I-D.ietf-ace-key-groupcomm-oscore" format="default" sectionFormat="of" derivedContent="ACE-KEY-GROUP-OSCORE"/>. Different group key management schemes rely on different approaches to compose and deliver rekeying messages, i.e., individually targeting single recipients, or targeting multiple recipients at once (e.g., over UDP/IP multicast), or a combination of the two approaches. As long as it is viable for the specific rekeying message to be delivered and it is supported by the intended message recipient(s), using a reliable transport to deliver a rekeying message should be preferred, as it reduces chances of group members missing a rekeying instance.</t>
        <t indent="0" pn="section-12.2-3">Irrespective of the transport used being reliable or unreliable, appropriate congestion control <bcp14>MUST</bcp14> be enforced. If the key distribution traffic uses CoAP over UDP or over other unreliable transports, mechanisms for enforcing congestion control are specified in <xref section="4.7" sectionFormat="of" target="RFC7252" format="default" derivedLink="https://rfc-editor.org/rfc/rfc7252#section-4.7" derivedContent="RFC7252"/> and in <xref section="3.6" sectionFormat="of" target="RFC10020" format="default" derivedLink="https://rfc-editor.org/rfc/rfc10020#section-3.6" derivedContent="RFC10020"/> for the case of group communication (e.g., over UDP/IP multicast). If, irrespective of using CoAP, the key distribution traffic relies on alternative setups with unreliable transports, one can rely on general congestion-control mechanisms such as the Datagram Congestion Control Protocol (DCCP) <xref target="RFC4340" format="default" sectionFormat="of" derivedContent="RFC4340"/> or on dedicated congestion-control mechanisms for the transport specifically used (e.g., those defined in <xref target="RFC9002" format="default" sectionFormat="of" derivedContent="RFC9002"/> for QUIC <xref target="RFC9000" format="default" sectionFormat="of" derivedContent="RFC9000"/>).</t>
        <t indent="0" pn="section-12.2-4">The set of group members should not be assumed as fixed, i.e., the group membership is subject to changes, possibly on a frequent basis.</t>
        <t indent="0" pn="section-12.2-5">The Group Manager <bcp14>MUST</bcp14> rekey the group without undue delay when one or more endpoints leave the group. An endpoint may leave the group on its own initiative or may be evicted from the group by the Group Manager, e.g., when the endpoint is compromised or is suspected to be compromised (as determined by the Group Manager through its own means or based on information that it obtains from a trusted source, such as an Intrusion Detection System or an issuer of authentication credentials). In either case, rekeying the group excludes such endpoints from future communications in the group, and thus preserves forward security. If a network node is compromised or suspected to be compromised, the Group Manager <bcp14>MUST</bcp14> evict from the group all the endpoints hosted by that node that are members of the group and rekey the group accordingly.</t>
        <t indent="0" pn="section-12.2-6">If required by the application, the Group Manager <bcp14>MUST</bcp14> also rekey the group when one or more new joining endpoints are added to the group, thus preserving backward security.</t>
        <t indent="0" pn="section-12.2-7">The Group Manager <bcp14>MAY</bcp14> also rekey the group for other reasons, e.g., according to an application-specific rekeying period or scheduling.</t>
        <t indent="0" pn="section-12.2-8">Separately for each group, the value of the Key Generation Number increases by one each time the Group Manager distributes new keying material to that group (see below).</t>
        <t indent="0" pn="section-12.2-9">The establishment of the new Security Context for the group takes the following steps.</t>
        <ol spacing="normal" type="1" indent="adaptive" start="1" pn="section-12.2-10"><li pn="section-12.2-10.1" derivedCounter="1.">
            <t indent="0" pn="section-12.2-10.1.1">The Group Manager <bcp14>MUST</bcp14> increment the Key Generation Number for the group by 1. It is up to the Group Manager what actions to take when a wrap-around of the Key Generation Number is detected.</t>
          </li>
          <li pn="section-12.2-10.2" derivedCounter="2.">
            <t indent="0" pn="section-12.2-10.2.1">The Group Manager <bcp14>MUST</bcp14> build a set of stale Sender IDs, including:  </t>
            <ul spacing="normal" bare="false" empty="false" indent="3" pn="section-12.2-10.2.2">
              <li pn="section-12.2-10.2.2.1">
                <t indent="0" pn="section-12.2-10.2.2.1.1">The Sender IDs that have been relinquished since the latest assignment of the current Gid to the group (see <xref target="new-sender-id" format="default" sectionFormat="of" derivedContent="Section 2.6.3.1"/>).</t>
              </li>
              <li pn="section-12.2-10.2.2.2">
                <t indent="0" pn="section-12.2-10.2.2.2.1">The current Sender IDs of the group members that the upcoming group rekeying aims to exclude from future group communications, if any.</t>
              </li>
            </ul>
          </li>
          <li pn="section-12.2-10.3" derivedCounter="3.">
            <t indent="0" pn="section-12.2-10.3.1">The Group Manager rekeys the group by distributing:  </t>
            <ul spacing="normal" bare="false" empty="false" indent="3" pn="section-12.2-10.3.2">
              <li pn="section-12.2-10.3.2.1">
                <t indent="0" pn="section-12.2-10.3.2.1.1">The new keying material, i.e., the new Master Secret, the new Gid, and (optionally) the new Master Salt.</t>
              </li>
              <li pn="section-12.2-10.3.2.2">
                <t indent="0" pn="section-12.2-10.3.2.2.1">The new Key Generation Number from Step 1.</t>
              </li>
              <li pn="section-12.2-10.3.2.3">
                <t indent="0" pn="section-12.2-10.3.2.3.1">The set of stale Sender IDs from Step 2.</t>
              </li>
            </ul>
            <t indent="0" pn="section-12.2-10.3.3">
Further information may be distributed depending on the specific group key management scheme used in the group.</t>
          </li>
        </ol>
        <t indent="0" pn="section-12.2-11">When receiving the new group keying material, a group member considers the received stale Sender IDs and performs the following actions:</t>
        <ul spacing="normal" bare="false" empty="false" indent="3" pn="section-12.2-12">
          <li pn="section-12.2-12.1">
            <t indent="0" pn="section-12.2-12.1.1">The group member <bcp14>MUST</bcp14> remove every authentication credential associated with a stale Sender ID from its list of group members' authentication credentials used in the group.</t>
          </li>
          <li pn="section-12.2-12.2">
            <t indent="0" pn="section-12.2-12.2.1">The group member <bcp14>MUST</bcp14> delete each of its Recipient Contexts used in the group whose corresponding Recipient ID is a stale Sender ID.</t>
          </li>
        </ul>
        <t indent="0" pn="section-12.2-13">After that, the group member installs the new keying material and derives the corresponding new Security Context.</t>
        <t indent="0" pn="section-12.2-14">A group member might miss one or more consecutive instances of group rekeying. As a result, the group member will retain old group keying material with Key Generation Number GEN_OLD. Eventually, the group member can notice the discrepancy, e.g., by repeatedly failing to verify incoming messages or by explicitly querying the Group Manager for the current Key Generation Number. Once the group member gains knowledge of having missed a group rekeying, it <bcp14>MUST</bcp14> delete the old keying material it stores.</t>
        <t indent="0" pn="section-12.2-15">Then, the group member proceeds according to the following steps.</t>
        <ol spacing="normal" type="1" indent="adaptive" start="1" pn="section-12.2-16"><li pn="section-12.2-16.1" derivedCounter="1.">
            <t indent="0" pn="section-12.2-16.1.1">The group member retrieves from the Group Manager the current group keying material together with the current Key Generation Number GEN_NEW. The group member <bcp14>MUST NOT</bcp14> install the obtained group keying material yet.</t>
          </li>
          <li pn="section-12.2-16.2" derivedCounter="2.">
            <t indent="0" pn="section-12.2-16.2.1">The group member asks the Group Manager for the set of stale Sender IDs between GEN_OLD and GEN_NEW.</t>
          </li>
          <li pn="section-12.2-16.3" derivedCounter="3.">
            <t indent="0" pn="section-12.2-16.3.1">If no exact and complete indication can be obtained from the Group Manager, the group member <bcp14>MUST</bcp14> remove all the authentication credentials from its list of group members' authentication credentials used in the group and <bcp14>MUST</bcp14> delete all its Recipient Contexts used in the group.  </t>
            <t indent="0" pn="section-12.2-16.3.2">
Otherwise, the group member <bcp14>MUST</bcp14> remove every authentication credential associated with a stale Sender ID from its list of group members' authentication credentials used in the group and <bcp14>MUST</bcp14> delete each of its Recipient Contexts used in the group whose corresponding Recipient ID is a stale Sender ID.</t>
          </li>
          <li pn="section-12.2-16.4" derivedCounter="4.">
            <t indent="0" pn="section-12.2-16.4.1">The group member installs the current group keying material and derives the corresponding new Security Context.</t>
          </li>
        </ol>
        <t indent="0" pn="section-12.2-17">Alternatively, the group member can re-join the group. In such a case, the group member <bcp14>MUST</bcp14> take one of the following two actions:</t>
        <ul spacing="normal" bare="false" empty="false" indent="3" pn="section-12.2-18">
          <li pn="section-12.2-18.1">
            <t indent="0" pn="section-12.2-18.1.1">First, the group member performs Steps 2 and 3 above. Then, the group member re-joins the group.</t>
          </li>
          <li pn="section-12.2-18.2">
            <t indent="0" pn="section-12.2-18.2.1">The group member re-joins the group with the same roles it currently has in the group and, during the re-join process, asks the Group Manager for the authentication credentials of all the current group members.  </t>
            <t indent="0" pn="section-12.2-18.2.2">
Then, given Z (the set of authentication credentials received from the Group Manager), the group member removes every authentication credential that is not present in Z from its list of group members' authentication credentials used in the group. Furthermore, it deletes each of its Recipient Contexts used in the group that does not include any of the authentication credentials found in Z.</t>
          </li>
        </ul>
        <t indent="0" pn="section-12.2-19">By removing authentication credentials and deleting Recipient Contexts associated with stale Sender IDs, it is ensured that a recipient endpoint storing the latest group keying material does not store the authentication credentials of sender endpoints that are not current group members. This, in turn, allows group members to rely on stored authentication credentials to confidently verify the group membership of sender endpoints when receiving incoming messages protected in group mode (see <xref target="mess-processing" format="default" sectionFormat="of" derivedContent="Section 7"/>).</t>
        <t indent="0" pn="section-12.2-20">Strictness in managing the authentication credentials and Recipient Contexts associated with other group members is required for two reasons. First, as further discussed in <xref target="ssec-group-mode-security" format="default" sectionFormat="of" derivedContent="Section 13.1"/>, it ensures that the group mode can be used securely, even in a group where the Group Encryption Algorithm does not provide integrity protection (see <xref target="ssec-common-context-cs-enc-alg" format="default" sectionFormat="of" derivedContent="Section 2.1.7"/>) and external signature checkers are used (see <xref target="sec-processing-signature-checker" format="default" sectionFormat="of" derivedContent="Section 7.5"/>). Second, it ensures that the wrong (old) authentication credential associated with a group member A is never used with a Sender ID that used to be associated with A and has been later issued to a different group member B (see <xref target="sec-sid-recycling" format="default" sectionFormat="of" derivedContent="Section 12.2.1.2"/>), thus preventing the need to recover from an identity mix-up.</t>
        <section anchor="recycling-of-identifiers" numbered="true" removeInRFC="false" toc="include" pn="section-12.2.1">
          <name slugifiedName="name-recycling-of-identifiers">Recycling of Identifiers</name>
          <t indent="0" pn="section-12.2.1-1">This section specifies how the Group Manager handles and possibly reassigns Gid values and Sender ID values in a group.</t>
          <section anchor="sec-gid-recycling" numbered="true" removeInRFC="false" toc="exclude" pn="section-12.2.1.1">
            <name slugifiedName="name-recycling-of-group-identifi">Recycling of Group Identifiers</name>
            <t indent="0" pn="section-12.2.1.1-1">Since the Gid value changes every time a group is rekeyed, it can happen that, after several rekeying instances, the whole space of Gid values has been used for the group in question. When this happens, the Group Manager has no available Gid values to use that have never been assigned to the group during the group's lifetime.</t>
            <t indent="0" pn="section-12.2.1.1-2">The occurrence of such an event and how long it would take to occur depend on the format and encoding of Gid values used in the group (see, e.g., <xref target="gid-ex" format="default" sectionFormat="of" derivedContent="Appendix C"/>), as well as on the frequency of rekeying instances yielding a change of Gid value. Independently for each group under its control, the Group Manager can take one of the two following approaches:</t>
            <ul spacing="normal" bare="false" empty="false" indent="3" pn="section-12.2.1.1-3">
              <li pn="section-12.2.1.1-3.1">
                <t indent="0" pn="section-12.2.1.1-3.1.1">The Group Manager does not reassign Gid values. That is, once the whole space of Gid values has been used for a group, the Group Manager terminates the group and may re-establish a new group.</t>
              </li>
              <li pn="section-12.2.1.1-3.2">
                <t indent="0" pn="section-12.2.1.1-3.2.1">While the Gid value changes every time a group is rekeyed, the Group Manager can reassign Gid values previously used during a group's lifetime. By doing so, the group can continue to exist even once the whole space of Gid values has been used.  </t>
                <t indent="0" pn="section-12.2.1.1-3.2.2">
The Group Manager <bcp14>MAY</bcp14> support and use this approach, according to what is specified in <xref target="gid-reassignment" format="default" sectionFormat="of" derivedContent="Section 12.2.1.1.1"/>.</t>
              </li>
            </ul>
            <section anchor="gid-reassignment" numbered="true" removeInRFC="false" toc="exclude" pn="section-12.2.1.1.1">
              <name slugifiedName="name-reassignment-of-group-ident">Reassignment of Group Identifiers</name>
              <t indent="0" pn="section-12.2.1.1.1-1">If the Group Manager performs the reassignment of Gid values previously used during a group's lifetime, the Group Manager <bcp14>MUST</bcp14> take additional actions when handling Gid values and rekeying the group, as specified below.</t>
              <t indent="0" pn="section-12.2.1.1.1-2">When a node (re-)joins the group and it is provided with the current Gid to use in the group, the Group Manager considers such a Gid as the Birth Gid of that endpoint for that group. For each group member, the Group Manager <bcp14>MUST</bcp14> store the latest corresponding Birth Gid until that member leaves the group. If the endpoint has in fact re-joined the group, the newly determined Birth Gid overwrites the one currently stored.</t>
              <t indent="0" pn="section-12.2.1.1.1-3">When establishing a new Security Context for the group, the Group Manager takes the additional following step between Steps 1 and 2 of <xref target="sec-group-key-management" format="default" sectionFormat="of" derivedContent="Section 12.2"/>.</t>
              <t indent="0" pn="section-12.2.1.1.1-4">A. The Group Manager <bcp14>MUST</bcp14> check if the new Gid to be distributed is equal to the Birth Gid of any of the current group members. If any of such "elder members" is found in the group, then:</t>
              <ul spacing="normal" bare="false" empty="false" indent="3" pn="section-12.2.1.1.1-5">
                <li pn="section-12.2.1.1.1-5.1">
                  <t indent="0" pn="section-12.2.1.1.1-5.1.1">The Group Manager <bcp14>MUST</bcp14> evict the elder members from the group. That is, the Group Manager <bcp14>MUST</bcp14> terminate their membership and, in the following steps, it <bcp14>MUST</bcp14> rekey the group in such a way that the new keying material is not provided to those evicted elder members.  </t>
                  <t indent="0" pn="section-12.2.1.1.1-5.1.2">
This ensures that any response from the same server to the request of a long exchange can never successfully match against the request of two different long exchanges.  </t>
                  <t indent="0" pn="section-12.2.1.1.1-5.1.3">
The excluded elder members could eventually re-join the group, thus terminating any of their ongoing long exchanges (see <xref target="sec-long-exchanges" format="default" sectionFormat="of" derivedContent="Section 5.1"/>).  </t>
                  <t indent="0" pn="section-12.2.1.1.1-5.1.4">
Therefore, it is ensured by construction that no client can have with the same server two ongoing long exchanges, such that the two respective requests were protected using the same Partial IV, Gid, and Sender ID.</t>
                </li>
              </ul>
            </section>
          </section>
          <section anchor="sec-sid-recycling" numbered="true" removeInRFC="false" toc="exclude" pn="section-12.2.1.2">
            <name slugifiedName="name-recycling-of-sender-ids">Recycling of Sender IDs</name>
            <t indent="0" pn="section-12.2.1.2-1">From the moment a Gid is assigned to a group (T_start) until the moment when a new Gid is assigned to that same group, the following restrictions apply within the group:</t>
            <ul spacing="normal" bare="false" empty="false" indent="3" pn="section-12.2.1.2-2">
              <li pn="section-12.2.1.2-2.1">
                <t indent="0" pn="section-12.2.1.2-2.1.1">The Group Manager <bcp14>MUST NOT</bcp14> assign a Sender ID that was already the Sender ID of an endpoint in the group at T_start.</t>
              </li>
              <li pn="section-12.2.1.2-2.2">
                <t indent="0" pn="section-12.2.1.2-2.2.1">The Group Manager <bcp14>MUST NOT</bcp14> assign a given Sender ID more than once.</t>
              </li>
            </ul>
            <t indent="0" pn="section-12.2.1.2-3">That is, under the ongoing use of the current Gid, a given Sender ID is not reassigned to the same or a different endpoint. This prevents from reusing a Sender ID ('kid') with the same triple (Gid, Master Secret, Master Salt). Within these restrictions, the Group Manager can assign a Sender ID used under an old Gid value (including under a same, recycled Gid value), thus avoiding Sender ID values to irrecoverably grow in size.</t>
            <t indent="0" pn="section-12.2.1.2-4">Even when an endpoint joining a group is recognized as a current member of that group, e.g., through the ongoing secure communication association, the Group Manager <bcp14>MUST</bcp14> assign a new Sender ID different from the one currently used by the endpoint in the group unless the group is rekeyed first and a new Gid value is established.</t>
          </section>
          <section anchor="relation-between-identifiers-and-keying-material" numbered="true" removeInRFC="false" toc="exclude" pn="section-12.2.1.3">
            <name slugifiedName="name-relation-between-identifier">Relation between Identifiers and Keying Material</name>
            <t indent="0" pn="section-12.2.1.3-1"><xref target="fig-key-material-diagram" format="default" sectionFormat="of" derivedContent="Figure 4"/> gives an overview of the different identifiers and keying material components, considering their relation and possible reuse across group rekeying.</t>
            <figure anchor="fig-key-material-diagram" align="left" suppress-title="false" pn="figure-4">
              <name slugifiedName="name-relations-among-keying-mate">Relations Among Keying Material Components</name>
              <artwork align="center" pn="section-12.2.1.3-2.1">
Components changed in lockstep
    upon a group rekeying
+----------------------------+            * Changing a kid does not
|                            |              need changing the GID
| Master                     |&lt;--&gt; kid1
| Secret &lt;---&gt; o &lt;---&gt; GID   |            * A kid is not reassigned
|              ^             |&lt;--&gt; kid2     under the ongoing usage of
|              |             |              the current GID
|              |             |&lt;--&gt; kid3
|              v             |            * Upon changing the GID,
|         Master Salt        | ... ...      every current kid should
|         (optional)         |              be preserved for efficient
|                            |              key rollover
| The Key Generation Number  |
| is incremented by 1        |            * After changing the GID,
|                            |              an unused kid can be
+----------------------------+              assigned even if it was used
                                            before the GID change
</artwork>
            </figure>
          </section>
        </section>
      </section>
      <section anchor="sec-additional-entities" numbered="true" removeInRFC="false" toc="include" pn="section-12.3">
        <name slugifiedName="name-support-for-signature-check">Support for Signature Checkers</name>
        <t indent="0" pn="section-12.3-1">The Group Manager may serve signature checkers, e.g., intermediary gateways, which verify  countersignatures of messages protected in group mode (see <xref target="sec-processing-signature-checker" format="default" sectionFormat="of" derivedContent="Section 7.5"/>). These entities do not join a group as members, but they can retrieve authentication credentials of group members and other selected group data from the Group Manager.</t>
        <t indent="0" pn="section-12.3-2">In order to verify countersignatures of messages in a group, a signature checker needs to retrieve the following information about the group from the responsible Group Manager:</t>
        <ul spacing="normal" bare="false" empty="false" indent="3" pn="section-12.3-3">
          <li pn="section-12.3-3.1">
            <t indent="0" pn="section-12.3-3.1.1">The current ID Context (Gid) used in the group.</t>
          </li>
          <li pn="section-12.3-3.2">
            <t indent="0" pn="section-12.3-3.2.1">The authentication credentials and other information (e.g., the Sender IDs) associated with the group members as well as the authentication credential of the Group Manager.  </t>
            <t indent="0" pn="section-12.3-3.2.2">
If the signature checker is provided with a CWT or a CCS for a given entity, then the authentication credential associated with that entity is the untagged CWT or CCS.  </t>
            <t indent="0" pn="section-12.3-3.2.3">
If the signature checker is provided with a chain or a bag of X.509/C509 certificates, or of CWTs, or of CCSs for a given entity, then the authentication credential associated with that entity is the end-entity certificate or end-entity untagged CWT/CCS.</t>
          </li>
          <li pn="section-12.3-3.3">
            <t indent="0" pn="section-12.3-3.3.1">The current Signature Encryption Key used in the group (see <xref target="ssec-common-context-group-enc-key" format="default" sectionFormat="of" derivedContent="Section 2.1.9"/>).</t>
          </li>
          <li pn="section-12.3-3.4">
            <t indent="0" pn="section-12.3-3.4.1">The identifiers of the algorithms used in the group (see <xref target="sec-context" format="default" sectionFormat="of" derivedContent="Section 2"/>), i.e., i) the HKDF Algorithm, ii) the Group Encryption Algorithm and Signature Algorithm, and iii) the AEAD Algorithm and Pairwise Key Agreement Algorithm, if such parameters are set in the Common Context (see Sections <xref target="ssec-common-context-aead-alg" format="counter" sectionFormat="of" derivedContent="2.1.1"/> and <xref target="ssec-common-context-dh-alg" format="counter" sectionFormat="of" derivedContent="2.1.10"/>).</t>
          </li>
        </ul>
        <t indent="0" pn="section-12.3-4">A signature checker <bcp14>MUST</bcp14> be authorized before it can retrieve such information, e.g., with the use of <xref target="I-D.ietf-ace-key-groupcomm-oscore" format="default" sectionFormat="of" derivedContent="ACE-KEY-GROUP-OSCORE"/>.</t>
      </section>
    </section>
    <section anchor="sec-security-considerations" numbered="true" removeInRFC="false" toc="include" pn="section-13">
      <name slugifiedName="name-security-considerations">Security Considerations</name>
      <t indent="0" pn="section-13-1">The same considerations from <xref section="D" sectionFormat="of" target="RFC8613" format="default" derivedLink="https://rfc-editor.org/rfc/rfc8613#appendix-D" derivedContent="RFC8613"/> on the security properties of OSCORE apply for Group OSCORE with the differences discussed in the following. Those considerations are about the reference threat model, the support for proxy operations, the protection of message fields, and the uniqueness of (key, nonce) pairs (which is further discussed in <xref target="ssec-key-nonce-uniqueness" format="default" sectionFormat="of" derivedContent="Section 13.3"/> of this document).</t>
      <t indent="0" pn="section-13-2">For Group OSCORE, the Sender Context and Recipient Context additionally contain asymmetric keys, which are used to provide source authentication in group mode by means of countersignatures (see <xref target="ssec-group-mode-security" format="default" sectionFormat="of" derivedContent="Section 13.1"/>) and in pairwise mode by using Diffie-Hellman (see <xref target="ssec-pairwise-mode-security" format="default" sectionFormat="of" derivedContent="Section 13.2"/>). The key pair can, for example, be generated by the endpoint or provisioned during manufacturing.</t>
      <t indent="0" pn="section-13-3">Note that, even if an endpoint is authorized to be a group member and to take part in group communications, there is a risk that it behaves inappropriately. For instance, it can forward the content of messages in the group to unauthorized entities. However, in many use cases, the devices in the group belong to a common authority and are configured by a commissioner (see <xref target="sec-use-cases" format="default" sectionFormat="of" derivedContent="Appendix B"/>), which limits this risk in practice and enables a prompt detection/reaction in the case of misbehaving.</t>
      <t indent="0" pn="section-13-4">With respect to unprotected message fields, the following applies. First, the 'kid context' of request messages is part of the AAD, making it possible to keep long exchanges active safely beyond a possible change of ID Context (Gid) following a group rekeying (see <xref target="sec-cose-object-ext-aad" format="default" sectionFormat="of" derivedContent="Section 3.4"/>). Second, the countersignature included in a Group OSCORE message protected in group mode is also computed over the value of the OSCORE Option, which is also part of the AAD used in the signing process. This is further discussed in <xref target="ssec-cross-group-injection" format="default" sectionFormat="of" derivedContent="Section 13.7"/> of this document.</t>
      <t indent="0" pn="section-13-5">In accordance with <xref target="RFC8613" format="default" sectionFormat="of" derivedContent="RFC8613"/>, all elements used in Group OSCORE as opaque binary values (e.g., Sender ID, ID Context) are not to be interpreted as text, Unicode, or otherwise. Implementations ought not to apply encoding transformations to the content of those elements, e.g., UTF-8 decoding <xref target="RFC3629" format="default" sectionFormat="of" derivedContent="RFC3629"/> or normalization. Information elements that may contain text such as those found within authentication credentials (e.g., X.509 distinguished names, CWT claims, or JSON Web Key fields) are to be treated as opaque structured data and to be interpreted only according to the rules of the credential format as defined in their respective specifications. This avoids misinterpretation, Unicode normalization attacks, or mismatches in identity comparison.</t>
      <t indent="0" pn="section-13-6">As discussed in <xref section="6.2.3" sectionFormat="of" target="RFC10020" format="default" derivedLink="https://rfc-editor.org/rfc/rfc10020#section-6.2.3" derivedContent="RFC10020"/>, Group OSCORE addresses security attacks against CoAP as listed in Sections <xref section="11.2" sectionFormat="bare" target="RFC7252" format="default" derivedLink="https://rfc-editor.org/rfc/rfc7252#section-11.2" derivedContent="RFC7252"/> through <xref section="11.6" sectionFormat="bare" target="RFC7252" format="default" derivedLink="https://rfc-editor.org/rfc/rfc7252#section-11.6" derivedContent="RFC7252"/> of <xref target="RFC7252" format="default" sectionFormat="of" derivedContent="RFC7252"/>, especially when run over IP multicast.</t>
      <t indent="0" pn="section-13-7">Group OSCORE does not aim to meet the following properties:</t>
      <ul spacing="normal" bare="false" empty="false" indent="3" pn="section-13-8">
        <li pn="section-13-8.1">
          <t indent="0" pn="section-13-8.1.1">Verification of server aliveness, as discussed in <xref target="sec-freshness" format="default" sectionFormat="of" derivedContent="Section 5.2"/>.</t>
        </li>
        <li pn="section-13-8.2">
          <t indent="0" pn="section-13-8.2.1">Protection of network addressing information, as discussed in <xref target="ssec-unicast-requests" format="default" sectionFormat="of" derivedContent="Section 13.9"/>.</t>
        </li>
        <li pn="section-13-8.3">
          <t indent="0" pn="section-13-8.3.1">Management of group membership and group keying material, which is entrusted to the Group Manager (see <xref target="group-manager" format="default" sectionFormat="of" derivedContent="Section 12"/>). Related security considerations are discussed in Sections <xref target="sec-cons-group-key-management" format="counter" sectionFormat="of" derivedContent="13.4"/> and <xref target="ssec-key-rotation" format="counter" sectionFormat="of" derivedContent="13.5"/>.</t>
        </li>
        <li pn="section-13-8.4">
          <t indent="0" pn="section-13-8.4.1">Confidentiality protection of the OSCORE Option. Related privacy considerations are discussed in <xref target="ssec-privacy" format="default" sectionFormat="of" derivedContent="Section 13.18"/>.</t>
        </li>
      </ul>
      <t indent="0" pn="section-13-9">The rest of this section first discusses security aspects to be taken into account when using Group OSCORE. Then, it goes through aspects covered in the security considerations of OSCORE (see <xref section="12" sectionFormat="of" target="RFC8613" format="default" derivedLink="https://rfc-editor.org/rfc/rfc8613#section-12" derivedContent="RFC8613"/>) and discusses how they apply when Group OSCORE is used.</t>
      <section anchor="ssec-group-mode-security" numbered="true" removeInRFC="false" toc="include" pn="section-13.1">
        <name slugifiedName="name-security-of-the-group-mode">Security of the Group Mode</name>
        <t indent="0" pn="section-13.1-1">The group mode defined in <xref target="mess-processing" format="default" sectionFormat="of" derivedContent="Section 7"/> relies on shared group keying material to protect communication within a group. Using the group mode has the implications discussed below. This section uses the term 'group members' to describe endpoints that possess the latest version of the group keying material.</t>
        <ul spacing="normal" bare="false" empty="false" indent="3" pn="section-13.1-2">
          <li pn="section-13.1-2.1">
            <t indent="0" pn="section-13.1-2.1.1">Source authentication of messages sent to a group is ensured through a countersignature, which is computed by the sender endpoint using its own private key and then appended to the message payload. The countersignature is also encrypted using a keystream derived from the group keying material (see Sections <xref target="compression-details" format="counter" sectionFormat="of" derivedContent="4.1"/> and <xref target="sssec-encrypted-signature-keystream" format="counter" sectionFormat="of" derivedContent="4.2"/>). This ensures group privacy, i.e., an attacker cannot track an endpoint over two groups by linking messages between the two groups unless the attacker is also a member of both groups.</t>
          </li>
          <li pn="section-13.1-2.2">
            <t indent="0" pn="section-13.1-2.2.1">Messages are encrypted at a group level (group-level data confidentiality), i.e., they can be decrypted by any member of the group, but not by an external adversary or other external entities other than the Group Manager responsible for the group.</t>
          </li>
          <li pn="section-13.1-2.3">
            <t indent="0" pn="section-13.1-2.3.1">If the used Group Encryption Algorithm provides integrity protection, then it also ensures group authentication and proof of group membership, but not source authentication. That is, it ensures that a message sent to a group has been sent by a member of that group, but not necessarily by the alleged sender. In fact, any group member is able to derive the Sender Key used by the actual sender endpoint, and thus can compute a valid authentication tag. Therefore, the message content could originate from any of the current group members.  </t>
            <t indent="0" pn="section-13.1-2.3.2">
Furthermore, if the used Group Encryption Algorithm does not provide integrity protection, then it does not ensure any level of message authentication or proof of group membership.  </t>
            <t indent="0" pn="section-13.1-2.3.3">
On the other hand, proof of group membership is always ensured by construction through the strict management of the group keying material (see <xref target="sec-group-key-management" format="default" sectionFormat="of" derivedContent="Section 12.2"/>). That is, the group is rekeyed when members leave and the current group members are informed of former group members. Thus, a current group member storing the latest group keying material does not store the authentication credential of any former group member.  </t>
            <t indent="0" pn="section-13.1-2.3.4">
This allows a recipient endpoint to rely on the stored authentication credentials and public keys included therein in order to always confidently verify the group membership of a sender endpoint when processing an incoming message, i.e., to verify that the sender endpoint was a group member when it signed the message. In turn, this prevents a former group member from possibly re-signing and injecting in the group a stored message that was protected with old keying material. A case in point is discussed in <xref target="ssec-need-proof-group-membership" format="default" sectionFormat="of" derivedContent="Section 13.1.1"/>.</t>
          </li>
        </ul>
        <t indent="0" pn="section-13.1-3">The security properties of the group mode are summarized below.</t>
        <ol spacing="normal" type="1" indent="adaptive" start="1" pn="section-13.1-4"><li pn="section-13.1-4.1" derivedCounter="1.">
            <t indent="0" pn="section-13.1-4.1.1">Asymmetric source authentication by means of a countersignature.</t>
          </li>
          <li pn="section-13.1-4.2" derivedCounter="2.">
            <t indent="0" pn="section-13.1-4.2.1">Symmetric group authentication by means of an authentication tag (only for Group Encryption Algorithms providing integrity protection).</t>
          </li>
          <li pn="section-13.1-4.3" derivedCounter="3.">
            <t indent="0" pn="section-13.1-4.3.1">Symmetric group confidentiality by means of symmetric encryption.</t>
          </li>
          <li pn="section-13.1-4.4" derivedCounter="4.">
            <t indent="0" pn="section-13.1-4.4.1">Proof of group membership by strictly managing the group keying material as well as by means of integrity tags when using a Group Encryption Algorithm that provides also integrity protection.</t>
          </li>
          <li pn="section-13.1-4.5" derivedCounter="5.">
            <t indent="0" pn="section-13.1-4.5.1">Group privacy by encrypting the countersignature.</t>
          </li>
        </ol>
        <t indent="0" pn="section-13.1-5">The group mode fulfills the security properties above while also displaying the following benefits. First, the use of a Group Encryption Algorithm that does not provide integrity protection results in a minimal communication overhead by limiting the message payload to the ciphertext without integrity tag together with the encrypted countersignature. Second, it is possible to deploy semi-trusted entities such as signature checkers (see <xref target="sec-additional-entities" format="default" sectionFormat="of" derivedContent="Section 12.3"/>), which can break property 5, but cannot break properties 1, 2, 3, and 4.</t>
        <section anchor="ssec-need-proof-group-membership" numbered="true" removeInRFC="false" toc="include" pn="section-13.1.1">
          <name slugifiedName="name-example-of-need-for-proof-o">Example of Need for Proof of Group Membership</name>
          <t indent="0" pn="section-13.1.1-1">As a case in point, the importance of reliable proof of group membership is evident in a group where the Group Encryption Algorithm does not provide integrity protection. Suppose that a group member leaves the group and, after the group rekeying, associates with the group as external signature checker (see <xref target="sec-processing-signature-checker" format="default" sectionFormat="of" derivedContent="Section 7.5"/>). When doing so, it obtains the new Signature Encryption Key from the Group Manager, from which it can derive keystreams for encrypting and decrypting the countersignatures of messages protected in group mode.</t>
          <t indent="0" pn="section-13.1.1-2">However, when participating in the group rekeying, the current group members deleted the Recipient Context and authentication credential of the former group member. Consequently, the signature checker is not able to successfully inject messages protected in group mode, as encrypted with the old group keying material, signed with its own private key, and with the countersignature encrypted by means of the latest Signature Encryption Key. That is, if the signature checker attempts to do that, then the group members will fail to verify the messages from the signature checker and thus will discard those messages.</t>
        </section>
      </section>
      <section anchor="ssec-pairwise-mode-security" numbered="true" removeInRFC="false" toc="include" pn="section-13.2">
        <name slugifiedName="name-security-of-the-pairwise-mo">Security of the Pairwise Mode</name>
        <t indent="0" pn="section-13.2-1">The pairwise mode defined in <xref target="sec-pairwise-protection" format="default" sectionFormat="of" derivedContent="Section 8"/> protects messages by using pairwise symmetric keys, derived from the static-static Diffie-Hellman shared secret computed from the asymmetric keys of the sender and recipient endpoint (see <xref target="sec-derivation-pairwise" format="default" sectionFormat="of" derivedContent="Section 2.5"/>).</t>
        <t indent="0" pn="section-13.2-2">The used AEAD Algorithm <bcp14>MUST</bcp14> provide integrity protection. Therefore, the pairwise mode ensures both pairwise data confidentiality and source authentication of messages without using countersignatures. Furthermore, the recipient endpoint achieves proof of group membership for the sender endpoint since only current group members have the required keying material to derive a valid Pairwise Sender/Recipient Key.</t>
        <t indent="0" pn="section-13.2-3">Finally, the pairwise mode ensures group privacy, i.e., an attacker cannot track an endpoint over two groups by linking messages between the two groups unless the attacker is also a member of both groups. This follows from two different groups using different and uncorrelated group keying material, which yields different and uncorrelated pairwise keys for the same endpoint in any two groups. Therefore, the authentication tags generated by an endpoint in a group have no correlation with those generated by the same endpoint in another group.</t>
        <t indent="0" pn="section-13.2-4">The security properties of the pairwise mode are summarized below.</t>
        <ol spacing="normal" type="1" indent="adaptive" start="1" pn="section-13.2-5"><li pn="section-13.2-5.1" derivedCounter="1.">
            <t indent="0" pn="section-13.2-5.1.1">Symmetric source authentication by means of an authentication tag.</t>
          </li>
          <li pn="section-13.2-5.2" derivedCounter="2.">
            <t indent="0" pn="section-13.2-5.2.1">Symmetric pairwise confidentiality by means of symmetric encryption.</t>
          </li>
          <li pn="section-13.2-5.3" derivedCounter="3.">
            <t indent="0" pn="section-13.2-5.3.1">Proof of group membership by strictly managing the group keying material, as well as by means of integrity tags.</t>
          </li>
          <li pn="section-13.2-5.4" derivedCounter="4.">
            <t indent="0" pn="section-13.2-5.4.1">Group privacy by virtue of the uncorrelated pairwise keys used in any two different groups.</t>
          </li>
        </ol>
        <t indent="0" pn="section-13.2-6">The long-term storing of the Diffie-Hellman shared secret is a potential security issue. In fact, if the shared secret of two group members is leaked, a third group member can exploit it to derive their pairwise keys and use those to impersonate either of the two group members to the other, or to decrypt previously stored messages exchanged between those two members and protected with their pairwise keys. The possibility of such leakage should be considered more likely than the leakage of a private key, which could be rather protected at a significantly higher level than generic memory, e.g., by using a Trusted Platform Module. Therefore, there is a trade-off between the maximum amount of time a same shared secret is stored and the frequency of its re-computing.</t>
      </section>
      <section anchor="ssec-key-nonce-uniqueness" numbered="true" removeInRFC="false" toc="include" pn="section-13.3">
        <name slugifiedName="name-uniqueness-of-key-nonce">Uniqueness of (key, nonce)</name>
        <t indent="0" pn="section-13.3-1">The proof for uniqueness of (key, nonce) pairs in <xref section="D.4" sectionFormat="of" target="RFC8613" format="default" derivedLink="https://rfc-editor.org/rfc/rfc8613#appendix-D.4" derivedContent="RFC8613"/> is also valid in group communication scenarios. That is, given an OSCORE group:</t>
        <ul spacing="normal" bare="false" empty="false" indent="3" pn="section-13.3-2">
          <li pn="section-13.3-2.1">
            <t indent="0" pn="section-13.3-2.1.1">Uniqueness of Sender IDs within the group is enforced by the Group Manager. In fact, from the moment when a Gid is assigned to a group until the moment when a new Gid is assigned to that same group, the Group Manager does not reassign a Sender ID within the group (see <xref target="sec-sid-recycling" format="default" sectionFormat="of" derivedContent="Section 12.2.1.2"/>).</t>
          </li>
          <li pn="section-13.3-2.2">
            <t indent="0" pn="section-13.3-2.2.1">Case A in <xref section="D.4" sectionFormat="of" target="RFC8613" format="default" derivedLink="https://rfc-editor.org/rfc/rfc8613#appendix-D.4" derivedContent="RFC8613"/> concerns all requests as well as all responses including a Partial IV (e.g., Observe notifications <xref target="RFC7641" format="default" sectionFormat="of" derivedContent="RFC7641"/> or any other subsequent responses after the first one). In this case, the same considerations from <xref target="RFC8613" format="default" sectionFormat="of" derivedContent="RFC8613"/> apply here as well.</t>
          </li>
          <li pn="section-13.3-2.3">
            <t indent="0" pn="section-13.3-2.3.1">Case B in <xref section="D.4" sectionFormat="of" target="RFC8613" format="default" derivedLink="https://rfc-editor.org/rfc/rfc8613#appendix-D.4" derivedContent="RFC8613"/> concerns responses not including a Partial IV (e.g., a single response to a request). In this case, the same considerations from <xref target="RFC8613" format="default" sectionFormat="of" derivedContent="RFC8613"/> apply here as well.</t>
          </li>
        </ul>
        <t indent="0" pn="section-13.3-3">As a consequence, each message encrypted/decrypted with the same key is processed by using a different (ID_PIV, PIV) pair. This means that nonces used by any fixed encrypting endpoint are unique. Thus, each message is processed with a different (key, nonce) pair.</t>
      </section>
      <section anchor="sec-cons-group-key-management" numbered="true" removeInRFC="false" toc="include" pn="section-13.4">
        <name slugifiedName="name-management-of-group-keying-m">Management of Group Keying Material</name>
        <t indent="0" pn="section-13.4-1">The protocol described in this document should take into account the risk of compromise of group members. In particular, this document specifies that a key management scheme for secure revocation and renewal of Security Contexts and group keying material <bcp14>MUST</bcp14> be adopted.</t>
        <t indent="0" pn="section-13.4-2"><xref target="I-D.ietf-ace-key-groupcomm-oscore" format="default" sectionFormat="of" derivedContent="ACE-KEY-GROUP-OSCORE"/> specifies a simple rekeying scheme for renewing the Security Context in a group.</t>
        <t indent="0" pn="section-13.4-3">Alternative rekeying schemes that are more scalable with the group size may be needed in dynamic, large groups where endpoints can join and leave at any time in order to limit the impact on performance due to the Security Context and keying material update.</t>
        <section anchor="denial-of-service" numbered="true" removeInRFC="false" toc="include" pn="section-13.4.1">
          <name slugifiedName="name-denial-of-service">Denial of Service</name>
          <t indent="0" pn="section-13.4.1-1">An adversary may leverage the loss of Sender Contexts and/or Recipient Contexts as described in <xref target="ssec-loss-mutable-context-total" format="default" sectionFormat="of" derivedContent="Section 2.6.1.1"/> in order to perform a Denial of Service attack and prevent some group members from communicating altogether.</t>
          <t indent="0" pn="section-13.4.1-2">That is, the adversary can first block the communication path between the Group Manager and some individual group members. This can be achieved, for instance, by injecting fake responses to DNS queries for the Group Manager hostname or by removing a network link used for routing traffic towards the Group Manager.</t>
          <t indent="0" pn="section-13.4.1-3">Then, the adversary can induce an unprepared reboot for some endpoints in the group, e.g., by triggering a short power outage. After that, such endpoints that have lost their Sender Context and/or Recipient Contexts following the reboot would not be able to obtain new Security Context parameters from the Group Manager as specified in <xref target="ssec-loss-mutable-context-total" format="default" sectionFormat="of" derivedContent="Section 2.6.1.1"/>. Thus, they would not be able to further communicate in the group until connectivity with the Group Manager is restored.</t>
        </section>
      </section>
      <section anchor="ssec-key-rotation" numbered="true" removeInRFC="false" toc="include" pn="section-13.5">
        <name slugifiedName="name-update-of-security-context-">Update of Security Context and Key Rotation</name>
        <t indent="0" pn="section-13.5-1">A group member can receive a message shortly after the group has been rekeyed and new security parameters and keying material have been distributed by the Group Manager.</t>
        <t indent="0" pn="section-13.5-2">This may result in a client using an old Security Context to protect a request and a server using a different new Security Context to protect a corresponding response. As a consequence, clients may receive a response protected with a Security Context different from the one used to protect the corresponding request.</t>
        <t indent="0" pn="section-13.5-3">In particular, a server may first receive a request protected with the old Security Context, then install the new Security Context, and only after that produce a response to send back to the client. In such a case, as specified in <xref target="ssec-protect-response" format="default" sectionFormat="of" derivedContent="Section 7.3"/>, the server <bcp14>MUST</bcp14> protect the potential response using the new Security Context. Specifically, the server <bcp14>MUST</bcp14> include its Sender Sequence Number as Partial IV in the response and use it to build the nonce to protect the response. This prevents the nonce from the request from being reused with the new Security Context.</t>
        <t indent="0" pn="section-13.5-4">The client will process that response using the new Security Context, provided that it has installed the new security parameters and keying material before the message processing.</t>
        <t indent="0" pn="section-13.5-5">If block-wise transfer <xref target="RFC7959" format="default" sectionFormat="of" derivedContent="RFC7959"/> is used, the same considerations from <xref section="10.3" sectionFormat="of" target="RFC9594" format="default" derivedLink="https://rfc-editor.org/rfc/rfc9594#section-10.3" derivedContent="RFC9594"/> apply.</t>
        <t indent="0" pn="section-13.5-6">Furthermore, as described below, a group rekeying may temporarily result in misaligned Security Contexts between the sender and recipient of a given message.</t>
        <section anchor="ssec-key-rotation-late-sender" numbered="true" removeInRFC="false" toc="include" pn="section-13.5.1">
          <name slugifiedName="name-late-update-on-the-sender">Late Update on the Sender</name>
          <t indent="0" pn="section-13.5.1-1">In this case, the sender protects a message using the old Security Context, i.e., before having installed the new Security Context. However, the recipient receives the message after having installed the new Security Context and is thus unable to correctly process it.</t>
          <t indent="0" pn="section-13.5.1-2">A possible way to mitigate this issue is to preserve the old retained Security Context for a maximum amount of time defined by the application. By doing so, the recipient can still try to process the received message using the old retained Security Context.</t>
          <t indent="0" pn="section-13.5.1-3">This makes particular sense when the recipient is a client, as it enables the client to process incoming responses protected with the old retained Security Context that was used to protect the associated request. If, as typically expected, the old Gid is not included in the response, the client will first fail to process the response using the latest Security Context and then use the old retained Security Context as a second attempt.</t>
          <t indent="0" pn="section-13.5.1-4">Instead, a recipient server can immediately process an incoming request with the old retained Security Context, as signaled by the old Gid that is always included in requests. However, the server could simply discard such an incoming request, which is preferable from a security point of view.</t>
          <t indent="0" pn="section-13.5.1-5">This tolerance preserves the processing of secure messages throughout a long-lasting key rotation, as group rekeying processes may likely take a long time to complete, especially in large groups. On the other hand, a former (compromised) group member can abusively take advantage of this and send messages protected with the old retained Security Context. Therefore, a conservative application policy should not permit the retention of old Security Contexts.</t>
        </section>
        <section anchor="ssec-key-rotation-late-recipient" numbered="true" removeInRFC="false" toc="include" pn="section-13.5.2">
          <name slugifiedName="name-late-update-on-the-recipien">Late Update on the Recipient</name>
          <t indent="0" pn="section-13.5.2-1">In this case, the sender protects a message using the new Security Context, but the recipient receives that message before having installed the new Security Context. Therefore, the recipient would not be able to correctly process the message and hence discards it.</t>
          <t indent="0" pn="section-13.5.2-2">If the recipient installs the new Security Context shortly after that and the sender endpoint retransmits the message, the former will still be able to receive and correctly process the message.</t>
          <t indent="0" pn="section-13.5.2-3">In any case, the recipient should actively ask the Group Manager for an updated Security Context according to an application-defined policy, e.g., after a given number of unsuccessfully decrypted incoming messages.</t>
        </section>
      </section>
      <section anchor="ssec-gid-collision" numbered="true" removeInRFC="false" toc="include" pn="section-13.6">
        <name slugifiedName="name-collision-of-group-identifi">Collision of Group Identifiers</name>
        <t indent="0" pn="section-13.6-1">If endpoints are deployed in multiple groups managed by different non-synchronized Group Managers, it is possible for Group Identifiers of different groups to coincide.</t>
        <t indent="0" pn="section-13.6-2">This does not impair the security of the AEAD Algorithm and of the Group Encryption Algorithm. In fact, as long as the Master Secret is different for different groups and this condition holds over time, keys are different among different groups.</t>
        <t indent="0" pn="section-13.6-3">If multiple groups use the same IP multicast address, the entity assigning that address may help limiting the chances to experience such collisions of Group Identifiers. In particular, it may allow the Group Managers of those groups using the same IP multicast address to share their respective list of assigned Group Identifiers currently in use.</t>
      </section>
      <section anchor="ssec-cross-group-injection" numbered="true" removeInRFC="false" toc="include" pn="section-13.7">
        <name slugifiedName="name-cross-group-message-injecti">Cross-Group Message Injection</name>
        <t indent="0" pn="section-13.7-1">A given endpoint is allowed to and would likely use the same pair (private key, authentication credential) in multiple OSCORE groups, possibly administered by different Group Managers.</t>
        <t indent="0" pn="section-13.7-2">When a sender endpoint sends a message protected in pairwise mode to a recipient endpoint in an OSCORE group, a malicious group member may attempt to inject the message to a different OSCORE group also including the same endpoints (see <xref target="ssec-cross-group-injection-attack" format="default" sectionFormat="of" derivedContent="Section 13.7.1"/>).</t>
        <t indent="0" pn="section-13.7-3">This relies on altering the content of the OSCORE Option in such a way that the MAC in the ciphertext will still be correctly validated, which has a success probability depending on the size of the MAC.</t>
        <t indent="0" pn="section-13.7-4">As discussed in <xref target="sssec-cross-group-injection-group-mode" format="default" sectionFormat="of" derivedContent="Section 13.7.2"/>, the attack is practically infeasible if the message is protected in group mode, thanks to the countersignature also bound to the OSCORE Option through the AAD used in the signing process (see <xref target="sec-cose-object-ext-aad" format="default" sectionFormat="of" derivedContent="Section 3.4"/>).</t>
        <section anchor="ssec-cross-group-injection-attack" numbered="true" removeInRFC="false" toc="include" pn="section-13.7.1">
          <name slugifiedName="name-attack-description">Attack Description</name>
          <t indent="0" pn="section-13.7.1-1">Consider the following:</t>
          <ul spacing="normal" bare="false" empty="false" indent="3" pn="section-13.7.1-2">
            <li pn="section-13.7.1-2.1">
              <t indent="0" pn="section-13.7.1-2.1.1">OSCORE groups G1 and G2, with ID Context (Gid) GID1 and GID2, respectively. Both G1 and G2 use the AEAD algorithm AES-CCM-16-64-128, i.e., the MAC of the ciphertext is 8 bytes in size.</t>
            </li>
            <li pn="section-13.7.1-2.2">
              <t indent="0" pn="section-13.7.1-2.2.1">A sender endpoint X, which is a member of both G1 and G2 and uses the same pair (private key, authentication credential) in both groups. The endpoint X has Sender ID SID1 in G1 and Sender ID SID2 in G2. The pairs (SID1, GID1) and (SID2, GID2) identify the same authentication credential of X in G1 and G2, respectively.</t>
            </li>
            <li pn="section-13.7.1-2.3">
              <t indent="0" pn="section-13.7.1-2.3.1">A recipient endpoint Y, which is a member of both G1 and G2 and uses the same pair (private key, authentication credential) in both groups. The endpoint Y has Sender ID SID3 in G1 and Sender ID SID4 in G2. The pairs (SID3, GID1) and (SID4, GID2) identify the same authentication credential of Y in G1 and G2, respectively.</t>
            </li>
            <li pn="section-13.7.1-2.4">
              <t indent="0" pn="section-13.7.1-2.4.1">A malicious endpoint Z, which is also a member of both G1 and G2. Hence, Z is able to derive the Sender Keys used by X in G1 and G2.</t>
            </li>
          </ul>
          <t indent="0" pn="section-13.7.1-3">When X sends a message M1 addressed to Y in G1 and protected in pairwise mode, Z can intercept M1 and attempt to forge a valid message M2 to be injected into G2, making it appear to have been sent by X to Y and therefore accepted as valid.</t>
          <t indent="0" pn="section-13.7.1-4">In more detail, Z intercepts and stops message M1 and forges a message M2 by changing the value of the OSCORE Option from M1 as follows: the 'kid context' is set to GID2 (rather than GID1), and the 'kid' is set to SID2 (rather than SID1). Then, Z injects message M2 as addressed to Y in G2.</t>
          <t indent="0" pn="section-13.7.1-5">Upon receiving M2, there is a probability equal to 2<sup>-64</sup> that Y successfully verifies the same unchanged MAC by using the Pairwise Recipient Key associated with X in G2.</t>
          <t indent="0" pn="section-13.7.1-6">Note that Z does not know the pairwise keys of X and Y since it does not know and is not able to compute their shared Diffie-Hellman secret. Therefore, Z is not able to check offline if a performed forgery is actually valid, before sending the forged message to G2.</t>
        </section>
        <section anchor="sssec-cross-group-injection-group-mode" numbered="true" removeInRFC="false" toc="include" pn="section-13.7.2">
          <name slugifiedName="name-attack-prevention-in-group-">Attack Prevention in Group Mode</name>
          <t indent="0" pn="section-13.7.2-1">When a Group OSCORE message is protected in group mode, the countersignature is also computed over the value of the OSCORE Option, which is part of the AAD used in the signing process (see <xref target="sec-cose-object-ext-aad" format="default" sectionFormat="of" derivedContent="Section 3.4"/>).</t>
          <t indent="0" pn="section-13.7.2-2">That is, in addition to the ciphertext, the countersignature is computed over the ID Context (Gid) and the Partial IV (both of which are always present in requests), as well as the Sender ID of the message originator (which is always present in requests and in responses to requests protected in group mode).</t>
          <t indent="0" pn="section-13.7.2-3">Since the signing process also takes the ciphertext of the COSE_Encrypt0 object as input, the countersignature is bound not only to the intended OSCORE group (hence to the triplet composed of Master Secret, Master Salt, and ID Context), but also to a specific Sender ID in that group and the specific AEAD key derived from it (hence to the quartet composed of Master Secret, Master Salt, ID Context, and Sender ID).</t>
          <t indent="0" pn="section-13.7.2-4">This makes it practically infeasible to perform the attack described in <xref target="ssec-cross-group-injection-attack" format="default" sectionFormat="of" derivedContent="Section 13.7.1"/> since it would require the adversary to additionally forge a valid countersignature that replaces the original one in the forged message M2.</t>
        </section>
      </section>
      <section anchor="ssec-group-cloning" numbered="true" removeInRFC="false" toc="include" pn="section-13.8">
        <name slugifiedName="name-prevention-of-group-cloning">Prevention of Group Cloning Attack</name>
        <t indent="0" pn="section-13.8-1">When using the group mode or the pairwise mode, the message protection covers also the Group Manager's authentication credential. This is included in the AAD used in the signing process and/or in the integrity-protected encryption process (see <xref target="sec-cose-object-ext-aad" format="default" sectionFormat="of" derivedContent="Section 3.4"/>).</t>
        <t indent="0" pn="section-13.8-2">By doing so, an endpoint X that is a member of a group G1 cannot perform the following attack.</t>
        <ol spacing="normal" type="1" indent="adaptive" start="1" pn="section-13.8-3"><li pn="section-13.8-3.1" derivedCounter="1.">
            <t indent="0" pn="section-13.8-3.1.1">X sets up a group G2 where it acts as Group Manager.</t>
          </li>
          <li pn="section-13.8-3.2" derivedCounter="2.">
            <t indent="0" pn="section-13.8-3.2.1">X makes G2 a "clone" of G1, i.e., G1 and G2 use the same algorithms and have the same Master Secret, Master Salt, and ID Context.</t>
          </li>
          <li pn="section-13.8-3.3" derivedCounter="3.">
            <t indent="0" pn="section-13.8-3.3.1">X collects a message M sent to G1 and injects it in G2.</t>
          </li>
          <li pn="section-13.8-3.4" derivedCounter="4.">
            <t indent="0" pn="section-13.8-3.4.1">Members of G2 accept M and believe it to be originated in G2.</t>
          </li>
        </ol>
        <t indent="0" pn="section-13.8-4">The attack above is effectively prevented since message M is protected by including the authentication credential of G1's Group Manager in the AAD. Therefore, members of G2 do not successfully verify and decrypt M since they correctly use the authentication credential of X as Group Manager of G2 when attempting to.</t>
      </section>
      <section anchor="ssec-unicast-requests" numbered="true" removeInRFC="false" toc="include" pn="section-13.9">
        <name slugifiedName="name-group-oscore-for-unicast-re">Group OSCORE for Unicast Requests</name>
        <t indent="0" pn="section-13.9-1">If a request is intended to be sent over unicast as addressed to a single group member, it is <bcp14>NOT RECOMMENDED</bcp14> for the client to protect the request by using the group mode as defined in <xref target="ssec-protect-request" format="default" sectionFormat="of" derivedContent="Section 7.1"/>.</t>
        <t indent="0" pn="section-13.9-2">This does not include the case where the client sends a request over unicast to a proxy to be forwarded to multiple intended recipients over multicast <xref target="RFC10020" format="default" sectionFormat="of" derivedContent="RFC10020"/>. In this case, the client typically protects the request with the group mode, even though it is sent to the proxy over unicast (see <xref target="mess-processing" format="default" sectionFormat="of" derivedContent="Section 7"/>).</t>
        <t indent="0" pn="section-13.9-3">If the client uses the group mode with its own Sender Key to protect a unicast request to a group member, an on-path adversary can, right then or later on, redirect that request to one/many different group member(s) over unicast, or to the whole OSCORE group over multicast. By doing so, the adversary can induce the target group member(s) to perform actions intended for one group member only. Note that the adversary can be external, i.e., the adversary does not need to also be a member of the OSCORE group.</t>
        <t indent="0" pn="section-13.9-4">This is due to the fact that the client is not able to indicate the single intended recipient in a way that is secure and possible to process for Group OSCORE on the server side. In particular, Group OSCORE does not protect network addressing information such as the IP address of the intended recipient server. It follows that the server(s) receiving the redirected request cannot verify whether that was the original intention of the client, and would thus simply assume so.</t>
        <t indent="0" pn="section-13.9-5">The impact of such an attack depends especially on the REST method of the request, i.e., the Inner CoAP Code of the protected request message. In particular, safe methods such as GET and FETCH would trigger (several) unintended responses from the targeted server(s), while not resulting in destructive behavior. On the other hand, non-safe methods such as PUT, POST, and PATCH/iPATCH would result in the target server(s) taking active actions on their resources and possible cyber-physical environment with the risk of destructive consequences and possible implications for safety.</t>
        <t indent="0" pn="section-13.9-6">Instead, a client can use the pairwise mode as defined in <xref target="sec-pairwise-protection-req" format="default" sectionFormat="of" derivedContent="Section 8.3"/> in order to protect a request sent to a single group member by using pairwise keying material (see <xref target="sec-derivation-pairwise" format="default" sectionFormat="of" derivedContent="Section 2.5"/>). This prevents the attack discussed above by construction, as only the intended server is able to derive the pairwise keying material used by the client to protect the request.</t>
        <t indent="0" pn="section-13.9-7">Before delivering to the application an incoming request protected in group mode that was sent over unicast, a server should carefully consider the impact that processing the request would have without dismissing the possibility that the request reception was in fact the result of the attack discussed above. This is especially important for endpoints implementing only a silent server since they do not support the pairwise mode and thus are able to process only requests protected in group mode. Application policies can also define specific exceptional cases where it is safe for a server to deliver such requests to the application, which can then take a final decision about whether acting on the request or not. For instance, such decision can leverage an application-level unique identifier of the server specified in the payload of the request.</t>
        <t indent="0" pn="section-13.9-8">In a group where the AEAD Algorithm and Pairwise Key Agreement Algorithm are set in the Security Context, an endpoint supporting the pairwise mode <bcp14>SHOULD</bcp14> use it to protect requests sent to a single group member over unicast. Using the group mode to protect such requests would make the request possible to decrypt and verify for any other group member; this may sometimes be a desired property (e.g., see <xref target="I-D.ietf-core-observe-multicast-notifications" format="default" sectionFormat="of" derivedContent="CoAP-MULT-NOTIF"/>).</t>
        <t indent="0" pn="section-13.9-9">The use of block-wise transfers <xref target="RFC7959" format="default" sectionFormat="of" derivedContent="RFC7959"/> with group communication for CoAP is as discussed in <xref section="3.8" sectionFormat="of" target="RFC10020" format="default" derivedLink="https://rfc-editor.org/rfc/rfc10020#section-3.8" derivedContent="RFC10020"/>. Note that, after the first request targeting all servers in the group over multicast, a client can switch to sending unicast requests for retrieving further blocks from the servers. In particular, after a first block-wise request that targets all servers in the group and includes the CoAP Block2 Option, the retrieval of further blocks can use unicast requests, which should therefore be protected using the pairwise mode. Similarly, if the first request that targeted all servers in the group did not include the CoAP Block2 Option and the corresponding responses included the Block2 Option at the servers' own initiative, then the retrieval of further blocks can use unicast requests, which should therefore be protected using the pairwise mode.</t>
        <t indent="0" pn="section-13.9-10">Additional considerations are discussed in <xref target="sec-synch-challenge-response" format="default" sectionFormat="of" derivedContent="Section 9"/> with respect to requests including a CoAP Echo Option <xref target="RFC9175" format="default" sectionFormat="of" derivedContent="RFC9175"/> that have to be sent over unicast, as employed in a challenge-response method for servers to achieve freshness or to initialize as valid a previously invalid Replay Window.</t>
      </section>
      <section anchor="ssec-e2e-protection" numbered="true" removeInRFC="false" toc="include" pn="section-13.10">
        <name slugifiedName="name-end-to-end-protection">End-to-End Protection</name>
        <t indent="0" pn="section-13.10-1">The same considerations from <xref section="12.1" sectionFormat="of" target="RFC8613" format="default" derivedLink="https://rfc-editor.org/rfc/rfc8613#section-12.1" derivedContent="RFC8613"/> apply for Group OSCORE.</t>
        <t indent="0" pn="section-13.10-2">Additionally, (D)TLS and Group OSCORE can be combined for protecting message exchanges occurring over unicast. However, it is not possible to combine (D)TLS and Group OSCORE for protecting message exchanges where messages are sent over multicast.</t>
      </section>
      <section anchor="ssec-master-secret" numbered="true" removeInRFC="false" toc="include" pn="section-13.11">
        <name slugifiedName="name-master-secret">Master Secret</name>
        <t indent="0" pn="section-13.11-1">Group OSCORE derives the Security Context using the same construction used by OSCORE and by using the Group Identifier of a group as the related ID Context. Hence, the same required properties of the Security Context parameters discussed in <xref section="3.3" sectionFormat="of" target="RFC8613" format="default" derivedLink="https://rfc-editor.org/rfc/rfc8613#section-3.3" derivedContent="RFC8613"/> apply for this document.</t>
        <t indent="0" pn="section-13.11-2">With particular reference to the OSCORE Master Secret, it has to be kept secret among the members of the respective OSCORE group and the Group Manager responsible for that group. Also, the Master Secret must have a good amount of randomness, and the Group Manager can generate it offline using a good random number generator. This includes the case where the Group Manager rekeys the group by generating and distributing a new Master Secret.</t>
      </section>
      <section anchor="ssec-replay-protection" numbered="true" removeInRFC="false" toc="include" pn="section-13.12">
        <name slugifiedName="name-replay-protection-2">Replay Protection</name>
        <t indent="0" pn="section-13.12-1">As in OSCORE <xref target="RFC8613" format="default" sectionFormat="of" derivedContent="RFC8613"/>, Group OSCORE relies on Sender Sequence Numbers included in the COSE message field 'Partial IV' and used to build nonces.</t>
        <t indent="0" pn="section-13.12-2">Note that the Partial IV of an endpoint does not necessarily grow monotonically. For instance, upon exhaustion of the endpoint's Sender Sequence Number space, the endpoint's Partial IV space also gets exhausted. As discussed in <xref target="sec-group-re-join" format="default" sectionFormat="of" derivedContent="Section 2.6.3"/>, this results in either the endpoint being individually rekeyed and getting a new Sender ID or the establishment of a new Security Context in the group. Therefore, uniqueness of (key, nonce) pairs (see <xref target="ssec-key-nonce-uniqueness" format="default" sectionFormat="of" derivedContent="Section 13.3"/>) is preserved when a new Security Context is established.</t>
        <t indent="0" pn="section-13.12-3">Since one-to-many communication such as multicast usually involves unreliable transports, the simplification of the Replay Window to a size of 1 suggested in <xref section="7.4" sectionFormat="of" target="RFC8613" format="default" derivedLink="https://rfc-editor.org/rfc/rfc8613#section-7.4" derivedContent="RFC8613"/> is not viable with Group OSCORE unless exchanges in the group rely only on unicast messages.</t>
        <t indent="0" pn="section-13.12-4">A server's Replay Window may be initialized as invalid (see <xref target="ssec-loss-mutable-context" format="default" sectionFormat="of" derivedContent="Section 2.6.1"/>). The server can either retrieve a new Group OSCORE Security Context or make a Replay Window valid (see <xref target="sec-synch-challenge-response" format="default" sectionFormat="of" derivedContent="Section 9"/>) before accepting further incoming messages from other group members.</t>
      </section>
      <section anchor="ssec-seccons-ordering" numbered="true" removeInRFC="false" toc="include" pn="section-13.13">
        <name slugifiedName="name-message-ordering">Message Ordering</name>
        <t indent="0" pn="section-13.13-1">Assuming that the other endpoint is honest, Group OSCORE provides relative ordering of received messages. For a given Group OSCORE Security Context, the received Partial IV (when included) allows the recipient endpoint to determine the order in which requests or responses were sent by the other endpoint.</t>
        <t indent="0" pn="section-13.13-2">If the Partial IV was omitted in a response, this indicates that it was the oldest response from the sender endpoint to the corresponding request (like notification responses in OSCORE, see <xref section="7.4.1" sectionFormat="of" target="RFC8613" format="default" derivedLink="https://rfc-editor.org/rfc/rfc8613#section-7.4.1" derivedContent="RFC8613"/>). A received response is not older than the corresponding request.</t>
      </section>
      <section anchor="ssec-seccons-freshness" numbered="true" removeInRFC="false" toc="include" pn="section-13.14">
        <name slugifiedName="name-message-freshness">Message Freshness</name>
        <t indent="0" pn="section-13.14-1">As in OSCORE, Group OSCORE provides only the guarantee that the request is not older than the Group OSCORE Security Context used to protect it. Other aspects of freshness are discussed in <xref target="sec-freshness" format="default" sectionFormat="of" derivedContent="Section 5.2"/>.</t>
        <t indent="0" pn="section-13.14-2">The challenge-response approach described in <xref target="sec-synch-challenge-response" format="default" sectionFormat="of" derivedContent="Section 9"/> provides an assurance of freshness of the request without depending on the honesty of the client. However, it can result in an impact on performance, which is undesirable or unbearable especially in large groups where many endpoints at the same time might join as new members.</t>
        <t indent="0" pn="section-13.14-3">Endpoints configured as silent servers are not able to perform the challenge-response described above, as they do not store a Sender Context to protect the 4.01 (Unauthorized) response to the client. Thus, silent servers should adopt alternative approaches to make their Replay Windows valid. For example, a silent server can retrieve or wait for new Security Context parameters from the Group Manager and derive new Recipient Contexts. When doing so, the Replay Windows of all Recipient Contexts become valid if they are not already. In particular, any invalid Replay Window is re-initialized as valid and with 0 as its current lower limit.</t>
        <t indent="0" pn="section-13.14-4">Since requests including the Echo Option are sent over unicast, a server can be the victim of the attack discussed in <xref target="ssec-unicast-requests" format="default" sectionFormat="of" derivedContent="Section 13.9"/> if such requests are protected in group mode. Instead, protecting those requests with the pairwise mode prevents the attack above. In fact, only the server involved in the challenge-response exchange is able to derive the pairwise key used by the client to protect the request including the Echo Option.</t>
        <t indent="0" pn="section-13.14-5">In either case, an internal on-path adversary would not be able to transpose the Echo Option value of two different unicast requests sent by the same client to any two different servers in the group. In fact, even if the group mode was used, this would require the adversary to forge the countersignature of both requests. As a consequence, each of the two servers remains able to selectively accept a request with the Echo Option only if it is waiting for that exact integrity-protected Echo Option value, and is thus the intended recipient.</t>
      </section>
      <section anchor="ssec-client-aliveness" numbered="true" removeInRFC="false" toc="include" pn="section-13.15">
        <name slugifiedName="name-client-aliveness">Client Aliveness</name>
        <t indent="0" pn="section-13.15-1">Like in OSCORE (see <xref section="12.5" sectionFormat="of" target="RFC8613" format="default" derivedLink="https://rfc-editor.org/rfc/rfc8613#section-12.5" derivedContent="RFC8613"/>), a server may verify the aliveness of the client by using the CoAP Echo Option <xref target="RFC9175" format="default" sectionFormat="of" derivedContent="RFC9175"/> as described in <xref target="sec-synch-challenge-response" format="default" sectionFormat="of" derivedContent="Section 9"/>.</t>
        <t indent="0" pn="section-13.15-2">In the interest of avoiding otherwise unnecessary uses of such an approach, the server can exploit the fact that the received request cannot be older than the Security Context used to protect it. This effectively allows the server to verify the client aliveness relative to the installation of the latest group keying material.</t>
      </section>
      <section anchor="ssec-crypto-considerations" numbered="true" removeInRFC="false" toc="include" pn="section-13.16">
        <name slugifiedName="name-cryptographic-consideration">Cryptographic Considerations</name>
        <t indent="0" pn="section-13.16-1">The same considerations from <xref section="12.6" sectionFormat="of" target="RFC8613" format="default" derivedLink="https://rfc-editor.org/rfc/rfc8613#section-12.6" derivedContent="RFC8613"/> about the maximum Sender Sequence Number apply for Group OSCORE.</t>
        <t indent="0" pn="section-13.16-2">As discussed in <xref target="ssec-wrap-around-partial-iv" format="default" sectionFormat="of" derivedContent="Section 2.6.2"/>, an endpoint that experiences an exhaustion of its own Sender Sequence Number space <bcp14>MUST NOT</bcp14> protect further messages including a Partial IV, until it has derived a new Sender Context. This prevents the endpoint from reusing the same nonce with the same encryption key.</t>
        <t indent="0" pn="section-13.16-3">In order to renew its own Sender Context, the endpoint <bcp14>SHOULD</bcp14> inform the Group Manager, which can either renew the whole Security Context by means of group rekeying or provide only that endpoint with a new Sender ID value. In either case, the endpoint derives a new Sender Context, particularly a new Sender Key.</t>
        <t indent="0" pn="section-13.16-4">Additionally, the same considerations from <xref section="12.6" sectionFormat="of" target="RFC8613" format="default" derivedLink="https://rfc-editor.org/rfc/rfc8613#section-12.6" derivedContent="RFC8613"/> apply for Group OSCORE about building the nonce and the secrecy of the Security Context parameters.</t>
        <t indent="0" pn="section-13.16-5">The group mode uses the "encrypt-then-sign" construction, i.e., the countersignature is computed over the COSE_Encrypt0 object (see <xref target="sec-cose-object-unprotected-field" format="default" sectionFormat="of" derivedContent="Section 3.1"/>). This is motivated by enabling signature checkers (see <xref target="sec-additional-entities" format="default" sectionFormat="of" derivedContent="Section 12.3"/>), which do not join a group as members but are allowed to verify countersignatures of messages protected in group mode without being able to decrypt those messages (see <xref target="sec-processing-signature-checker" format="default" sectionFormat="of" derivedContent="Section 7.5"/>).</t>
        <t indent="0" pn="section-13.16-6">If the Group Encryption Algorithm used in group mode provides integrity protection, countersignatures of COSE_Encrypt0 with short authentication tags do not provide the security properties associated with the same algorithm used in COSE_Sign (see <xref section="6" sectionFormat="of" target="RFC9338" format="default" derivedLink="https://rfc-editor.org/rfc/rfc9338#section-6" derivedContent="RFC9338"/>). To provide 128-bit security against collision attacks, the tag length <bcp14>MUST</bcp14> be at least 256 bits. A countersignature of a COSE_Encrypt0 with AES-CCM-16-64-128 provides at most 32 bits of integrity protection.</t>
        <t indent="0" pn="section-13.16-7">The derivation of pairwise keys defined in <xref target="key-derivation-pairwise" format="default" sectionFormat="of" derivedContent="Section 2.5.1"/> is compatible with ECDSA and EdDSA asymmetric keys, but is not compatible with RSA asymmetric keys.</t>
        <t indent="0" pn="section-13.16-8">For the public key translation from Ed25519 (Ed448) to X25519 (X448) specified in <xref target="key-derivation-pairwise" format="default" sectionFormat="of" derivedContent="Section 2.5.1"/>, variable time methods can be used since the translation operates on public information. Any byte string of appropriate length is accepted as a public key for X25519 (X448) in <xref target="RFC7748" format="default" sectionFormat="of" derivedContent="RFC7748"/>. It is therefore not necessary for security to validate the translated public key (assuming the translation was successful).</t>
        <t indent="0" pn="section-13.16-9">The security of using the same key pair for Diffie-Hellman and for signing (by considering the ECDH procedure in <xref target="sec-derivation-pairwise" format="default" sectionFormat="of" derivedContent="Section 2.5"/> as a Key Encapsulation Mechanism (KEM)) is demonstrated in <xref target="Degabriele" format="default" sectionFormat="of" derivedContent="Degabriele"/> and <xref target="Thormarker" format="default" sectionFormat="of" derivedContent="Thormarker"/>.</t>
        <t indent="0" pn="section-13.16-10">Except when using X25519 and X448, applications that use the ECDH-based KEM in <xref target="sec-derivation-pairwise" format="default" sectionFormat="of" derivedContent="Section 2.5"/> are assumed to verify that a peer endpoint's public key is on the expected curve and that the shared secret is not the point at infinity. The KEM in <xref target="Degabriele" format="default" sectionFormat="of" derivedContent="Degabriele"/> checks that the shared secret is different from the point at infinity, as does the procedure in Section 5.7.1.2 of <xref target="NIST-800-56A" format="default" sectionFormat="of" derivedContent="NIST-800-56A"/>, which is referenced in <xref target="key-derivation-pairwise" format="default" sectionFormat="of" derivedContent="Section 2.5.1"/>.</t>
        <t indent="0" pn="section-13.16-11">By extending Theorem 2 of <xref target="Degabriele" format="default" sectionFormat="of" derivedContent="Degabriele"/>, <xref target="Thormarker" format="default" sectionFormat="of" derivedContent="Thormarker"/> shows that the same key pair can be used with X25519 and Ed25519 (X448 and Ed448) for the KEM specified in <xref target="sec-derivation-pairwise" format="default" sectionFormat="of" derivedContent="Section 2.5"/>. By symmetry in the KEM used in this document, both endpoints can consider themselves to have the recipient role in the KEM -- as discussed in Section 7 of <xref target="Thormarker" format="default" sectionFormat="of" derivedContent="Thormarker"/> -- and rely on the mentioned proofs for the security of their key pairs.</t>
        <t indent="0" pn="section-13.16-12">Theorem 3 in <xref target="Degabriele" format="default" sectionFormat="of" derivedContent="Degabriele"/> shows that the same key pair can be used for an ECDH-based KEM and ECDSA. The KEM uses a different Key Derivation Function (KDF) than in <xref target="sec-derivation-pairwise" format="default" sectionFormat="of" derivedContent="Section 2.5"/>, but the proof only depends on that the KDF has certain required properties, which are the typical assumptions about HKDF, e.g., that output keys are pseudorandom. In order to comply with the assumptions of Theorem 3, received public keys <bcp14>MUST</bcp14> be successfully validated; see Section 5.6.2.3.4 of <xref target="NIST-800-56A" format="default" sectionFormat="of" derivedContent="NIST-800-56A"/>. The validation <bcp14>MAY</bcp14> be performed by a trusted Group Manager. For <xref target="Degabriele" format="default" sectionFormat="of" derivedContent="Degabriele"/> to apply as it is written, public keys need to be in the expected subgroup. For this, we rely on cofactor Diffie-Hellman as per Section 5.7.1.2 of <xref target="NIST-800-56A" format="default" sectionFormat="of" derivedContent="NIST-800-56A"/>, which is referenced in <xref target="key-derivation-pairwise" format="default" sectionFormat="of" derivedContent="Section 2.5.1"/>.</t>
        <t indent="0" pn="section-13.16-13">HashEdDSA variants of Ed25519 and Ed448 are not used by COSE (see <xref section="2.2" sectionFormat="of" target="RFC9053" format="default" derivedLink="https://rfc-editor.org/rfc/rfc9053#section-2.2" derivedContent="RFC9053"/>) and are not covered by the analysis in <xref target="Thormarker" format="default" sectionFormat="of" derivedContent="Thormarker"/>. Hence, they <bcp14>MUST NOT</bcp14> be used with the public keys used to derive pairwise keys as specified in this document.</t>
      </section>
      <section anchor="ssec-message-segmentation" numbered="true" removeInRFC="false" toc="include" pn="section-13.17">
        <name slugifiedName="name-message-segmentation">Message Segmentation</name>
        <t indent="0" pn="section-13.17-1">The same considerations from <xref section="12.7" sectionFormat="of" target="RFC8613" format="default" derivedLink="https://rfc-editor.org/rfc/rfc8613#section-12.7" derivedContent="RFC8613"/> apply for Group OSCORE.</t>
      </section>
      <section anchor="ssec-privacy" numbered="true" removeInRFC="false" toc="include" pn="section-13.18">
        <name slugifiedName="name-privacy-considerations">Privacy Considerations</name>
        <t indent="0" pn="section-13.18-1">Group OSCORE ensures end-to-end integrity protection and encryption of the message payload and of all the CoAP options that are not used for proxy operations. In particular, CoAP options are processed according to the same class U/I/E that they have for OSCORE. Therefore, the same privacy considerations from <xref section="12.8" sectionFormat="of" target="RFC8613" format="default" derivedLink="https://rfc-editor.org/rfc/rfc8613#section-12.8" derivedContent="RFC8613"/> apply for Group OSCORE, with the following addition.</t>
        <ul spacing="normal" bare="false" empty="false" indent="3" pn="section-13.18-2">
          <li pn="section-13.18-2.1">
            <t indent="0" pn="section-13.18-2.1.1">When protecting a message in group mode, the countersignature is encrypted by using a keystream derived from the group keying material (see Sections <xref target="compression-details" format="counter" sectionFormat="of" derivedContent="4.1"/> and <xref target="sssec-encrypted-signature-keystream" format="counter" sectionFormat="of" derivedContent="4.2"/>). This ensures group privacy. That is, an attacker cannot track an endpoint over two groups by linking messages between the two groups, unless the attacker is also a member of those groups.</t>
          </li>
        </ul>
        <t indent="0" pn="section-13.18-3">Furthermore, the following privacy considerations apply about the OSCORE Option, which may reveal information on the communicating endpoints.</t>
        <ul spacing="normal" bare="false" empty="false" indent="3" pn="section-13.18-4">
          <li pn="section-13.18-4.1">
            <t indent="0" pn="section-13.18-4.1.1">The 'kid' parameter, which is intended to help a recipient endpoint to find the right Recipient Context, may reveal information about the Sender Endpoint. When both a request and the corresponding responses include the 'kid' parameter, this may reveal information about both a client sending a request and all the possibly replying servers sending their own individual response.</t>
          </li>
          <li pn="section-13.18-4.2">
            <t indent="0" pn="section-13.18-4.2.1">The 'kid context' parameter, which is intended to help a recipient endpoint to find the right Security Context, reveals information about the sender endpoint. In particular, it reveals that the sender endpoint is a member of a particular OSCORE group, whose current GID is indicated in the 'kid context' parameter.</t>
          </li>
        </ul>
        <t indent="0" pn="section-13.18-5">When receiving a group request, each of the recipient endpoints can reply with a response that includes its Sender ID as the value of the 'kid' parameter. All these responses will be matchable with the request through the CoAP Token. Thus, even if these responses do not include a 'kid context' parameter, it becomes possible to understand that the responder endpoints are in the same group of the requester endpoint.</t>
        <t indent="0" pn="section-13.18-6">Furthermore, using the approach described in <xref target="sec-synch-challenge-response" format="default" sectionFormat="of" derivedContent="Section 9"/> to make Replay Windows valid may reveal when a server device goes through a reboot. This can be mitigated by the server device storing the precise state of the Replay Window of each known client on a clean shutdown.</t>
        <t indent="0" pn="section-13.18-7">Finally, the approach described in <xref target="ssec-gid-collision" format="default" sectionFormat="of" derivedContent="Section 13.6"/> to prevent collisions of Group Identifiers from different Group Managers may reveal information about events in the respective OSCORE groups. In particular, a Group Identifier changes when the corresponding group is rekeyed. Thus, Group Managers might use the shared list of Group Identifiers to infer the rate and patterns of group membership changes triggering a group rekeying, e.g., due to newly joined members or evicted (compromised) members. In order to alleviate this privacy concern, it should be hidden from the Group Managers which exact Group Manager has currently assigned which Group Identifiers in its OSCORE groups.</t>
      </section>
    </section>
    <section anchor="iana" numbered="true" removeInRFC="false" toc="include" pn="section-14">
      <name slugifiedName="name-iana-considerations">IANA Considerations</name>
      <t indent="0" pn="section-14-1">IANA has performed the actions described below.</t>
      <section anchor="iana-cons-flag-bits" numbered="true" removeInRFC="false" toc="include" pn="section-14.1">
        <name slugifiedName="name-oscore-flag-bits-registry">OSCORE Flag Bits Registry</name>
        <t indent="0" pn="section-14.1-1">IANA has added the following entry to the "OSCORE Flag Bits" registry within the "Constrained RESTful Environments (CoRE) Parameters" registry group:</t>
        <table align="center" anchor="_table-iana-oscore-flag-bits" pn="table-1">
          <name slugifiedName="name-oscore-flag-bits-registry-2">OSCORE Flag Bits Registry</name>
          <thead>
            <tr>
              <th align="left" colspan="1" rowspan="1">Bit Position</th>
              <th align="left" colspan="1" rowspan="1">Name</th>
              <th align="left" colspan="1" rowspan="1">Description</th>
              <th align="left" colspan="1" rowspan="1">Reference</th>
            </tr>
          </thead>
          <tbody>
            <tr>
              <td align="left" colspan="1" rowspan="1">2</td>
              <td align="left" colspan="1" rowspan="1">Group Flag</td>
              <td align="left" colspan="1" rowspan="1">For using a Group OSCORE Security Context, set to 1 if the message is protected with the group mode</td>
              <td align="left" colspan="1" rowspan="1">RFC 10021</td>
            </tr>
          </tbody>
        </table>
      </section>
      <section anchor="iana-target-attributes" numbered="true" removeInRFC="false" toc="include" pn="section-14.2">
        <name slugifiedName="name-target-attributes-registry">Target Attributes Registry</name>
        <t indent="0" pn="section-14.2-1">IANA has added the following entry to the "Target Attributes" registry within the "Constrained RESTful Environments (CoRE) Parameters" registry group:</t>
        <table align="center" anchor="_table-iana-target-attributes" pn="table-2">
          <name slugifiedName="name-target-attributes-registry-2">Target Attributes Registry</name>
          <thead>
            <tr>
              <th align="left" colspan="1" rowspan="1">Attribute Name</th>
              <th align="left" colspan="1" rowspan="1">Brief Description</th>
              <th align="left" colspan="1" rowspan="1">Change Controller</th>
              <th align="left" colspan="1" rowspan="1">Reference</th>
            </tr>
          </thead>
          <tbody>
            <tr>
              <td align="left" colspan="1" rowspan="1">gosc</td>
              <td align="left" colspan="1" rowspan="1">Hint: resource only accessible using Group OSCORE or OSCORE</td>
              <td align="left" colspan="1" rowspan="1">IETF</td>
              <td align="left" colspan="1" rowspan="1">RFC 10021, <xref target="web-linking" format="default" sectionFormat="of" derivedContent="Section 11"/></td>
            </tr>
          </tbody>
        </table>
      </section>
    </section>
  </middle>
  <back>
    <displayreference target="I-D.ietf-ace-key-groupcomm-oscore" to="ACE-KEY-GROUP-OSCORE"/>
    <displayreference target="I-D.ietf-iotops-security-protocol-comparison" to="CoAP-SEC-PROT"/>
    <displayreference target="I-D.ietf-core-observe-multicast-notifications" to="CoAP-MULT-NOTIF"/>
    <displayreference target="I-D.ietf-lwig-curve-representations" to="CURVE-REPR"/>
    <displayreference target="I-D.ietf-cose-cbor-encoded-cert" to="C509-CERT"/>
    <displayreference target="I-D.ietf-core-oscore-capable-proxies" to="OSCORE-PROXIES"/>
    <displayreference target="I-D.ietf-core-groupcomm-proxy" to="CoAP-GROUP-PROXY"/>
    <displayreference target="I-D.irtf-cfrg-det-sigs-with-noise" to="SIGS-WITH-NOISE"/>
    <displayreference target="I-D.ietf-core-cacheable-oscore" to="CACHEABLE-OSCORE"/>
    <references anchor="sec-combined-references" pn="section-15">
      <name slugifiedName="name-references">References</name>
      <references anchor="sec-normative-references" pn="section-15.1">
        <name slugifiedName="name-normative-references">Normative References</name>
        <reference anchor="COSE.Algorithms" target="https://www.iana.org/assignments/cose" quoteTitle="true" derivedAnchor="COSE.Algorithms">
          <front>
            <title>COSE Algorithms</title>
            <author>
              <organization showOnFrontPage="true">IANA</organization>
            </author>
            <date/>
          </front>
        </reference>
        <reference anchor="NIST-800-56A" target="https://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-56Ar3.pdf" quoteTitle="true" derivedAnchor="NIST-800-56A">
          <front>
            <title>Recommendation for Pair-Wise Key-Establishment Schemes Using Discrete Logarithm Cryptography</title>
            <author initials="E." surname="Barker" fullname="Elaine Barker">
              <organization showOnFrontPage="true"/>
            </author>
            <author initials="L." surname="Chen" fullname="Lily Chen">
              <organization showOnFrontPage="true"/>
            </author>
            <author initials="A." surname="Roginsky" fullname="Allen Roginsky">
              <organization showOnFrontPage="true"/>
            </author>
            <author initials="A." surname="Vassilev" fullname="Apostol Vassilev">
              <organization showOnFrontPage="true"/>
            </author>
            <author initials="R." surname="Davis" fullname="Richard Davis">
              <organization showOnFrontPage="true"/>
            </author>
            <date year="2018" month="April"/>
          </front>
          <seriesInfo name="NIST" value="SP 800-56Ar3"/>
          <seriesInfo name="DOI" value="10.6028/NIST.SP.800-56Ar3"/>
          <refcontent>National Institute of Standards and Technology</refcontent>
        </reference>
        <reference anchor="RFC2119" target="https://www.rfc-editor.org/info/rfc2119" quoteTitle="true" derivedAnchor="RFC2119">
          <front>
            <title>Key words for use in RFCs to Indicate Requirement Levels</title>
            <author fullname="S. Bradner" initials="S." surname="Bradner"/>
            <date month="March" year="1997"/>
            <abstract>
              <t indent="0">In many standards track documents several words are used to signify the requirements in the specification. These words are often capitalized. This document defines these words as they should be interpreted in IETF documents. This document specifies an Internet Best Current Practices for the Internet Community, and requests discussion and suggestions for improvements.</t>
            </abstract>
          </front>
          <seriesInfo name="BCP" value="14"/>
          <seriesInfo name="RFC" value="2119"/>
          <seriesInfo name="DOI" value="10.17487/RFC2119"/>
        </reference>
        <reference anchor="RFC5869" target="https://www.rfc-editor.org/info/rfc5869" quoteTitle="true" derivedAnchor="RFC5869">
          <front>
            <title>HMAC-based Extract-and-Expand Key Derivation Function (HKDF)</title>
            <author fullname="H. Krawczyk" initials="H." surname="Krawczyk"/>
            <author fullname="P. Eronen" initials="P." surname="Eronen"/>
            <date month="May" year="2010"/>
            <abstract>
              <t indent="0">This document specifies a simple Hashed Message Authentication Code (HMAC)-based key derivation function (HKDF), which can be used as a building block in various protocols and applications. The key derivation function (KDF) is intended to support a wide range of applications and requirements, and is conservative in its use of cryptographic hash functions. This document is not an Internet Standards Track specification; it is published for informational purposes.</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="5869"/>
          <seriesInfo name="DOI" value="10.17487/RFC5869"/>
        </reference>
        <reference anchor="RFC6979" target="https://www.rfc-editor.org/info/rfc6979" quoteTitle="true" derivedAnchor="RFC6979">
          <front>
            <title>Deterministic Usage of the Digital Signature Algorithm (DSA) and Elliptic Curve Digital Signature Algorithm (ECDSA)</title>
            <author fullname="T. Pornin" initials="T." surname="Pornin"/>
            <date month="August" year="2013"/>
            <abstract>
              <t indent="0">This document defines a deterministic digital signature generation procedure. Such signatures are compatible with standard Digital Signature Algorithm (DSA) and Elliptic Curve Digital Signature Algorithm (ECDSA) digital signatures and can be processed with unmodified verifiers, which need not be aware of the procedure described therein. Deterministic signatures retain the cryptographic security features associated with digital signatures but can be more easily implemented in various environments, since they do not need access to a source of high-quality randomness.</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="6979"/>
          <seriesInfo name="DOI" value="10.17487/RFC6979"/>
        </reference>
        <reference anchor="RFC7252" target="https://www.rfc-editor.org/info/rfc7252" quoteTitle="true" derivedAnchor="RFC7252">
          <front>
            <title>The Constrained Application Protocol (CoAP)</title>
            <author fullname="Z. Shelby" initials="Z." surname="Shelby"/>
            <author fullname="K. Hartke" initials="K." surname="Hartke"/>
            <author fullname="C. Bormann" initials="C." surname="Bormann"/>
            <date month="June" year="2014"/>
            <abstract>
              <t indent="0">The Constrained Application Protocol (CoAP) is a specialized web transfer protocol for use with constrained nodes and constrained (e.g., low-power, lossy) networks. The nodes often have 8-bit microcontrollers with small amounts of ROM and RAM, while constrained networks such as IPv6 over Low-Power Wireless Personal Area Networks (6LoWPANs) often have high packet error rates and a typical throughput of 10s of kbit/s. The protocol is designed for machine- to-machine (M2M) applications such as smart energy and building automation.</t>
              <t indent="0">CoAP provides a request/response interaction model between application endpoints, supports built-in discovery of services and resources, and includes key concepts of the Web such as URIs and Internet media types. CoAP is designed to easily interface with HTTP for integration with the Web while meeting specialized requirements such as multicast support, very low overhead, and simplicity for constrained environments.</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="7252"/>
          <seriesInfo name="DOI" value="10.17487/RFC7252"/>
        </reference>
        <reference anchor="RFC7641" target="https://www.rfc-editor.org/info/rfc7641" quoteTitle="true" derivedAnchor="RFC7641">
          <front>
            <title>Observing Resources in the Constrained Application Protocol (CoAP)</title>
            <author fullname="K. Hartke" initials="K." surname="Hartke"/>
            <date month="September" year="2015"/>
            <abstract>
              <t indent="0">The Constrained Application Protocol (CoAP) is a RESTful application protocol for constrained nodes and networks. The state of a resource on a CoAP server can change over time. This document specifies a simple protocol extension for CoAP that enables CoAP clients to "observe" resources, i.e., to retrieve a representation of a resource and keep this representation updated by the server over a period of time. The protocol follows a best-effort approach for sending new representations to clients and provides eventual consistency between the state observed by each client and the actual resource state at the server.</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="7641"/>
          <seriesInfo name="DOI" value="10.17487/RFC7641"/>
        </reference>
        <reference anchor="RFC7748" target="https://www.rfc-editor.org/info/rfc7748" quoteTitle="true" derivedAnchor="RFC7748">
          <front>
            <title>Elliptic Curves for Security</title>
            <author fullname="A. Langley" initials="A." surname="Langley"/>
            <author fullname="M. Hamburg" initials="M." surname="Hamburg"/>
            <author fullname="S. Turner" initials="S." surname="Turner"/>
            <date month="January" year="2016"/>
            <abstract>
              <t indent="0">This memo specifies two elliptic curves over prime fields that offer a high level of practical security in cryptographic applications, including Transport Layer Security (TLS). These curves are intended to operate at the ~128-bit and ~224-bit security level, respectively, and are generated deterministically based on a list of required properties.</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="7748"/>
          <seriesInfo name="DOI" value="10.17487/RFC7748"/>
        </reference>
        <reference anchor="RFC8032" target="https://www.rfc-editor.org/info/rfc8032" quoteTitle="true" derivedAnchor="RFC8032">
          <front>
            <title>Edwards-Curve Digital Signature Algorithm (EdDSA)</title>
            <author fullname="S. Josefsson" initials="S." surname="Josefsson"/>
            <author fullname="I. Liusvaara" initials="I." surname="Liusvaara"/>
            <date month="January" year="2017"/>
            <abstract>
              <t indent="0">This document describes elliptic curve signature scheme Edwards-curve Digital Signature Algorithm (EdDSA). The algorithm is instantiated with recommended parameters for the edwards25519 and edwards448 curves. An example implementation and test vectors are provided.</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="8032"/>
          <seriesInfo name="DOI" value="10.17487/RFC8032"/>
        </reference>
        <reference anchor="RFC8174" target="https://www.rfc-editor.org/info/rfc8174" quoteTitle="true" derivedAnchor="RFC8174">
          <front>
            <title>Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words</title>
            <author fullname="B. Leiba" initials="B." surname="Leiba"/>
            <date month="May" year="2017"/>
            <abstract>
              <t indent="0">RFC 2119 specifies common key words that may be used in protocol specifications. This document aims to reduce the ambiguity by clarifying that only UPPERCASE usage of the key words have the defined special meanings.</t>
            </abstract>
          </front>
          <seriesInfo name="BCP" value="14"/>
          <seriesInfo name="RFC" value="8174"/>
          <seriesInfo name="DOI" value="10.17487/RFC8174"/>
        </reference>
        <reference anchor="RFC8288" target="https://www.rfc-editor.org/info/rfc8288" quoteTitle="true" derivedAnchor="RFC8288">
          <front>
            <title>Web Linking</title>
            <author fullname="M. Nottingham" initials="M." surname="Nottingham"/>
            <date month="October" year="2017"/>
            <abstract>
              <t indent="0">This specification defines a model for the relationships between resources on the Web ("links") and the type of those relationships ("link relation types").</t>
              <t indent="0">It also defines the serialisation of such links in HTTP headers with the Link header field.</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="8288"/>
          <seriesInfo name="DOI" value="10.17487/RFC8288"/>
        </reference>
        <reference anchor="RFC8610" target="https://www.rfc-editor.org/info/rfc8610" quoteTitle="true" derivedAnchor="RFC8610">
          <front>
            <title>Concise Data Definition Language (CDDL): A Notational Convention to Express Concise Binary Object Representation (CBOR) and JSON Data Structures</title>
            <author fullname="H. Birkholz" initials="H." surname="Birkholz"/>
            <author fullname="C. Vigano" initials="C." surname="Vigano"/>
            <author fullname="C. Bormann" initials="C." surname="Bormann"/>
            <date month="June" year="2019"/>
            <abstract>
              <t indent="0">This document proposes a notational convention to express Concise Binary Object Representation (CBOR) data structures (RFC 7049). Its main goal is to provide an easy and unambiguous way to express structures for protocol messages and data formats that use CBOR or JSON.</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="8610"/>
          <seriesInfo name="DOI" value="10.17487/RFC8610"/>
        </reference>
        <reference anchor="RFC8613" target="https://www.rfc-editor.org/info/rfc8613" quoteTitle="true" derivedAnchor="RFC8613">
          <front>
            <title>Object Security for Constrained RESTful Environments (OSCORE)</title>
            <author fullname="G. Selander" initials="G." surname="Selander"/>
            <author fullname="J. Mattsson" initials="J." surname="Mattsson"/>
            <author fullname="F. Palombini" initials="F." surname="Palombini"/>
            <author fullname="L. Seitz" initials="L." surname="Seitz"/>
            <date month="July" year="2019"/>
            <abstract>
              <t indent="0">This document defines Object Security for Constrained RESTful Environments (OSCORE), a method for application-layer protection of the Constrained Application Protocol (CoAP), using CBOR Object Signing and Encryption (COSE). OSCORE provides end-to-end protection between endpoints communicating using CoAP or CoAP-mappable HTTP. OSCORE is designed for constrained nodes and networks supporting a range of proxy operations, including translation between different transport protocols.</t>
              <t indent="0">Although an optional functionality of CoAP, OSCORE alters CoAP options processing and IANA registration. Therefore, this document updates RFC 7252.</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="8613"/>
          <seriesInfo name="DOI" value="10.17487/RFC8613"/>
        </reference>
        <reference anchor="RFC8949" target="https://www.rfc-editor.org/info/rfc8949" quoteTitle="true" derivedAnchor="RFC8949">
          <front>
            <title>Concise Binary Object Representation (CBOR)</title>
            <author fullname="C. Bormann" initials="C." surname="Bormann"/>
            <author fullname="P. Hoffman" initials="P." surname="Hoffman"/>
            <date month="December" year="2020"/>
            <abstract>
              <t indent="0">The Concise Binary Object Representation (CBOR) is a data format whose design goals include the possibility of extremely small code size, fairly small message size, and extensibility without the need for version negotiation. These design goals make it different from earlier binary serializations such as ASN.1 and MessagePack.</t>
              <t indent="0">This document obsoletes RFC 7049, providing editorial improvements, new details, and errata fixes while keeping full compatibility with the interchange format of RFC 7049. It does not create a new version of the format.</t>
            </abstract>
          </front>
          <seriesInfo name="STD" value="94"/>
          <seriesInfo name="RFC" value="8949"/>
          <seriesInfo name="DOI" value="10.17487/RFC8949"/>
        </reference>
        <reference anchor="RFC9052" target="https://www.rfc-editor.org/info/rfc9052" quoteTitle="true" derivedAnchor="RFC9052">
          <front>
            <title>CBOR Object Signing and Encryption (COSE): Structures and Process</title>
            <author fullname="J. Schaad" initials="J." surname="Schaad"/>
            <date month="August" year="2022"/>
            <abstract>
              <t indent="0">Concise Binary Object Representation (CBOR) is a data format designed for small code size and small message size. There is a need to be able to define basic security services for this data format. This document defines the CBOR Object Signing and Encryption (COSE) protocol. This specification describes how to create and process signatures, message authentication codes, and encryption using CBOR for serialization. This specification additionally describes how to represent cryptographic keys using CBOR.</t>
              <t indent="0">This document, along with RFC 9053, obsoletes RFC 8152.</t>
            </abstract>
          </front>
          <seriesInfo name="STD" value="96"/>
          <seriesInfo name="RFC" value="9052"/>
          <seriesInfo name="DOI" value="10.17487/RFC9052"/>
        </reference>
        <reference anchor="RFC9053" target="https://www.rfc-editor.org/info/rfc9053" quoteTitle="true" derivedAnchor="RFC9053">
          <front>
            <title>CBOR Object Signing and Encryption (COSE): Initial Algorithms</title>
            <author fullname="J. Schaad" initials="J." surname="Schaad"/>
            <date month="August" year="2022"/>
            <abstract>
              <t indent="0">Concise Binary Object Representation (CBOR) is a data format designed for small code size and small message size. There is a need to be able to define basic security services for this data format. This document defines a set of algorithms that can be used with the CBOR Object Signing and Encryption (COSE) protocol (RFC 9052).</t>
              <t indent="0">This document, along with RFC 9052, obsoletes RFC 8152.</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="9053"/>
          <seriesInfo name="DOI" value="10.17487/RFC9053"/>
        </reference>
        <reference anchor="RFC9175" target="https://www.rfc-editor.org/info/rfc9175" quoteTitle="true" derivedAnchor="RFC9175">
          <front>
            <title>Constrained Application Protocol (CoAP): Echo, Request-Tag, and Token Processing</title>
            <author fullname="C. Amsüss" initials="C." surname="Amsüss"/>
            <author fullname="J. Preuß Mattsson" initials="J." surname="Preuß Mattsson"/>
            <author fullname="G. Selander" initials="G." surname="Selander"/>
            <date month="February" year="2022"/>
            <abstract>
              <t indent="0">This document specifies enhancements to the Constrained Application Protocol (CoAP) that mitigate security issues in particular use cases. The Echo option enables a CoAP server to verify the freshness of a request or to force a client to demonstrate reachability at its claimed network address. The Request-Tag option allows the CoAP server to match block-wise message fragments belonging to the same request. This document updates RFC 7252 with respect to the following: processing requirements for client Tokens, forbidding non-secure reuse of Tokens to ensure response-to-request binding when CoAP is used with a security protocol, and amplification mitigation (where the use of the Echo option is now recommended).</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="9175"/>
          <seriesInfo name="DOI" value="10.17487/RFC9175"/>
        </reference>
        <reference anchor="RFC9338" target="https://www.rfc-editor.org/info/rfc9338" quoteTitle="true" derivedAnchor="RFC9338">
          <front>
            <title>CBOR Object Signing and Encryption (COSE): Countersignatures</title>
            <author fullname="J. Schaad" initials="J." surname="Schaad"/>
            <date month="December" year="2022"/>
            <abstract>
              <t indent="0">Concise Binary Object Representation (CBOR) is a data format designed for small code size and small message size. CBOR Object Signing and Encryption (COSE) defines a set of security services for CBOR. This document defines a countersignature algorithm along with the needed header parameters and CBOR tags for COSE. This document updates RFC 9052.</t>
            </abstract>
          </front>
          <seriesInfo name="STD" value="96"/>
          <seriesInfo name="RFC" value="9338"/>
          <seriesInfo name="DOI" value="10.17487/RFC9338"/>
        </reference>
        <reference anchor="RFC9459" target="https://www.rfc-editor.org/info/rfc9459" quoteTitle="true" derivedAnchor="RFC9459">
          <front>
            <title>CBOR Object Signing and Encryption (COSE): AES-CTR and AES-CBC</title>
            <author fullname="R. Housley" initials="R." surname="Housley"/>
            <author fullname="H. Tschofenig" initials="H." surname="Tschofenig"/>
            <date month="September" year="2023"/>
            <abstract>
              <t indent="0">The Concise Binary Object Representation (CBOR) data format is designed for small code size and small message size. CBOR Object Signing and Encryption (COSE) is specified in RFC 9052 to provide basic security services using the CBOR data format. This document specifies the conventions for using AES-CTR and AES-CBC as content encryption algorithms with COSE.</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="9459"/>
          <seriesInfo name="DOI" value="10.17487/RFC9459"/>
        </reference>
        <reference anchor="RFC10020" target="https://www.rfc-editor.org/info/rfc10020" quoteTitle="true" derivedAnchor="RFC10020">
          <front>
            <title>Group Communication for the Constrained Application Protocol (CoAP)</title>
            <author initials="E." surname="Dijk" fullname="Esko Dijk">
              <organization showOnFrontPage="true">IoTconsultancy.nl</organization>
            </author>
            <author initials="M." surname="Tiloca" fullname="Marco Tiloca">
              <organization showOnFrontPage="true">RISE AB</organization>
            </author>
            <date year="2026" month="November"/>
          </front>
          <seriesInfo name="RFC" value="10020"/>
          <seriesInfo name="DOI" value="10.17487/RFC10020"/>
        </reference>
      </references>
      <references anchor="sec-informative-references" pn="section-15.2">
        <name slugifiedName="name-informative-references">Informative References</name>
        <reference anchor="I-D.ietf-ace-key-groupcomm-oscore" target="https://datatracker.ietf.org/doc/html/draft-ietf-ace-key-groupcomm-oscore-21" quoteTitle="true" derivedAnchor="ACE-KEY-GROUP-OSCORE">
          <front>
            <title>Key Management for Group Object Security for Constrained RESTful Environments (Group OSCORE) Using Authentication and Authorization for Constrained Environments (ACE)</title>
            <author fullname="Marco Tiloca" initials="M." surname="Tiloca">
              <organization showOnFrontPage="true">RISE AB</organization>
            </author>
            <author fullname="Francesca Palombini" initials="F." surname="Palombini">
              <organization showOnFrontPage="true">Ericsson AB</organization>
            </author>
            <date day="14" month="March" year="2026"/>
            <abstract>
              <t indent="0">This document defines an application profile of the Authentication and Authorization for Constrained Environments (ACE) framework, to request and provision keying material in group communication scenarios that are based on the Constrained Application Protocol (CoAP) and are secured with Group Object Security for Constrained RESTful Environments (Group OSCORE). This application profile delegates the authentication and authorization of Clients, which join an OSCORE group through a Resource Server acting as Group Manager for that group. This application profile leverages protocol-specific transport profiles of ACE to achieve communication security, server authentication, and proof of possession of a key owned by the Client and bound to an OAuth 2.0 access token.</t>
            </abstract>
          </front>
          <seriesInfo name="Internet-Draft" value="draft-ietf-ace-key-groupcomm-oscore-21"/>
          <refcontent>Work in Progress</refcontent>
        </reference>
        <reference anchor="I-D.ietf-cose-cbor-encoded-cert" target="https://datatracker.ietf.org/doc/html/draft-ietf-cose-cbor-encoded-cert-21" quoteTitle="true" derivedAnchor="C509-CERT">
          <front>
            <title>CBOR Encoded X.509 Certificates (C509 Certificates)</title>
            <author fullname="John Preuß Mattsson" initials="J. P." surname="Mattsson">
              <organization showOnFrontPage="true">Ericsson AB</organization>
            </author>
            <author fullname="Göran Selander" initials="G." surname="Selander">
              <organization showOnFrontPage="true">Ericsson AB</organization>
            </author>
            <author fullname="Shahid Raza" initials="S." surname="Raza">
              <organization showOnFrontPage="true">University of Glasgow</organization>
            </author>
            <author fullname="Joel Höglund" initials="J." surname="Höglund">
              <organization showOnFrontPage="true">RISE AB</organization>
            </author>
            <author fullname="Martin Furuhed" initials="M." surname="Furuhed">
              <organization showOnFrontPage="true">IN Groupe</organization>
            </author>
            <author fullname="Lijun Liao" initials="L." surname="Liao">
              <organization showOnFrontPage="true">NIO Inc.</organization>
            </author>
            <date day="24" month="September" year="2026"/>
            <abstract>
              <t indent="0">This document specifies a CBOR encoding of X.509 certificates. The resulting certificates are called C509 certificates. The CBOR encoding supports a large subset of RFC 5280 and common certificate profiles, and it is extensible. Two types of C509 certificates are defined. One type is an invertible CBOR re-encoding of DER-encoded X.509 certificates with the signature field copied from the DER encoding. The other type is identical except that the signature is computed over the CBOR encoding instead of the DER encoding, thereby avoiding the use of ASN.1. Both types of certificates have the same semantics as X.509 while providing comparable size reduction. This document also specifies CBOR-encoded data structures for certification requests and certification request templates, new COSE headers, as well as a TLS certificate type and a file format for C509. This document updates RFC 6698 by extending the TLSA selectors registry to include C509 certificates.</t>
            </abstract>
          </front>
          <seriesInfo name="Internet-Draft" value="draft-ietf-cose-cbor-encoded-cert-21"/>
          <refcontent>Work in Progress</refcontent>
        </reference>
        <reference anchor="I-D.ietf-core-cacheable-oscore" target="https://datatracker.ietf.org/doc/html/draft-ietf-core-cacheable-oscore-02" quoteTitle="true" derivedAnchor="CACHEABLE-OSCORE">
          <front>
            <title>End-to-End Protected and Cacheable CoAP Responses using Group Object Security for Constrained RESTful Environments (Group OSCORE)</title>
            <author fullname="Christian Amsüss" initials="C." surname="Amsüss"/>
            <author fullname="Marco Tiloca" initials="M." surname="Tiloca">
              <organization showOnFrontPage="true">RISE AB</organization>
            </author>
            <date day="6" month="July" year="2026"/>
            <abstract>
              <t indent="0">When using the Constrained Application Protocol (CoAP), exchanged messages can be protected end-to-end also across untrusted intermediary proxies. This can be achieved with Object Security for Constrained RESTful Environments (OSCORE) or, in the case of group communication, with Group Object Security for Constrained RESTful Environments (Group OSCORE). However, this sidesteps the proxies' abilities to cache responses from the origin server(s). This document restores cacheability of end-to-end protected responses at proxies, by using Group OSCORE and introducing consensus requests, which any client in an OSCORE group can send to one server or multiple servers in the same group.</t>
            </abstract>
          </front>
          <seriesInfo name="Internet-Draft" value="draft-ietf-core-cacheable-oscore-02"/>
          <refcontent>Work in Progress</refcontent>
        </reference>
        <reference anchor="I-D.ietf-core-groupcomm-proxy" target="https://datatracker.ietf.org/doc/html/draft-ietf-core-groupcomm-proxy-07" quoteTitle="true" derivedAnchor="CoAP-GROUP-PROXY">
          <front>
            <title>Proxy Operations in Group Communication for the Constrained Application Protocol (CoAP)</title>
            <author fullname="Marco Tiloca" initials="M." surname="Tiloca">
              <organization showOnFrontPage="true">RISE AB</organization>
            </author>
            <author fullname="Esko Dijk" initials="E." surname="Dijk">
              <organization showOnFrontPage="true">IoTconsultancy.nl</organization>
            </author>
            <date day="2" month="September" year="2026"/>
            <abstract>
              <t indent="0">This document defines a specific realization of proxy intended for scenarios that use group communication for the Constrained Application Protocol (CoAP). Such a proxy processes a single request sent by a client typically over unicast and distributes the request to a group of servers, e.g., over UDP/IP multicast as the defined default transport protocol. Then, the proxy collects the individual responses from those servers and relays those responses back to the client, in a way that allows the client to distinguish the responses and their origin servers through embedded addressing information. This document updates RFC7252 with respect to caching of response messages at proxies.</t>
            </abstract>
          </front>
          <seriesInfo name="Internet-Draft" value="draft-ietf-core-groupcomm-proxy-07"/>
          <refcontent>Work in Progress</refcontent>
        </reference>
        <reference anchor="I-D.ietf-core-observe-multicast-notifications" target="https://datatracker.ietf.org/doc/html/draft-ietf-core-observe-multicast-notifications-17" quoteTitle="true" derivedAnchor="CoAP-MULT-NOTIF">
          <front>
            <title>Observe Notifications as CoAP Multicast Responses</title>
            <author fullname="Marco Tiloca" initials="M." surname="Tiloca">
              <organization showOnFrontPage="true">RISE AB</organization>
            </author>
            <author fullname="Rikard Höglund" initials="R." surname="Höglund">
              <organization showOnFrontPage="true">RISE AB</organization>
            </author>
            <author fullname="Christian Amsüss" initials="C." surname="Amsüss"/>
            <author fullname="Francesca Palombini" initials="F." surname="Palombini">
              <organization showOnFrontPage="true">Ericsson AB</organization>
            </author>
            <date day="2" month="November" year="2026"/>
            <abstract>
              <t indent="0">The Constrained Application Protocol (CoAP) allows clients to "observe" resources at a server and to receive notifications as unicast responses upon changes of the resource state. In some use cases, such as those based on publish-subscribe, it would be convenient for the server to send a single notification addressed to all the clients observing the same target resource. This document updates RFC7252 and RFC7641, and it defines how a server sends observe notifications as response messages over multicast, synchronizing all the observers of the same resource on the same shared Token value. Besides, this document defines how the security protocol Group Object Security for Constrained RESTful Environments (Group OSCORE) can be used to protect multicast notifications end-to- end between the server and the observer clients.</t>
            </abstract>
          </front>
          <seriesInfo name="Internet-Draft" value="draft-ietf-core-observe-multicast-notifications-17"/>
          <refcontent>Work in Progress</refcontent>
        </reference>
        <reference anchor="I-D.ietf-iotops-security-protocol-comparison" target="https://datatracker.ietf.org/doc/html/draft-ietf-iotops-security-protocol-comparison-09" quoteTitle="true" derivedAnchor="CoAP-SEC-PROT">
          <front>
            <title>Comparison of CoAP Security Protocols</title>
            <author fullname="John Preuß Mattsson" initials="J. P." surname="Mattsson">
              <organization showOnFrontPage="true">Ericsson</organization>
            </author>
            <author fullname="Francesca Palombini" initials="F." surname="Palombini">
              <organization showOnFrontPage="true">Ericsson</organization>
            </author>
            <author fullname="Mališa Vučinić" initials="M." surname="Vučinić">
              <organization showOnFrontPage="true">INRIA</organization>
            </author>
            <date day="4" month="June" year="2025"/>
            <abstract>
              <t indent="0">This document analyzes and compares the sizes of key exchange flights and the per-packet message size overheads when using different security protocols to secure CoAP. Small message sizes are very important for reducing energy consumption, latency, and time to completion in constrained radio network such as Low-Power Wide Area Networks (LPWANs). The analyzed security protocols are DTLS 1.2, DTLS 1.3, TLS 1.2, TLS 1.3, cTLS, EDHOC, OSCORE, and Group OSCORE. The DTLS and TLS record layers are analyzed with and without 6LoWPAN- GHC compression. DTLS is analyzed with and without Connection ID.</t>
            </abstract>
          </front>
          <seriesInfo name="Internet-Draft" value="draft-ietf-iotops-security-protocol-comparison-09"/>
          <refcontent>Work in Progress</refcontent>
        </reference>
        <reference anchor="I-D.ietf-lwig-curve-representations" target="https://datatracker.ietf.org/doc/html/draft-ietf-lwig-curve-representations-23" quoteTitle="true" derivedAnchor="CURVE-REPR">
          <front>
            <title>Alternative Elliptic Curve Representations</title>
            <author fullname="Rene Struik" initials="R." surname="Struik">
              <organization showOnFrontPage="true">Struik Security Consultancy</organization>
            </author>
            <date day="21" month="January" year="2022"/>
            <abstract>
              <t indent="0">This document specifies how to represent Montgomery curves and (twisted) Edwards curves as curves in short-Weierstrass form and illustrates how this can be used to carry out elliptic curve computations leveraging existing implementations and specifications of, e.g., ECDSA and ECDH using NIST prime curves. We also provide extensive background material that may be useful for implementers of elliptic curve cryptography.</t>
            </abstract>
          </front>
          <seriesInfo name="Internet-Draft" value="draft-ietf-lwig-curve-representations-23"/>
          <refcontent>Work in Progress</refcontent>
        </reference>
        <reference anchor="Degabriele" target="https://eprint.iacr.org/2011/615" quoteTitle="true" derivedAnchor="Degabriele">
          <front>
            <title>On the Joint Security of Encryption and Signature in EMV</title>
            <author initials="J. P." surname="Degabriele" fullname="Jean Paul Degabriele">
              <organization showOnFrontPage="true"/>
            </author>
            <author initials="A." surname="Lehmann" fullname="Anja Lehmann">
              <organization showOnFrontPage="true"/>
            </author>
            <author initials="K. G." surname="Paterson" fullname="Kenneth G. Paterson">
              <organization showOnFrontPage="true"/>
            </author>
            <author initials="N. P." surname="Smart" fullname="Nigel P. Smart">
              <organization showOnFrontPage="true"/>
            </author>
            <author initials="M." surname="Strefler" fullname="Mario Strefler">
              <organization showOnFrontPage="true"/>
            </author>
            <date year="2011" month="December"/>
          </front>
          <refcontent>Cryptology ePrint Archive, Paper 2011/615</refcontent>
        </reference>
        <reference anchor="I-D.ietf-core-oscore-capable-proxies" target="https://datatracker.ietf.org/doc/html/draft-ietf-core-oscore-capable-proxies-08" quoteTitle="true" derivedAnchor="OSCORE-PROXIES">
          <front>
            <title>OSCORE-capable Proxies</title>
            <author fullname="Marco Tiloca" initials="M." surname="Tiloca">
              <organization showOnFrontPage="true">RISE AB</organization>
            </author>
            <author fullname="Rikard Höglund" initials="R." surname="Höglund">
              <organization showOnFrontPage="true">RISE AB</organization>
            </author>
            <date day="2" month="November" year="2026"/>
            <abstract>
              <t indent="0">When using the Constrained Application Protocol (CoAP), messages exchanged between two endpoints can be protected end-to-end at the application layer by means of Object Security for Constrained RESTful Environments (OSCORE), also in the presence of intermediaries such as proxies. This document defines how to use OSCORE for protecting CoAP messages also between an origin application endpoint and an intermediary, or between two intermediaries. Also, it defines rules to escalate the protection of a CoAP option, in order to encrypt and integrity-protect it whenever possible. Finally, it defines how to secure a CoAP message by applying multiple, nested OSCORE protections, e.g., both end-to-end between origin application endpoints; and between an application endpoint and an intermediary or between two intermediaries. Therefore, this document updates RFC 8613. Furthermore, this document updates RFC 8768, by explicitly defining the processing with OSCORE for the CoAP Hop-Limit Option. The approach defined in this document can be seamlessly employed also with Group OSCORE, for protecting CoAP messages when group communication is used in the presence of intermediaries.</t>
            </abstract>
          </front>
          <seriesInfo name="Internet-Draft" value="draft-ietf-core-oscore-capable-proxies-08"/>
          <refcontent>Work in Progress</refcontent>
        </reference>
        <reference anchor="RFC3629" target="https://www.rfc-editor.org/info/rfc3629" quoteTitle="true" derivedAnchor="RFC3629">
          <front>
            <title>UTF-8, a transformation format of ISO 10646</title>
            <author fullname="F. Yergeau" initials="F." surname="Yergeau"/>
            <date month="November" year="2003"/>
            <abstract>
              <t indent="0">ISO/IEC 10646-1 defines a large character set called the Universal Character Set (UCS) which encompasses most of the world's writing systems. The originally proposed encodings of the UCS, however, were not compatible with many current applications and protocols, and this has led to the development of UTF-8, the object of this memo. UTF-8 has the characteristic of preserving the full US-ASCII range, providing compatibility with file systems, parsers and other software that rely on US-ASCII values but are transparent to other values. This memo obsoletes and replaces RFC 2279.</t>
            </abstract>
          </front>
          <seriesInfo name="STD" value="63"/>
          <seriesInfo name="RFC" value="3629"/>
          <seriesInfo name="DOI" value="10.17487/RFC3629"/>
        </reference>
        <reference anchor="RFC4340" target="https://www.rfc-editor.org/info/rfc4340" quoteTitle="true" derivedAnchor="RFC4340">
          <front>
            <title>Datagram Congestion Control Protocol (DCCP)</title>
            <author fullname="E. Kohler" initials="E." surname="Kohler"/>
            <author fullname="M. Handley" initials="M." surname="Handley"/>
            <author fullname="S. Floyd" initials="S." surname="Floyd"/>
            <date month="March" year="2006"/>
            <abstract>
              <t indent="0">The Datagram Congestion Control Protocol (DCCP) is a transport protocol that provides bidirectional unicast connections of congestion-controlled unreliable datagrams. DCCP is suitable for applications that transfer fairly large amounts of data and that can benefit from control over the tradeoff between timeliness and reliability. [STANDARDS-TRACK]</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="4340"/>
          <seriesInfo name="DOI" value="10.17487/RFC4340"/>
        </reference>
        <reference anchor="RFC4944" target="https://www.rfc-editor.org/info/rfc4944" quoteTitle="true" derivedAnchor="RFC4944">
          <front>
            <title>Transmission of IPv6 Packets over IEEE 802.15.4 Networks</title>
            <author fullname="G. Montenegro" initials="G." surname="Montenegro"/>
            <author fullname="N. Kushalnagar" initials="N." surname="Kushalnagar"/>
            <author fullname="J. Hui" initials="J." surname="Hui"/>
            <author fullname="D. Culler" initials="D." surname="Culler"/>
            <date month="September" year="2007"/>
            <abstract>
              <t indent="0">This document describes the frame format for transmission of IPv6 packets and the method of forming IPv6 link-local addresses and statelessly autoconfigured addresses on IEEE 802.15.4 networks. Additional specifications include a simple header compression scheme using shared context and provisions for packet delivery in IEEE 802.15.4 meshes. [STANDARDS-TRACK]</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="4944"/>
          <seriesInfo name="DOI" value="10.17487/RFC4944"/>
        </reference>
        <reference anchor="RFC4949" target="https://www.rfc-editor.org/info/rfc4949" quoteTitle="true" derivedAnchor="RFC4949">
          <front>
            <title>Internet Security Glossary, Version 2</title>
            <author fullname="R. Shirey" initials="R." surname="Shirey"/>
            <date month="August" year="2007"/>
            <abstract>
              <t indent="0">This Glossary provides definitions, abbreviations, and explanations of terminology for information system security. The 334 pages of entries offer recommendations to improve the comprehensibility of written material that is generated in the Internet Standards Process (RFC 2026). The recommendations follow the principles that such writing should (a) use the same term or definition whenever the same concept is mentioned; (b) use terms in their plainest, dictionary sense; (c) use terms that are already well-established in open publications; and (d) avoid terms that either favor a particular vendor or favor a particular technology or mechanism over other, competing techniques that already exist or could be developed. This memo provides information for the Internet community.</t>
            </abstract>
          </front>
          <seriesInfo name="FYI" value="36"/>
          <seriesInfo name="RFC" value="4949"/>
          <seriesInfo name="DOI" value="10.17487/RFC4949"/>
        </reference>
        <reference anchor="RFC5280" target="https://www.rfc-editor.org/info/rfc5280" quoteTitle="true" derivedAnchor="RFC5280">
          <front>
            <title>Internet X.509 Public Key Infrastructure Certificate and Certificate Revocation List (CRL) Profile</title>
            <author fullname="D. Cooper" initials="D." surname="Cooper"/>
            <author fullname="S. Santesson" initials="S." surname="Santesson"/>
            <author fullname="S. Farrell" initials="S." surname="Farrell"/>
            <author fullname="S. Boeyen" initials="S." surname="Boeyen"/>
            <author fullname="R. Housley" initials="R." surname="Housley"/>
            <author fullname="W. Polk" initials="W." surname="Polk"/>
            <date month="May" year="2008"/>
            <abstract>
              <t indent="0">This memo profiles the X.509 v3 certificate and X.509 v2 certificate revocation list (CRL) for use in the Internet. An overview of this approach and model is provided as an introduction. The X.509 v3 certificate format is described in detail, with additional information regarding the format and semantics of Internet name forms. Standard certificate extensions are described and two Internet-specific extensions are defined. A set of required certificate extensions is specified. The X.509 v2 CRL format is described in detail along with standard and Internet-specific extensions. An algorithm for X.509 certification path validation is described. An ASN.1 module and examples are provided in the appendices. [STANDARDS-TRACK]</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="5280"/>
          <seriesInfo name="DOI" value="10.17487/RFC5280"/>
        </reference>
        <reference anchor="RFC6282" target="https://www.rfc-editor.org/info/rfc6282" quoteTitle="true" derivedAnchor="RFC6282">
          <front>
            <title>Compression Format for IPv6 Datagrams over IEEE 802.15.4-Based Networks</title>
            <author fullname="J. Hui" initials="J." role="editor" surname="Hui"/>
            <author fullname="P. Thubert" initials="P." surname="Thubert"/>
            <date month="September" year="2011"/>
            <abstract>
              <t indent="0">This document updates RFC 4944, "Transmission of IPv6 Packets over IEEE 802.15.4 Networks". This document specifies an IPv6 header compression format for IPv6 packet delivery in Low Power Wireless Personal Area Networks (6LoWPANs). The compression format relies on shared context to allow compression of arbitrary prefixes. How the information is maintained in that shared context is out of scope. This document specifies compression of multicast addresses and a framework for compressing next headers. UDP header compression is specified within this framework. [STANDARDS-TRACK]</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="6282"/>
          <seriesInfo name="DOI" value="10.17487/RFC6282"/>
        </reference>
        <reference anchor="RFC6690" target="https://www.rfc-editor.org/info/rfc6690" quoteTitle="true" derivedAnchor="RFC6690">
          <front>
            <title>Constrained RESTful Environments (CoRE) Link Format</title>
            <author fullname="Z. Shelby" initials="Z." surname="Shelby"/>
            <date month="August" year="2012"/>
            <abstract>
              <t indent="0">This specification defines Web Linking using a link format for use by constrained web servers to describe hosted resources, their attributes, and other relationships between links. Based on the HTTP Link Header field defined in RFC 5988, the Constrained RESTful Environments (CoRE) Link Format is carried as a payload and is assigned an Internet media type. "RESTful" refers to the Representational State Transfer (REST) architecture. A well-known URI is defined as a default entry point for requesting the links hosted by a server. [STANDARDS-TRACK]</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="6690"/>
          <seriesInfo name="DOI" value="10.17487/RFC6690"/>
        </reference>
        <reference anchor="RFC7228" target="https://www.rfc-editor.org/info/rfc7228" quoteTitle="true" derivedAnchor="RFC7228">
          <front>
            <title>Terminology for Constrained-Node Networks</title>
            <author fullname="C. Bormann" initials="C." surname="Bormann"/>
            <author fullname="M. Ersue" initials="M." surname="Ersue"/>
            <author fullname="A. Keranen" initials="A." surname="Keranen"/>
            <date month="May" year="2014"/>
            <abstract>
              <t indent="0">The Internet Protocol Suite is increasingly used on small devices with severe constraints on power, memory, and processing resources, creating constrained-node networks. This document provides a number of basic terms that have been useful in the standardization work for constrained-node networks.</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="7228"/>
          <seriesInfo name="DOI" value="10.17487/RFC7228"/>
        </reference>
        <reference anchor="RFC7959" target="https://www.rfc-editor.org/info/rfc7959" quoteTitle="true" derivedAnchor="RFC7959">
          <front>
            <title>Block-Wise Transfers in the Constrained Application Protocol (CoAP)</title>
            <author fullname="C. Bormann" initials="C." surname="Bormann"/>
            <author fullname="Z. Shelby" initials="Z." role="editor" surname="Shelby"/>
            <date month="August" year="2016"/>
            <abstract>
              <t indent="0">The Constrained Application Protocol (CoAP) is a RESTful transfer protocol for constrained nodes and networks. Basic CoAP messages work well for small payloads from sensors and actuators; however, applications will need to transfer larger payloads occasionally -- for instance, for firmware updates. In contrast to HTTP, where TCP does the grunt work of segmenting and resequencing, CoAP is based on datagram transports such as UDP or Datagram Transport Layer Security (DTLS). These transports only offer fragmentation, which is even more problematic in constrained nodes and networks, limiting the maximum size of resource representations that can practically be transferred.</t>
              <t indent="0">Instead of relying on IP fragmentation, this specification extends basic CoAP with a pair of "Block" options for transferring multiple blocks of information from a resource representation in multiple request-response pairs. In many important cases, the Block options enable a server to be truly stateless: the server can handle each block transfer separately, with no need for a connection setup or other server-side memory of previous block transfers. Essentially, the Block options provide a minimal way to transfer larger representations in a block-wise fashion.</t>
              <t indent="0">A CoAP implementation that does not support these options generally is limited in the size of the representations that can be exchanged, so there is an expectation that the Block options will be widely used in CoAP implementations. Therefore, this specification updates RFC 7252.</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="7959"/>
          <seriesInfo name="DOI" value="10.17487/RFC7959"/>
        </reference>
        <reference anchor="RFC8075" target="https://www.rfc-editor.org/info/rfc8075" quoteTitle="true" derivedAnchor="RFC8075">
          <front>
            <title>Guidelines for Mapping Implementations: HTTP to the Constrained Application Protocol (CoAP)</title>
            <author fullname="A. Castellani" initials="A." surname="Castellani"/>
            <author fullname="S. Loreto" initials="S." surname="Loreto"/>
            <author fullname="A. Rahman" initials="A." surname="Rahman"/>
            <author fullname="T. Fossati" initials="T." surname="Fossati"/>
            <author fullname="E. Dijk" initials="E." surname="Dijk"/>
            <date month="February" year="2017"/>
            <abstract>
              <t indent="0">This document provides reference information for implementing a cross-protocol network proxy that performs translation from the HTTP protocol to the Constrained Application Protocol (CoAP). This will enable an HTTP client to access resources on a CoAP server through the proxy. This document describes how an HTTP request is mapped to a CoAP request and how a CoAP response is mapped back to an HTTP response. This includes guidelines for status code, URI, and media type mappings, as well as additional interworking advice.</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="8075"/>
          <seriesInfo name="DOI" value="10.17487/RFC8075"/>
        </reference>
        <reference anchor="RFC8392" target="https://www.rfc-editor.org/info/rfc8392" quoteTitle="true" derivedAnchor="RFC8392">
          <front>
            <title>CBOR Web Token (CWT)</title>
            <author fullname="M. Jones" initials="M." surname="Jones"/>
            <author fullname="E. Wahlstroem" initials="E." surname="Wahlstroem"/>
            <author fullname="S. Erdtman" initials="S." surname="Erdtman"/>
            <author fullname="H. Tschofenig" initials="H." surname="Tschofenig"/>
            <date month="May" year="2018"/>
            <abstract>
              <t indent="0">CBOR Web Token (CWT) is a compact means of representing claims to be transferred between two parties. The claims in a CWT are encoded in the Concise Binary Object Representation (CBOR), and CBOR Object Signing and Encryption (COSE) is used for added application-layer security protection. A claim is a piece of information asserted about a subject and is represented as a name/value pair consisting of a claim name and a claim value. CWT is derived from JSON Web Token (JWT) but uses CBOR rather than JSON.</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="8392"/>
          <seriesInfo name="DOI" value="10.17487/RFC8392"/>
        </reference>
        <reference anchor="RFC9000" target="https://www.rfc-editor.org/info/rfc9000" quoteTitle="true" derivedAnchor="RFC9000">
          <front>
            <title>QUIC: A UDP-Based Multiplexed and Secure Transport</title>
            <author fullname="J. Iyengar" initials="J." role="editor" surname="Iyengar"/>
            <author fullname="M. Thomson" initials="M." role="editor" surname="Thomson"/>
            <date month="May" year="2021"/>
            <abstract>
              <t indent="0">This document defines the core of the QUIC transport protocol. QUIC provides applications with flow-controlled streams for structured communication, low-latency connection establishment, and network path migration. QUIC includes security measures that ensure confidentiality, integrity, and availability in a range of deployment circumstances. Accompanying documents describe the integration of TLS for key negotiation, loss detection, and an exemplary congestion control algorithm.</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="9000"/>
          <seriesInfo name="DOI" value="10.17487/RFC9000"/>
        </reference>
        <reference anchor="RFC9002" target="https://www.rfc-editor.org/info/rfc9002" quoteTitle="true" derivedAnchor="RFC9002">
          <front>
            <title>QUIC Loss Detection and Congestion Control</title>
            <author fullname="J. Iyengar" initials="J." role="editor" surname="Iyengar"/>
            <author fullname="I. Swett" initials="I." role="editor" surname="Swett"/>
            <date month="May" year="2021"/>
            <abstract>
              <t indent="0">This document describes loss detection and congestion control mechanisms for QUIC.</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="9002"/>
          <seriesInfo name="DOI" value="10.17487/RFC9002"/>
        </reference>
        <reference anchor="RFC9147" target="https://www.rfc-editor.org/info/rfc9147" quoteTitle="true" derivedAnchor="RFC9147">
          <front>
            <title>The Datagram Transport Layer Security (DTLS) Protocol Version 1.3</title>
            <author fullname="E. Rescorla" initials="E." surname="Rescorla"/>
            <author fullname="H. Tschofenig" initials="H." surname="Tschofenig"/>
            <author fullname="N. Modadugu" initials="N." surname="Modadugu"/>
            <date month="April" year="2022"/>
            <abstract>
              <t indent="0">This document specifies version 1.3 of the Datagram Transport Layer Security (DTLS) protocol. DTLS 1.3 allows client/server applications to communicate over the Internet in a way that is designed to prevent eavesdropping, tampering, and message forgery.</t>
              <t indent="0">The DTLS 1.3 protocol is based on the Transport Layer Security (TLS) 1.3 protocol and provides equivalent security guarantees with the exception of order protection / non-replayability. Datagram semantics of the underlying transport are preserved by the DTLS protocol.</t>
              <t indent="0">This document obsoletes RFC 6347.</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="9147"/>
          <seriesInfo name="DOI" value="10.17487/RFC9147"/>
        </reference>
        <reference anchor="RFC9200" target="https://www.rfc-editor.org/info/rfc9200" quoteTitle="true" derivedAnchor="RFC9200">
          <front>
            <title>Authentication and Authorization for Constrained Environments Using the OAuth 2.0 Framework (ACE-OAuth)</title>
            <author fullname="L. Seitz" initials="L." surname="Seitz"/>
            <author fullname="G. Selander" initials="G." surname="Selander"/>
            <author fullname="E. Wahlstroem" initials="E." surname="Wahlstroem"/>
            <author fullname="S. Erdtman" initials="S." surname="Erdtman"/>
            <author fullname="H. Tschofenig" initials="H." surname="Tschofenig"/>
            <date month="August" year="2022"/>
            <abstract>
              <t indent="0">This specification defines a framework for authentication and authorization in Internet of Things (IoT) environments called ACE-OAuth. The framework is based on a set of building blocks including OAuth 2.0 and the Constrained Application Protocol (CoAP), thus transforming a well-known and widely used authorization solution into a form suitable for IoT devices. Existing specifications are used where possible, but extensions are added and profiles are defined to better serve the IoT use cases.</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="9200"/>
          <seriesInfo name="DOI" value="10.17487/RFC9200"/>
        </reference>
        <reference anchor="RFC9594" target="https://www.rfc-editor.org/info/rfc9594" quoteTitle="true" derivedAnchor="RFC9594">
          <front>
            <title>Key Provisioning for Group Communication Using Authentication and Authorization for Constrained Environments (ACE)</title>
            <author fullname="F. Palombini" initials="F." surname="Palombini"/>
            <author fullname="M. Tiloca" initials="M." surname="Tiloca"/>
            <date month="September" year="2024"/>
            <abstract>
              <t indent="0">This document defines how to use the Authentication and Authorization for Constrained Environments (ACE) framework to distribute keying material and configuration parameters for secure group communication. Candidate group members that act as Clients and are authorized to join a group can do so by interacting with a Key Distribution Center (KDC) acting as the Resource Server, from which they obtain the keying material to communicate with other group members. While defining general message formats as well as the interface and operations available at the KDC, this document supports different approaches and protocols for secure group communication. Therefore, details are delegated to separate application profiles of this document as specialized instances that target a particular group communication approach and define how communications in the group are protected. Compliance requirements for such application profiles are also specified.</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="9594"/>
          <seriesInfo name="DOI" value="10.17487/RFC9594"/>
        </reference>
        <reference anchor="I-D.irtf-cfrg-det-sigs-with-noise" target="https://datatracker.ietf.org/doc/html/draft-irtf-cfrg-det-sigs-with-noise-05" quoteTitle="true" derivedAnchor="SIGS-WITH-NOISE">
          <front>
            <title>Hedged ECDSA and EdDSA Signatures</title>
            <author fullname="John Preuß Mattsson" initials="J. P." surname="Mattsson">
              <organization showOnFrontPage="true">Ericsson</organization>
            </author>
            <author fullname="Erik Thormarker" initials="E." surname="Thormarker">
              <organization showOnFrontPage="true">Ericsson</organization>
            </author>
            <author fullname="Sini Ruohomaa" initials="S." surname="Ruohomaa">
              <organization showOnFrontPage="true">Ericsson</organization>
            </author>
            <date day="3" month="March" year="2025"/>
            <abstract>
              <t indent="0">Deterministic elliptic-curve signatures such as deterministic ECDSA and EdDSA have gained popularity over randomized ECDSA as their security does not depend on a source of high-quality randomness. Recent research, however, has found that implementations of these signature algorithms may be vulnerable to certain side-channel and fault injection attacks due to their deterministic nature. One countermeasure to such attacks is hedged signatures where the calculation of the per-message secret number includes both fresh randomness and the message. This document updates RFC 6979 and RFC 8032 to recommend hedged constructions in deployments where side- channel attacks and fault injection attacks are a concern. The updates are invisible to the validator of the signature and compatible with existing ECDSA and EdDSA validators.</t>
            </abstract>
          </front>
          <seriesInfo name="Internet-Draft" value="draft-irtf-cfrg-det-sigs-with-noise-05"/>
          <refcontent>Work in Progress</refcontent>
        </reference>
        <reference anchor="Thormarker" target="https://eprint.iacr.org/2021/509" quoteTitle="true" derivedAnchor="Thormarker">
          <front>
            <title>On using the same key pair for Ed25519 and an X25519 based KEM</title>
            <author initials="E." surname="Thormarker" fullname="Erik Thormarker">
              <organization showOnFrontPage="true"/>
            </author>
            <date year="2021" month="April"/>
          </front>
          <refcontent>Cryptology ePrint Archive, Paper 2021/509</refcontent>
        </reference>
      </references>
    </references>
    <section anchor="sec-requirements" numbered="true" removeInRFC="false" toc="include" pn="section-appendix.a">
      <name slugifiedName="name-assumptions-and-security-ob">Assumptions and Security Objectives</name>
      <t indent="0" pn="section-appendix.a-1">This section presents a set of assumptions and security objectives for the protocol described in this document. The rest of this section refers to three types of groups:</t>
      <ul spacing="normal" bare="false" empty="false" indent="3" pn="section-appendix.a-2">
        <li pn="section-appendix.a-2.1">
          <t indent="0" pn="section-appendix.a-2.1.1">Application group, i.e., a set of CoAP endpoints that share a common pool of resources.</t>
        </li>
        <li pn="section-appendix.a-2.2">
          <t indent="0" pn="section-appendix.a-2.2.1">Security group, as defined in <xref target="terminology" format="default" sectionFormat="of" derivedContent="Section 1.1"/> of this document. Between security groups and application groups, there can be a many-to-many, one-to-many, many-to-one, or one-to-one relationship.</t>
        </li>
        <li pn="section-appendix.a-2.3">
          <t indent="0" pn="section-appendix.a-2.3.1">CoAP group, i.e., a set of CoAP endpoints where each endpoint is configured to receive one-to-many CoAP requests, e.g., sent to the group's associated IP multicast address and UDP port as defined in <xref target="RFC10020" format="default" sectionFormat="of" derivedContent="RFC10020"/>. An endpoint may be a member of multiple CoAP groups. Between CoAP groups and application groups, there can be a many-to-many, one-to-many, many-to-one, or one-to-one relationship. Note that a device sending a CoAP request to a CoAP group is not necessarily a member of that group; it is a member only if it also has a CoAP server endpoint listening for requests sent to the group's associated IP multicast address and UDP port. In order to provide secure group communication, all members of a CoAP group as well as all further endpoints configured only as clients sending CoAP (multicast) requests to the CoAP group have to be members of a security group. Between CoAP groups and security groups, there can be a many-to-many, one-to-many, many-to-one, or one-to-one relationship.</t>
        </li>
      </ul>
      <section anchor="ssec-sec-assumptions" numbered="true" removeInRFC="false" toc="include" pn="section-appendix.a.1">
        <name slugifiedName="name-assumptions">Assumptions</name>
        <t indent="0" pn="section-appendix.a.1-1">The following points are assumed to be already addressed and are out of the scope of this document.</t>
        <dl indent="3" newline="false" spacing="normal" pn="section-appendix.a.1-2">
          <dt pn="section-appendix.a.1-2.1">Multicast communication topology:</dt>
          <dd pn="section-appendix.a.1-2.2">
            <t indent="0" pn="section-appendix.a.1-2.2.1">This document considers both 1-to-N (one sender and multiple recipients) and M-to-N (multiple senders and multiple recipients) communication topologies. The 1-to-N communication topology is the simplest group communication scenario that would serve the needs of a typical Low-Power and Lossy Network (LLN). Examples of use cases that benefit from secure group communication are provided in <xref target="sec-use-cases" format="default" sectionFormat="of" derivedContent="Appendix B"/>.</t>
          </dd>
          <dt pn="section-appendix.a.1-2.3"/>
          <dd pn="section-appendix.a.1-2.4">
            <t indent="0" pn="section-appendix.a.1-2.4.1">In a 1-to-N communication model, only a single client transmits data to the CoAP group in the form of request messages; in an M-to-N communication model (where M and N do not necessarily have the same value), M clients transmit data to the CoAP group. According to <xref target="RFC10020" format="default" sectionFormat="of" derivedContent="RFC10020"/>, any possible proxy entity is supposed to know about the clients. Also, every client expects and is able to handle multiple response messages associated with a same request sent to the CoAP group.</t>
          </dd>
          <dt pn="section-appendix.a.1-2.5">Group size:</dt>
          <dd pn="section-appendix.a.1-2.6">
            <t indent="0" pn="section-appendix.a.1-2.6.1">Security solutions for group communication should be able to adequately support different and possibly large security groups. The group size is the current number of members in a security group. In the use cases mentioned in this document, the number of clients (normally the controlling devices) is expected to be much smaller than the number of servers (i.e., the controlled devices). A security solution for group communication that supports 1 to 50 clients would be able to properly cover the group sizes required for most use cases that are relevant for this document. The maximum group size is expected to be in the range of hundreds to thousands of devices, with large groups easier to manage if including several silent servers. Security groups larger than that should be divided into smaller independent groups. One should not assume that the set of members of a security group remains fixed. That is, the group membership is subject to changes, possibly on a frequent basis.</t>
          </dd>
          <dt pn="section-appendix.a.1-2.7">Communication with the Group Manager:</dt>
          <dd pn="section-appendix.a.1-2.8">
            <t indent="0" pn="section-appendix.a.1-2.8.1">An endpoint must use a secure dedicated channel when communicating with the Group Manager, also in the case that it is not registered as a member of the security group.</t>
          </dd>
          <dt pn="section-appendix.a.1-2.9">Provisioning and management of Security Contexts:</dt>
          <dd pn="section-appendix.a.1-2.10">
            <t indent="0" pn="section-appendix.a.1-2.10.1">A Security Context must be established among the members of the security group. A secure mechanism must be used to generate, revoke, and (re-)distribute keying material, communication policies, and security parameters in the security group. The actual provisioning and management of the Security Context is out of the scope of this document.</t>
          </dd>
          <dt pn="section-appendix.a.1-2.11">Multicast data security cipher suite:</dt>
          <dd pn="section-appendix.a.1-2.12">
            <t indent="0" pn="section-appendix.a.1-2.12.1">All members of a security group must use the same cipher suite to provide authenticity, integrity, and confidentiality of messages in the group. The cipher suite is specified as part of the Security Context.</t>
          </dd>
          <dt pn="section-appendix.a.1-2.13">Ensuring backward security:</dt>
          <dd pn="section-appendix.a.1-2.14">
            <t indent="0" pn="section-appendix.a.1-2.14.1">A new device joining the security group should not have access to any old Security Contexts used before its joining. This ensures that a new member of the security group is not able to decrypt confidential data sent before it has joined the security group. The adopted key management scheme should ensure that the Security Context is updated to ensure backward confidentiality. The actual mechanism to update the Security Context and renew the group keying material in the security group upon a new member's joining has to be defined as part of the group key management scheme.</t>
          </dd>
          <dt pn="section-appendix.a.1-2.15">Ensuring forward security:</dt>
          <dd pn="section-appendix.a.1-2.16">
            <t indent="0" pn="section-appendix.a.1-2.16.1">Entities that leave the security group should not have access to any future Security Contexts or message exchanged within the security group after their leaving. This ensures that a former member of the security group is not able to decrypt confidential data sent within the security group anymore. Also, it ensures that a former member is not able to send protected messages to the security group anymore. The actual mechanism to update the Security Context and renew the group keying material in the security group upon a member's leaving has to be defined as part of the group key management scheme.</t>
          </dd>
        </dl>
      </section>
      <section anchor="ssec-sec-objectives" numbered="true" removeInRFC="false" toc="include" pn="section-appendix.a.2">
        <name slugifiedName="name-security-objectives">Security Objectives</name>
        <t indent="0" pn="section-appendix.a.2-1">The protocol described in this document aims at fulfilling the following security objectives:</t>
        <dl indent="3" newline="false" spacing="normal" pn="section-appendix.a.2-2">
          <dt pn="section-appendix.a.2-2.1">Data replay protection:</dt>
          <dd pn="section-appendix.a.2-2.2">
            <t indent="0" pn="section-appendix.a.2-2.2.1">Request messages or response messages replayed within the security group must be detected.</t>
          </dd>
          <dt pn="section-appendix.a.2-2.3">Data confidentiality:</dt>
          <dd pn="section-appendix.a.2-2.4">
            <t indent="0" pn="section-appendix.a.2-2.4.1">Messages sent within the security group shall be encrypted.</t>
          </dd>
          <dt pn="section-appendix.a.2-2.5">Group-level data confidentiality:</dt>
          <dd pn="section-appendix.a.2-2.6">
            <t indent="0" pn="section-appendix.a.2-2.6.1">The group mode provides group-level data confidentiality since messages are encrypted at a group level, i.e., in such a way that they can be decrypted by any member of the security group, but not by an external adversary or other external entities other than the Group Manager responsible for the group.</t>
          </dd>
          <dt pn="section-appendix.a.2-2.7">Pairwise data confidentiality:</dt>
          <dd pn="section-appendix.a.2-2.8">
            <t indent="0" pn="section-appendix.a.2-2.8.1">The pairwise mode especially provides pairwise data confidentiality since messages are encrypted using pairwise keying material shared between any two group members; hence, they can be decrypted only by the intended single recipient.</t>
          </dd>
          <dt pn="section-appendix.a.2-2.9">Source message authentication:</dt>
          <dd pn="section-appendix.a.2-2.10">
            <t indent="0" pn="section-appendix.a.2-2.10.1">Messages sent within the security group shall be authenticated. That is, it is essential to ensure that a message is originated by a member of the security group, and in particular by a specific, identifiable member of the security group.</t>
          </dd>
          <dt pn="section-appendix.a.2-2.11">Message integrity:</dt>
          <dd pn="section-appendix.a.2-2.12">
            <t indent="0" pn="section-appendix.a.2-2.12.1">Messages sent within the security group shall be integrity protected. That is, it is essential to ensure that a message has not been tampered with, either by a group member or by an external adversary or other external entities that are not members of the security group.</t>
          </dd>
          <dt pn="section-appendix.a.2-2.13">Message ordering:</dt>
          <dd pn="section-appendix.a.2-2.14">
            <t indent="0" pn="section-appendix.a.2-2.14.1">It must be possible to determine the ordering of messages coming from a single sender. Like in OSCORE <xref target="RFC8613" format="default" sectionFormat="of" derivedContent="RFC8613"/>, a recipient endpoint can determine the relative order of requests or responses from another sender endpoint by means of their Partial IV. It is not required to determine ordering of messages from different senders.</t>
          </dd>
        </dl>
      </section>
    </section>
    <section anchor="sec-use-cases" numbered="true" removeInRFC="false" toc="include" pn="section-appendix.b">
      <name slugifiedName="name-list-of-use-cases">List of Use Cases</name>
      <t indent="0" pn="section-appendix.b-1">Group Communication for CoAP <xref target="RFC10020" format="default" sectionFormat="of" derivedContent="RFC10020"/> provides the necessary background for multicast-based CoAP communication with particular reference to LLNs and resource-constrained environments. The interested reader is encouraged to first read <xref target="RFC10020" format="default" sectionFormat="of" derivedContent="RFC10020"/> to understand the non-security related details. This section discusses a number of use cases that benefit from secure group communication and refers to the three types of groups from <xref target="sec-requirements" format="default" sectionFormat="of" derivedContent="Appendix A"/>. Specific security requirements for these use cases are discussed in <xref target="sec-requirements" format="default" sectionFormat="of" derivedContent="Appendix A"/>.</t>
      <dl indent="3" newline="false" spacing="normal" pn="section-appendix.b-2">
        <dt pn="section-appendix.b-2.1">Lighting control:</dt>
        <dd pn="section-appendix.b-2.2">
          <t indent="0" pn="section-appendix.b-2.2.1">Consider a building equipped with IP-connected lighting devices, switches, and border routers. The lighting devices acting as servers are organized into application groups and CoAP groups, according to their physical location in the building. For instance, lighting devices in a room or corridor can be configured as members of a single application group and corresponding CoAP group. Those lighting devices together with the switches acting as clients in the same room or corridor can be configured as members of the corresponding security group. Switches are then used to control the lighting devices by sending on/off/dimming commands to all lighting devices in the CoAP group, while border routers connected to an IP network backbone (which is also multicast-enabled) can be used to interconnect routers in the building. Consequently, this would also enable logical groups to be formed even if devices with a role in the lighting application may be physically in different subnets (e.g., on wired and wireless networks). Connectivity between lighting devices may be realized, for instance, by means of IPv6 and (border) routers supporting 6LoWPAN <xref target="RFC4944" format="default" sectionFormat="of" derivedContent="RFC4944"/> <xref target="RFC6282" format="default" sectionFormat="of" derivedContent="RFC6282"/>. Group communication enables synchronous operation of a set of connected lights, ensuring that the light preset (e.g., dimming level or color) of a large set of luminaires are changed at the same perceived time. This is especially useful for providing a visual synchronicity of light effects to the user. As a practical guideline, events within a 200 ms interval are perceived as simultaneous by humans, which is necessary to ensure in many setups. Devices may reply back to the switches that issue on/off/dimming commands in order to report about the execution of the requested operation (e.g., OK, failure, or error) and their current operational status. In a typical lighting control scenario, a single switch is the only entity responsible for sending commands to a set of lighting devices. In more advanced lighting control use cases, an M-to-N communication topology would be required, e.g., if multiple sensors (presence or daylight) are responsible for triggering events to a set of lighting devices. Especially in professional lighting scenarios, the roles of client and server are configured by the lighting commissioner, and devices strictly follow those roles.</t>
        </dd>
        <dt pn="section-appendix.b-2.3">Integrated building control:</dt>
        <dd pn="section-appendix.b-2.4">
          <t indent="0" pn="section-appendix.b-2.4.1">Enabling Building Automation and Control Systems (BACSs) to control multiple heating, ventilation, and air-conditioning units to predefined presets. Controlled units can be organized into application groups and CoAP groups in order to reflect their physical position in the building, e.g., devices in the same room can be configured as members of a single application group and corresponding CoAP group. As a practical guideline, events within intervals of seconds are typically acceptable. Controlled units may reply back to the BACS issuing control commands in order to report about the execution of the requested operation (e.g., OK, failure, or error) and their current operational status.</t>
        </dd>
        <dt pn="section-appendix.b-2.5">Software and firmware updates:</dt>
        <dd pn="section-appendix.b-2.6">
          <t indent="0" pn="section-appendix.b-2.6.1">Software and firmware updates often comprise quite a large amount of data. This can overload an LLN that is otherwise typically used to dealing with only small amounts of data on an infrequent basis. Rather than sending software and firmware updates as unicast messages to each individual device, multicasting such updated data to a larger set of devices at once displays a number of benefits. For instance, it can significantly reduce the network load and decrease the overall time latency for propagating this data to all devices. Even if the complete update process itself is secured, securing the individual messages is important, if updates consist of relatively large amounts of data. In fact, checking individual received data piecemeal for tampering avoids that devices store large amounts of partially corrupted data and that they detect tampering hereof only after all data has been received. Devices receiving software and firmware updates may reply back in order to provide feedback about the execution of the update operation (e.g., OK, failure, or error) and their current operational status.</t>
        </dd>
        <dt pn="section-appendix.b-2.7">Parameter and configuration update:</dt>
        <dd pn="section-appendix.b-2.8">
          <t indent="0" pn="section-appendix.b-2.8.1">By means of multicast communication, it is possible to update the settings of a set of similar devices, both simultaneously and efficiently. Possible parameters are related, for instance, to network load management or network access control. Devices receiving parameter and configuration updates may reply back in order to provide feedback about the execution of the update operation (e.g., OK, failure, or error) and their current operational status.</t>
        </dd>
        <dt pn="section-appendix.b-2.9">Commissioning of LLN systems:</dt>
        <dd pn="section-appendix.b-2.10">
          <t indent="0" pn="section-appendix.b-2.10.1">A commissioning device is responsible for querying all devices in the local network or a selected subset of them in order to discover their presence and be aware of their capabilities, default configuration, and operating conditions. Queried devices displaying similarities in their capabilities and features or sharing a common physical location can be configured as members of a single application group and corresponding CoAP group. Queried devices are expected to reply back to the commissioning device in order to notify their presence and provide the requested information and their current operational status.</t>
        </dd>
        <dt pn="section-appendix.b-2.11">Emergency multicast:</dt>
        <dd pn="section-appendix.b-2.12">
          <t indent="0" pn="section-appendix.b-2.12.1">A particular emergency-related information (e.g., natural disaster) is generated and multicast by an emergency notifier and relayed to multiple devices. The latter may reply back to the emergency notifier in order to provide their feedback and local information related to the ongoing emergency. This kind of setup should additionally rely on a fault-tolerant multicast algorithm, such as the Multicast Protocol for Low-Power and Lossy Networks (MPL).</t>
        </dd>
      </dl>
    </section>
    <section anchor="gid-ex" numbered="true" removeInRFC="false" toc="include" pn="section-appendix.c">
      <name slugifiedName="name-example-of-group-identifier">Example of Group Identifier Format</name>
      <t indent="0" pn="section-appendix.c-1">This section provides an example of how the Group Identifier (Gid) can be formatted. That is, the Gid can be composed of two parts, namely a Group Prefix and a Group Epoch.</t>
      <t indent="0" pn="section-appendix.c-2">For each group, the Group Prefix is constant over time and is uniquely defined in the set of all the groups associated with the same Group Manager. The choice of the Group Prefix for a given group's Security Context is application-specific. The size of the Group Prefix directly impacts the maximum number of distinct groups under the same Group Manager.</t>
      <t indent="0" pn="section-appendix.c-3">The Group Epoch is set to 0 upon the group's initialization, and is incremented by 1 each time new keying material, together with a new Gid, is distributed to the group in order to establish a new Security Context (see <xref target="sec-group-key-management" format="default" sectionFormat="of" derivedContent="Section 12.2"/>).</t>
      <t indent="0" pn="section-appendix.c-4">As an example, a 3-byte Gid can be composed of i) a 1-byte Group Prefix '0xb1' interpreted as a raw byte string, and ii) a 2-byte Group Epoch interpreted as an unsigned integer ranging from 0 to 65535. Then, after having established the Common Context 61532 times in the group, its Gid will assume value '0xb1f05c'.</t>
      <t indent="0" pn="section-appendix.c-5">Using an immutable Group Prefix for a group with a Group Manager that does not reassign Gid values (see <xref target="sec-gid-recycling" format="default" sectionFormat="of" derivedContent="Section 12.2.1.1"/>) limits the total number of rekeying instances. With a Group Manager that does reassign Gid values, it limits the maximum number of rekeying instances that a long exchange can persist through. In either case, the Group Epoch size needs to be chosen depending on the expected rate of rekeying instances.</t>
      <t indent="0" pn="section-appendix.c-6">As discussed in <xref target="ssec-gid-collision" format="default" sectionFormat="of" derivedContent="Section 13.6"/>, if endpoints are deployed in multiple groups managed by different non-synchronized Group Managers, it is possible that Group Identifiers of different groups coincide at some point in time. In this case, a recipient has to handle coinciding Group Identifiers and has to try using different Security Contexts to process an incoming message until the right one is found and the message is correctly verified. Therefore, it is favorable that Group Identifiers from different Group Managers have a size that results in a small probability of collision. How small this probability should be is up to system designers.</t>
    </section>
    <section anchor="sec-group-manager" numbered="true" removeInRFC="false" toc="include" pn="section-appendix.d">
      <name slugifiedName="name-responsibilities-of-the-gro">Responsibilities of the Group Manager</name>
      <t indent="0" pn="section-appendix.d-1">The Group Manager is responsible for performing the following tasks:</t>
      <ol spacing="normal" type="1" indent="adaptive" start="1" pn="section-appendix.d-2"><li pn="section-appendix.d-2.1" derivedCounter="1.">
          <t indent="0" pn="section-appendix.d-2.1.1">Creating and managing OSCORE groups. This includes the assignment of a Gid to every newly created group, ensuring uniqueness of Gids within the set of its OSCORE groups and (optionally) the secure recycling of Gids.</t>
        </li>
        <li pn="section-appendix.d-2.2" derivedCounter="2.">
          <t indent="0" pn="section-appendix.d-2.2.1">Defining policies for authorizing the joining of its OSCORE groups.</t>
        </li>
        <li pn="section-appendix.d-2.3" derivedCounter="3.">
          <t indent="0" pn="section-appendix.d-2.3.1">Handling the join process to add new endpoints as group members.</t>
        </li>
        <li pn="section-appendix.d-2.4" derivedCounter="4.">
          <t indent="0" pn="section-appendix.d-2.4.1">Establishing the Common Context part of the Security Context and providing it to an authorized group member during the join process together with the corresponding Sender ID.</t>
        </li>
        <li pn="section-appendix.d-2.5" derivedCounter="5.">
          <t indent="0" pn="section-appendix.d-2.5.1">Updating the Key Generation Number and the Gid of its OSCORE groups upon renewing the respective Security Context.</t>
        </li>
        <li pn="section-appendix.d-2.6" derivedCounter="6.">
          <t indent="0" pn="section-appendix.d-2.6.1">Generating and managing Sender IDs within its OSCORE groups, as well as assigning and providing them to new endpoints during the join process or to current group members upon request of renewal or re-joining. This includes ensuring that:  </t>
          <ul spacing="normal" bare="false" empty="false" indent="3" pn="section-appendix.d-2.6.2">
            <li pn="section-appendix.d-2.6.2.1">
              <t indent="0" pn="section-appendix.d-2.6.2.1.1">Each Sender ID is unique within each of the OSCORE groups;</t>
            </li>
            <li pn="section-appendix.d-2.6.2.2">
              <t indent="0" pn="section-appendix.d-2.6.2.2.1">Each Sender ID is not reassigned within the same group since the latest time when the current Gid value was assigned to the group. That is, the Sender ID is not reassigned even to a current group member re-joining the same group, without a rekeying happening first.</t>
            </li>
          </ul>
        </li>
        <li pn="section-appendix.d-2.7" derivedCounter="7.">
          <t indent="0" pn="section-appendix.d-2.7.1">Defining communication policies for each of its OSCORE groups and signaling them to new endpoints during the join process.</t>
        </li>
        <li pn="section-appendix.d-2.8" derivedCounter="8.">
          <t indent="0" pn="section-appendix.d-2.8.1">Renewing the Security Context of an OSCORE group upon membership change by revoking and renewing common security parameters and keying material (rekeying).</t>
        </li>
        <li pn="section-appendix.d-2.9" derivedCounter="9.">
          <t indent="0" pn="section-appendix.d-2.9.1">Providing the management keying material that a new endpoint requires to participate in the rekeying process consistently with the key management scheme used in the group joined by the new endpoint.</t>
        </li>
        <li pn="section-appendix.d-2.10" derivedCounter="10.">
          <t indent="0" pn="section-appendix.d-2.10.1">Assisting a group member that has missed a group rekeying instance to understand which authentication credentials and Recipient Contexts to delete, as associated with former group members.</t>
        </li>
        <li pn="section-appendix.d-2.11" derivedCounter="11.">
          <t indent="0" pn="section-appendix.d-2.11.1">Acting as the key repository in order to handle the authentication credentials of the members of its OSCORE groups and providing such authentication credentials and information about the associated group members to other members of the same group upon request. The actual storage of authentication credentials may be entrusted to a separate secure storage device or service.</t>
        </li>
        <li pn="section-appendix.d-2.12" derivedCounter="12.">
          <t indent="0" pn="section-appendix.d-2.12.1">Validating that the format and parameters of authentication credentials of group members are consistent with the public key algorithm and related parameters used in the respective OSCORE group.</t>
        </li>
      </ol>
      <t indent="0" pn="section-appendix.d-3">The Group Manager specified in <xref target="I-D.ietf-ace-key-groupcomm-oscore" format="default" sectionFormat="of" derivedContent="ACE-KEY-GROUP-OSCORE"/> provides this functionality.</t>
    </section>
    <section numbered="false" anchor="acknowldegment" removeInRFC="false" toc="include" pn="section-appendix.e">
      <name slugifiedName="name-acknowledgements">Acknowledgements</name>
      <t indent="0" pn="section-appendix.e-1"><contact fullname="Jiye Park"/> contributed as a coauthor to earlier draft versions of this document.</t>
      <t indent="0" pn="section-appendix.e-2">The authors sincerely thank <contact fullname="Christian Amsüss"/>, <contact fullname="Stefan Beck"/>, <contact fullname="Mike Bishop"/>, <contact fullname="Rolf Blom"/>, <contact fullname="Carsten Bormann"/>, <contact fullname="Mohamed Boucadair"/>, <contact fullname="Deb Cooley"/>, <contact fullname="Esko Dijk"/>, <contact fullname="Gorry Fairhurst"/>, <contact fullname="Patrik Fältström"/>, <contact fullname="Martin Gunnarsson"/>, <contact fullname="Klaus Hartke"/>, <contact fullname="Richard Kelsey"/>, <contact fullname="Paul Kyzivat"/>, <contact fullname="Joerg Ott"/>, <contact fullname="Dave Robin"/>, <contact fullname="Jim Schaad"/>, <contact fullname="Ludwig Seitz"/>, <contact fullname="Orie Steele"/>, <contact fullname="Peter van der Stok"/>, <contact fullname="Ketan Talaulikar"/>, <contact fullname="Erik Thormarker"/>, <contact fullname="Mališa Vučinić"/>, and <contact fullname="Paul Wouters"/> for their feedback and comments.</t>
      <t indent="0" pn="section-appendix.e-3">The work on this document has been partly supported by the Sweden's Innovation Agency VINNOVA and the Celtic-Next projects CRITISEC and CYPRESS; the H2020 projects SIFIS-Home (Grant agreement 952652) and ARCADIAN-IoT (Grant agreement 101020259); the SSF project SEC4Factory under the grant RIT17-0032; and the EIT-Digital High Impact Initiative ACTIVE.</t>
    </section>
    <section anchor="authors-addresses" numbered="false" removeInRFC="false" toc="include" pn="section-appendix.f">
      <name slugifiedName="name-authors-addresses">Authors' Addresses</name>
      <author initials="M." surname="Tiloca" fullname="Marco Tiloca">
        <organization showOnFrontPage="true">RISE AB</organization>
        <address>
          <postal>
            <street>Isafjordsgatan 22</street>
            <city>Kista</city>
            <code>164 40</code>
            <country>Sweden</country>
          </postal>
          <email>marco.tiloca@ri.se</email>
        </address>
      </author>
      <author initials="G." surname="Selander" fullname="Göran Selander">
        <organization showOnFrontPage="true">Ericsson AB</organization>
        <address>
          <postal>
            <street>Torshamnsgatan 23</street>
            <city>Kista</city>
            <code>16440 Stockholm</code>
            <country>Sweden</country>
          </postal>
          <email>goran.selander@ericsson.com</email>
        </address>
      </author>
      <author initials="F." surname="Palombini" fullname="Francesca Palombini">
        <organization showOnFrontPage="true">Ericsson AB</organization>
        <address>
          <postal>
            <street>Torshamnsgatan 23</street>
            <city>Kista</city>
            <code>16440 Stockholm</code>
            <country>Sweden</country>
          </postal>
          <email>francesca.palombini@ericsson.com</email>
        </address>
      </author>
      <author initials="J." surname="Preuß Mattsson" fullname="John Preuß Mattsson">
        <organization showOnFrontPage="true">Ericsson AB</organization>
        <address>
          <postal>
            <street>Torshamnsgatan 23</street>
            <city>Kista</city>
            <code>16440 Stockholm</code>
            <country>Sweden</country>
          </postal>
          <email>john.mattsson@ericsson.com</email>
        </address>
      </author>
      <author initials="R." surname="Höglund" fullname="Rikard Höglund">
        <organization showOnFrontPage="true">RISE AB</organization>
        <address>
          <postal>
            <street>Isafjordsgatan 22</street>
            <city>Kista</city>
            <code>16440 Stockholm</code>
            <country>Sweden</country>
          </postal>
          <email>rikard.hoglund@ri.se</email>
        </address>
      </author>
    </section>
  </back>
</rfc>
