<?xml version="1.0" encoding="utf-8"?>
<?xml-model href="rfc7991bis.rnc"?>  <!-- Required for schema validation and schema-aware editing -->
<!-- <?xml-stylesheet type="text/xsl" href="rfc2629.xslt" ?> -->
<!-- This third-party XSLT can be enabled for direct transformations in XML processors, including most browsers -->


<!DOCTYPE rfc [
  <!ENTITY nbsp    "&#160;">
  <!ENTITY zwsp   "&#8203;">
  <!ENTITY nbhy   "&#8209;">
  <!ENTITY wj     "&#8288;">
]>
<!-- If further character entities are required then they should be added to the DOCTYPE above.
     Use of an external entity file is not recommended. -->

<rfc
  xmlns:xi="http://www.w3.org/2001/XInclude"
  category="std"
  docName="draft-hsharma-lamps-ocsp-nonce-update-05"
  ipr="trust200902"
  obsoletes=""
  updates="8954"
  submissionType="IETF"
  xml:lang="en"
  version="3">

  <front>
    <title abbrev="draft-hsharma-lamps-ocsp-nonce-update-05">Online Certificate Status Protocol (OCSP) Nonce Extension</title>
    <!--  [REPLACE/DELETE] abbrev. The abbreviated title is required if the full title is longer than 39 characters -->
    <seriesInfo name="Internet-Draft" value="draft-hsharma-lamps-ocsp-nonce-update-05"/>
    <author fullname="Himanshu Sharma" initials="H" role="editor" surname="Sharma">
      <!-- [CHECK]
             * initials should not include an initial for the surname
             * role="editor" is optional -->
    <!-- Can have more than one author -->
      
    <!-- all of the following elements are optional -->
      <organization>Netskope Inc</organization>
      <address>
        <postal>
          <!-- Reorder these if your country does things differently -->
          <street>2445 Augustine Dr 3rd floor</street>
          <city>Santa Clara</city>
          <region>California</region>
          <code>95054</code>
          <country>USA</country>
          <!-- Uses two letter country code -->
        </postal>        
        <email>himanshu@netskope.com</email>  
        <uri>www.netskope.com</uri>
      </address>
    </author>
   
    <date year="2024"/>
    <!-- On draft subbmission:
         * If only the current year is specified, the current day and month will be used.
         * If the month and year are both specified and are the current ones, the current day will
           be used
         * If the year is not the current one, it is necessary to specify at least a month and day="1" will be used.
    -->

    <area>General</area>
    <workgroup>Internet Engineering Task Force</workgroup>
    <!-- "Internet Engineering Task Force" is fine for individual submissions.  If this element is 
          not present, the default is "Network Working Group", which is used by the RFC Editor as 
          a nod to the history of the RFC Series. -->

    <keyword>Online Certificate Status Protocol (OCSP) Nonce Extension</keyword>
    <!-- [REPLACE/DELETE]. Multiple allowed.  Keywords are incorporated into HTML output files for 
         use by search engines. -->

    <abstract>
        <t>
            This document updates the Nonce extension section of RFC-8954.  Nonce
            extension is an optional extension for Online Certificate Status
            Protocol (OCSP) request and response messages.  OCSP is used for
            checking the status of a certificate, and the Nonce extension is used
            to cryptographically bind an OCSP response message to a particular
            OCSP request message. Some environments use cryptographic algorithms that generate
            a Nonce that is longer than 32 octets. This document updates the maximum allowed length of Nonce to 128 octets.
        </t>
    </abstract>
 
  </front>

  <middle>
    
    <section>
      <name>Introduction</name>
        <t>
            Nonce extension was previously defined in Section 4.4.1 of <xref target="RFC6960"/>
   and updated in <xref target="RFC8954"/>.  <xref target="RFC8954"/> enforces the maximum Nonce
   length to 32 octets.  To support cryptographic algorithms that generate
   a Nonce that is longer than 32 octets, this document updates the
   maximum allowed size of the Nonce to 128 octets.  In addition, this
   document recommends that the OCSP client and responder use a 
                Nonce with a minimum length of 32 octets.
        </t>
      <section>
        <name>Requirements Language</name>
        <t>The key words "MUST", "MUST NOT", "REQUIRED", "SHALL",
          "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT
          RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be
          interpreted as described in BCP 14 <xref target="RFC2119"/>
          <xref target="RFC8174"/> when, and only when, they appear in
          all capitals, as shown here.</t>
      </section>
    </section>
    
    <section>
      <name>OCSP Extensions</name>
      <t>
          The message formats for OCSP requests and responses are defined in
   <xref target="RFC6960"/> and Nonce extension was updated in <xref target="RFC8954"/>.  <xref target="RFC6960"/>
   also defines the standard extensions for OCSP messages based on the
   extension model employed in X.509 version 3 certificates (see
   <xref target="RFC5280"/>).  <xref target="RFC8954"/> replaces this section to enforce the minimum
   and maximum length for the Nonce value.
   This document extends the maximum allowed nonce length to 128 octets and does not change the specifications
   of any of the other standard extensions defined in [RFC6960].
      </t>
   <section>
   <name>Nonce Extension</name>
   <t>This section replaces the entirety of Section 2.1 of <xref target="RFC8954"/>, which
       describes the OCSP Nonce extension.
   </t>
   <t>
        The Nonce cryptographically binds a request and a response to prevent
       replay attacks. The Nonce is included as one of the requestExtensions
       in requests; in responses, it would be included as one of the
       responseExtensions.In both the request and the response, the Nonce
       will be identified by the object identifier id-pkix-ocsp-Nonce, while
       the extnValue is the value of the Nonce.  If the Nonce extension is
       present, then the length of the Nonce MUST be at least 1 octet and
       can be up to 128 octets.
   </t>
   <t>
        An OCSP client that implements this document SHOULD use a
       minimum length of 32 octets for Nonce in the Nonce extension.
   </t>
   <t>
        OCSP resonder that implements this document MUST reject
        any OCSP request that has a Nonce in the Nonce extension with a length
        of either 0 octets or more than 128 octets, with the malformedRequest
        OCSPResponseStatus as described in Section 4.2.1 of <xref target="RFC6960"/>.
            Responders, supporting the Nonce extension, MUST accept lengths of at least
            16 octets and MAY choose to ignore the Nonce extension for requests where the 
            length of the nonce is less than 16 octets or more than 32 octets.
   </t>
   <t>
       The value of the Nonce MUST be generated using a cryptographically 
       strong pseudorandom number generator (see <xref target="RFC4086"/>). The minimum
           Nonce length of 1 octet is defined to provide backward compatibility 
           with older clients that follow <xref target="RFC6960"/>.
   </t>
    <sourcecode type="asn.1" markers="false">
    id-pkix-ocsp           OBJECT IDENTIFIER ::= { id-ad-ocsp }
    id-pkix-ocsp-Nonce     OBJECT IDENTIFIER ::= { id-pkix-ocsp 2 }
    Nonce ::= OCTET STRING(SIZE(1..128))
     </sourcecode>
</section>
    </section>   

    <section> 
        <name>Security Considerations</name>
        <t>The security considerations of OCSP, in general, are described in
   <xref target="RFC6960"/>.  During the interval in which the previous OCSP response
   for a certificate is not expired but the responder has a changed
   status for that certificate, a copy of that OCSP response can be used
   to indicate that the status of the certificate is still valid.
   Including a client's nonce value in the OCSP response makes sure that
   the response is the latest response from the server and not an old
       copy.</t>
        <section>
            <name>Replay Attack</name>
            <t>The Nonce extension is used to avoid replay attacks.  Since the OCSP
   responder may choose not to send the Nonce extension in the OCSP
   response even if the client has sent the Nonce extension in the
   request <xref target="RFC5019"/>, an on-path attacker can intercept the OCSP request
   and respond with an earlier response from the server without the
   Nonce extension.  This can be mitigated by configuring the server to
   use a short time interval between the thisUpdate and nextUpdate
       fields in the OCSP response.</t>
   <t>
       RFC 8954-compliant implementations will be unable to process nonces generated per the new specification with sizes in excess of what was permitted by RFC 8954
   </t>
        </section>
    </section> 
    <section anchor="IANA">
      <name>IANA Considerations</name>
      <t>This memo includes no request to IANA.</t>
    </section>
    <section>
        <name>
            Changes to Appendix B of RFC 6960.
        </name>
        <t>
            This section updates the ASN.1 definitions of the OCSP Nonce 
            extension in Appendices B.1 and B.2 of  <xref target="RFC6960"/>.  Appendix B.1
            defines OCSP using ASN.1 - 1998 Syntax; Appendix B.2 defines OCSP
            using ASN.1 - 2008 Syntax.
        </t>
        <section>
            <name>
                Changes to Appendix B.1 OCSP in ASN.1 - 1998 Syntax
            </name>
            <t>
                OLD Syntax:
            </t>
            <t>
                The definition of OCSP Nonce extension is not provided in
                Appendix B.1 of  <xref target="RFC6960"/> for the ASN.1 - 1998 Syntax.
            </t>
            <t>
                NEW Syntax:
            </t>
            <sourcecode type="asn.1" markers="false">
     Nonce ::= OCTET STRING(SIZE(1..128))
            </sourcecode>
        </section>
        <section>
            <name>
                Changes to Appendix B.2 OCSP in ASN.1 - 2008 Syntax
            </name>
            <t>
                OLD Syntax:
            </t>
            <sourcecode type="asn.1" markers="false">
     re-ocsp-nonce EXTENSION ::= { SYNTAX OCTET STRING IDENTIFIED
                                    BY id-pkix-ocsp-nonce }
            </sourcecode>
            <t>
                NEW Syntax:
            </t>
            <sourcecode type="asn.1" markers="false">
     re-ocsp-nonce EXTENSION ::= { SYNTAX OCTET STRING(SIZE(1..128))
                                  IDENTIFIED BY id-pkix-ocsp-nonce }
            </sourcecode>
        </section>

    </section>
    <!-- NOTE: The Acknowledgements and Contributors sections are at the end of this template -->
  </middle>

  <back>
    <references>
      <name>References</name>
      <references>
        <name>Normative References</name>
        
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.6960.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8954.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.5280.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.4086.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.2119.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8174.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.5019.xml"/>
        <!-- The recommended and simplest way to include a well known reference -->
        
      </references>
    </references>
 </back>
</rfc>

