<?xml version='1.0' encoding='utf-8'?>
<rfc xmlns:xi="http://www.w3.org/2001/XInclude" version="3" category="std" consensus="true" docName="draft-ietf-sipcore-digest-scheme-15" indexInclude="true" ipr="pre5378Trust200902" number="8760" prepTime="2020-03-19T14:32:37" scripts="Common,Latin" sortRefs="true" submissionType="IETF" symRefs="true" tocDepth="3" tocInclude="true" updates="3261" xml:lang="en">
  <link href="https://datatracker.ietf.org/doc/draft-ietf-sipcore-digest-scheme-15" rel="prev"/>
  <link href="https://dx.doi.org/10.17487/rfc8760" rel="alternate"/>
  <link href="urn:issn:2070-1721" rel="alternate"/>
  <front>
    <title abbrev="SIP Digest Authentication">The Session Initiation Protocol (SIP) Digest Access Authentication Scheme</title>
    <seriesInfo name="RFC" value="8760" stream="IETF"/>
    <author initials="R." surname="Shekh-Yusef" fullname="Rifaat Shekh-Yusef">
      <organization showOnFrontPage="true">Avaya</organization>
      <address>
        <postal>
          <street>425 Legget Dr.</street>
          <city>Ottawa</city>
          <region>Ontario</region>
          <country>Canada</country>
        </postal>
        <phone>+1-613-595-9106</phone>
        <email>rifaat.ietf@gmail.com</email>
      </address>
    </author>
    <date month="03" year="2020"/>
    <area>RAI</area>
    <workgroup>SIP Core</workgroup>
    <keyword>Digest Auth</keyword>
    <abstract pn="section-abstract">
      <t pn="section-abstract-1">
   This document updates RFC 3261 by modifying the Digest Access 
   Authentication scheme used by the Session Initiation Protocol (SIP) to add support 
   for more secure digest algorithms, e.g., SHA-256 and SHA-512/256, to replace the 
   obsolete MD5 algorithm.


      </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 pn="section-boilerplate.1-1">
            This is an Internet Standards Track document.
        </t>
        <t 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 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/rfc8760" 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 pn="section-boilerplate.2-1">
            Copyright (c) 2020 IETF Trust and the persons identified as the
            document authors. All rights reserved.
        </t>
        <t 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 Simplified BSD License text as described in
            Section 4.e of the Trust Legal Provisions and are provided without
            warranty as described in the Simplified BSD License.
        </t>
        <t pn="section-boilerplate.2-3">
            This document may contain material from IETF Documents or IETF
            Contributions published or made publicly available before November
            10, 2008. The person(s) controlling the copyright in some of this
            material may not have granted the IETF Trust the right to allow
            modifications of such material outside the IETF Standards Process.
            Without obtaining an adequate license from the person(s)
            controlling the copyright in such materials, this document may not
            be modified outside the IETF Standards Process, and derivative
            works of it may not be created outside the IETF Standards Process,
            except to format it for publication as an RFC or to translate it
            into languages other than English.
        </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 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 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 keepWithNext="true" 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-updates-to-the-sip-digest-a">Updates to the SIP Digest Access Authentication Scheme</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 keepWithNext="true" 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-hash-algorithms">Hash Algorithms</xref></t>
              </li>
              <li pn="section-toc.1-1.2.2.2">
                <t keepWithNext="true" 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-representation-of-digest-va">Representation of Digest Values</xref></t>
              </li>
              <li pn="section-toc.1-1.2.2.3">
                <t keepWithNext="true" 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-uas-behavior">UAS Behavior</xref></t>
              </li>
              <li pn="section-toc.1-1.2.2.4">
                <t keepWithNext="true" 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-uac-behavior">UAC Behavior</xref></t>
              </li>
              <li pn="section-toc.1-1.2.2.5">
                <t keepWithNext="true" 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-forking">Forking</xref></t>
              </li>
              <li pn="section-toc.1-1.2.2.6">
                <t keepWithNext="true" 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-http-digest-authentication-">HTTP Digest Authentication Scheme Modifications</xref></t>
              </li>
              <li pn="section-toc.1-1.2.2.7">
                <t keepWithNext="true" pn="section-toc.1-1.2.2.7.1"><xref derivedContent="2.7" format="counter" sectionFormat="of" target="section-2.7"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-abnf-for-sip">ABNF for SIP</xref></t>
              </li>
            </ul>
          </li>
          <li pn="section-toc.1-1.3">
            <t keepWithNext="true" 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-security-considerations">Security Considerations</xref></t>
          </li>
          <li pn="section-toc.1-1.4">
            <t keepWithNext="true" 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-iana-considerations">IANA Considerations</xref></t>
          </li>
          <li pn="section-toc.1-1.5">
            <t keepWithNext="true" 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-references">References</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 keepWithNext="true" 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-normative-references">Normative References</xref></t>
              </li>
              <li pn="section-toc.1-1.5.2.2">
                <t keepWithNext="true" 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-informative-references">Informative References</xref></t>
              </li>
            </ul>
          </li>
          <li pn="section-toc.1-1.6">
            <t keepWithNext="true" pn="section-toc.1-1.6.1"><xref derivedContent="" format="none" sectionFormat="of" target="section-appendix.a"/><xref derivedContent="" format="title" sectionFormat="of" target="name-acknowledgments">Acknowledgments</xref></t>
          </li>
          <li pn="section-toc.1-1.7">
            <t keepWithNext="true" pn="section-toc.1-1.7.1"><xref derivedContent="" format="none" sectionFormat="of" target="section-appendix.b"/><xref derivedContent="" format="title" sectionFormat="of" target="name-authors-address">Author's Address</xref></t>
          </li>
        </ul>
      </section>
    </toc>
  </front>
  <middle>
    <section anchor="introduction" numbered="true" removeInRFC="false" toc="include" pn="section-1">
      <name slugifiedName="name-introduction">Introduction</name>
      <t pn="section-1-1">
    The Session Initiation Protocol <xref target="RFC3261" format="default" sectionFormat="of" derivedContent="RFC3261"/> uses the same mechanism
    as the Hypertext Transfer Protocol (HTTP) does for authenticating
    users. This mechanism is called "Digest Access Authentication". It is a simple challenge-response mechanism that allows a server
    to challenge a client request and allows a client to provide
    authentication information in response to that challenge. The
    version of Digest Access Authentication that <xref target="RFC3261" format="default" sectionFormat="of" derivedContent="RFC3261"/> references
    is specified in <xref target="RFC2617" format="default" sectionFormat="of" derivedContent="RFC2617"/>.
      </t>
      <t pn="section-1-2">
    The default hash algorithm for Digest Access Authentication is MD5.
    However, it has been demonstrated that the MD5 algorithm is not
    collision resistant and is now considered a bad choice for a hash
    function (see <xref target="RFC6151" format="default" sectionFormat="of" derivedContent="RFC6151"/>).
      </t>
      <t pn="section-1-3">
    The HTTP Digest Access Authentication document <xref target="RFC7616" format="default" sectionFormat="of" derivedContent="RFC7616"/> obsoletes
    <xref target="RFC2617" format="default" sectionFormat="of" derivedContent="RFC2617"/> and adds stronger algorithms that can be used with
    the Digest Access Authentication scheme and establishes a registry for
    these algorithms, known as the "Hash Algorithms for HTTP Digest
    Authentication" IANA registry, so that algorithms can be added in the
    future.
      </t>
      <t pn="section-1-4">
    This document updates the Digest Access Authentication scheme used
    by SIP to support the algorithms listed in the "Hash Algorithms
    for HTTP Digest Authentication" IANA registry defined by <xref target="RFC7616" format="default" sectionFormat="of" derivedContent="RFC7616"/>.
      </t>
      <section anchor="terminology" numbered="true" removeInRFC="false" toc="include" pn="section-1.1">
        <name slugifiedName="name-terminology">Terminology</name>
        <t 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>
      </section>
    </section>
    <section anchor="sip.digest.scheme" numbered="true" removeInRFC="false" toc="include" pn="section-2">
      <name slugifiedName="name-updates-to-the-sip-digest-a">Updates to the SIP Digest Access Authentication Scheme</name>
      <t pn="section-2-1">
    This section describes the modifications to the operation of the
    Digest mechanism as specified in <xref target="RFC3261" format="default" sectionFormat="of" derivedContent="RFC3261"/> in order to support 
    the algorithms defined in the "Hash Algorithms for HTTP Digest Authentication" 
    IANA registry described in <xref target="RFC7616" format="default" sectionFormat="of" derivedContent="RFC7616"/>.
      </t>
      <t pn="section-2-2">
    It replaces the reference used in <xref target="RFC3261" format="default" sectionFormat="of" derivedContent="RFC3261"/> for Digest Access Authentication, 
    substituting <xref target="RFC7616" format="default" sectionFormat="of" derivedContent="RFC7616"/> for the obsolete <xref target="RFC2617" format="default" sectionFormat="of" derivedContent="RFC2617"/>, and describes 
    the modifications to the usage of the Digest mechanism in <xref target="RFC3261" format="default" sectionFormat="of" derivedContent="RFC3261"/> 
    resulting from that reference update. It adds support for the SHA-256 and SHA-512/256 algorithms <xref target="SHA2" format="default" sectionFormat="of" derivedContent="SHA2"/>. 
    It adds required support for the "qop" parameter. It provides additional User Agent Client (UAC) 
    and User Agent Server (UAS) procedures regarding usage of multiple SIP Authorization, 
    WWW-Authenticate, and Proxy-Authenticate header fields, including the order
    in which to insert 
    and process them. It provides guidance regarding forking. Finally, it updates the SIP ABNF 
    as required by the updates.
      </t>
      <section anchor="hash.algorithms" numbered="true" removeInRFC="false" toc="include" pn="section-2.1">
        <name slugifiedName="name-hash-algorithms">Hash Algorithms</name>
        <t pn="section-2.1-1">
      The Digest Access Authentication scheme has an "algorithm" parameter that specifies the
      algorithm to be used to compute the digest of the response. The "Hash
      Algorithms for HTTP Digest Authentication" IANA registry specifies 
      the algorithms that correspond to 'algorithm' values.
        </t>
        <t pn="section-2.1-2">
      <xref target="RFC3261" format="default" sectionFormat="of" derivedContent="RFC3261"/> specifies only one algorithm, MD5, which is used by default.
      This document extends <xref target="RFC3261" format="default" sectionFormat="of" derivedContent="RFC3261"/> to allow use of any algorithm listed in
      the "Hash Algorithms for HTTP Digest Authentication" IANA registry.
        </t>
        <t pn="section-2.1-3">
     A UAS prioritizes which algorithm to use based on its policy,
     which is specified in <xref target="uas.behavior" format="default" sectionFormat="of" derivedContent="Section 2.3"/> and parallels the process used in
     HTTP specified by <xref target="RFC7616" format="default" sectionFormat="of" derivedContent="RFC7616"/>.
        </t>
      </section>
      <section anchor="rep.digest.values" numbered="true" removeInRFC="false" toc="include" pn="section-2.2">
        <name slugifiedName="name-representation-of-digest-va">Representation of Digest Values</name>
        <t pn="section-2.2-1">
      The size of the digest depends on the algorithm used.  The bits in
      the digest are converted from the most significant to the least
      significant bit, four bits at a time, to the ASCII representation as
      follows. Each set of four bits is represented by its familiar hexadecimal
      notation from the characters 0123456789abcdef; that is, binary 0000 is
      represented by the character '0', 0001 is represented by '1', and so on up to the
      representation of 1111 as 'f'. If the SHA-256 or SHA-512/256 algorithm is 
      used to calculate the digest, then the digest will be represented as 64 
      hexadecimal characters.      
        </t>
      </section>
      <section anchor="uas.behavior" numbered="true" removeInRFC="false" toc="include" pn="section-2.3">
        <name slugifiedName="name-uas-behavior">UAS Behavior</name>
        <t pn="section-2.3-1">
      When a UAS receives a request from a UAC, and an acceptable
      Authorization header field is not received, the UAS can challenge the
      originator to provide credentials by rejecting the request with a
      401/407 status code with the WWW-Authenticate/Proxy-Authenticate
      header field, respectively. The UAS <bcp14>MAY</bcp14> add multiple WWW-Authenticate/Proxy-Authenticate
      header fields to allow the UAS to utilize the best available
      algorithm supported by the client.
        </t>
        <t pn="section-2.3-2">
      If the UAS challenges the originator using multiple WWW-Authenticate/Proxy-Authenticate 
      header fields with the same realm, then each of these
      header fields <bcp14>MUST</bcp14> use a different digest algorithm. The UAS <bcp14>MUST</bcp14> add these
      header fields to the response in the order in which it would prefer to see them
      used, starting with the most preferred algorithm at the top. The UAS cannot assume that the client 
      will use the algorithm specified in the topmost header field.
        </t>
      </section>
      <section anchor="uac.behavior" numbered="true" removeInRFC="false" toc="include" pn="section-2.4">
        <name slugifiedName="name-uac-behavior">UAC Behavior</name>
        <t pn="section-2.4-1">      When the UAC receives a response with multiple WWW-Authenticate/Proxy-Authenticate 
      header fields with the same realm, it <bcp14>SHOULD</bcp14> use the topmost 
      header field that it supports unless a local policy dictates otherwise. 
      The client <bcp14>MUST</bcp14> ignore any challenge it does not understand.
        </t>
        <t pn="section-2.4-2">
      When the UAC receives a 401 response with multiple WWW-Authenticate
      header fields with different realms, it <bcp14>SHOULD</bcp14> retry and add an
      Authorization header field containing credentials that match the topmost
      header field of any of the realms unless a local policy dictates otherwise.
        </t>
        <t pn="section-2.4-3">
    If the UAC cannot respond to any of the challenges in the response,
    then it <bcp14>SHOULD</bcp14> abandon attempts to send the request unless a local
    policy dictates otherwise, e.g., the policy might indicate the use of non-Digest mechanisms.  
    For example, if the UAC does not have credentials or has stale credentials for 
    any of the realms, the UAC will abandon the request.      
        </t>
      </section>
      <section anchor="forking" numbered="true" removeInRFC="false" toc="include" pn="section-2.5">
        <name slugifiedName="name-forking">Forking</name>
        <t pn="section-2.5-1">
      <xref target="RFC3261" sectionFormat="of" section="22.3" format="default" derivedLink="https://rfc-editor.org/rfc/rfc3261#section-22.3" derivedContent="RFC3261"/> discusses the operation of the proxy-to-user
      authentication, which describes the operation of the proxy when it
      forks a request. This section clarifies that operation.
        </t>
        <t pn="section-2.5-2">
      If a request is forked, various proxy servers and/or UAs may wish to
      challenge the UAC. In this case, the forking proxy server is
      responsible for aggregating these challenges into a single response.
      Each WWW-Authenticate and Proxy-Authenticate value received in
      response to the forked request <bcp14>MUST</bcp14> be placed into the single
      response that is sent by the forking proxy to the UAC.
        </t>
        <t pn="section-2.5-3">
    When the forking proxy places multiple WWW-Authenticate and Proxy-Authenticate header
    fields received from one downstream proxy into a single response, it <bcp14>MUST</bcp14> maintain
    the order of these header fields.  The ordering of values received from different downstream 
    proxies is not significant.      
        </t>
      </section>
      <section anchor="http.modifications" numbered="true" removeInRFC="false" toc="include" pn="section-2.6">
        <name slugifiedName="name-http-digest-authentication-">HTTP Digest Authentication Scheme Modifications</name>
        <t pn="section-2.6-1">
      This section describes the modifications and clarifications required
      to apply the HTTP Digest Access Authentication scheme to SIP. The SIP scheme
      usage is similar to that for HTTP. For completeness, the bullets specified 
      below are mostly copied from <xref target="RFC3261" sectionFormat="of" section="22.4" format="default" derivedLink="https://rfc-editor.org/rfc/rfc3261#section-22.4" derivedContent="RFC3261"/>; the 
      only semantic changes are specified in bullets 1, 7, and 8 below.
        </t>
        <t pn="section-2.6-2">
      SIP clients and servers <bcp14>MUST NOT</bcp14> accept or request Basic
      authentication.
        </t>
        <t pn="section-2.6-3">
      The rules for Digest Access Authentication follow those defined in HTTP,
      with "HTTP/1.1" <xref target="RFC7616" format="default" sectionFormat="of" derivedContent="RFC7616"/> replaced by "SIP/2.0" in addition to the following
      differences:
        </t>
        <ol spacing="normal" start="1" type="1" pn="section-2.6-4">
          <li pn="section-2.6-4.1" derivedCounter="1.">
            <t pn="section-2.6-4.1.1">
The URI included in the challenge has the following ABNF <xref target="RFC5234" format="default" sectionFormat="of" derivedContent="RFC5234"/>:
            </t>
            <sourcecode name="" type="abnf" markers="false" pn="section-2.6-4.1.2">
      URI  =  Request-URI ; as defined in RFC 3261, Section 25
</sourcecode>
          </li>
          <li pn="section-2.6-4.2" derivedCounter="2.">
The "uri" parameter of the Authorization header field <bcp14>MUST</bcp14> be
         enclosed in quotation marks.
</li>
          <li pn="section-2.6-4.3" derivedCounter="3.">
            <t pn="section-2.6-4.3.1">
The ABNF for digest-uri-value is:</t>
            <sourcecode name="" type="abnf" markers="false" pn="section-2.6-4.3.2">
         digest-uri-value  =  Request-URI
</sourcecode>
          </li>
          <li pn="section-2.6-4.4" derivedCounter="4.">
The example procedure for choosing a nonce based on ETag does not
         work for SIP.
</li>
          <li pn="section-2.6-4.5" derivedCounter="5.">
The text in <xref target="RFC7234" format="default" sectionFormat="of" derivedContent="RFC7234"/> regarding cache operation does not
         apply to SIP.
        </li>
          <li pn="section-2.6-4.6" derivedCounter="6.">
            <xref target="RFC7616" format="default" sectionFormat="of" derivedContent="RFC7616"/> requires that a server check that the URI in the
          request line and the URI included in the Authorization header
          field point to the same resource.  In a SIP context, these two
          URIs may refer to different users due to forwarding at some
          proxy.  Therefore, in SIP, a UAS <bcp14>MUST</bcp14> check if the Request-URI in the
          Authorization/Proxy-Authorization header field value corresponds to a
          user for whom the UAS is willing to accept forwarded or direct
          requests; however, it <bcp14>MAY</bcp14> still accept it if the two fields are not equivalent.                    
        </li>
          <li pn="section-2.6-4.7" derivedCounter="7.">
            <t pn="section-2.6-4.7.1">As a clarification to the calculation of the A2 value for
	   message integrity assurance in the Digest Access Authentication
	   scheme, implementers should assume that the hash of the entity-body
resolves to the hash of an empty string when the entity-body is empty (that
is, when SIP messages have no body):</t>
            <sourcecode name="" type="" markers="false" pn="section-2.6-4.7.2">
 H(entity-body) = &lt;algorithm&gt;("")
</sourcecode>
            <t pn="section-2.6-4.7.3">For example, when the chosen algorithm is SHA-256, then:</t>
            <sourcecode name="" type="" markers="false" pn="section-2.6-4.7.4">
 H(entity-body) = SHA-256("") =
"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
</sourcecode>
          </li>
          <li pn="section-2.6-4.8" derivedCounter="8.">
            <t pn="section-2.6-4.8.1">
A UAS <bcp14>MUST</bcp14> be able to properly handle a "qop" parameter received
         in an Authorization/Proxy-Authorization header field, and a UAC <bcp14>MUST</bcp14> be able to
         properly handle a "qop" parameter received in WWW-Authenticate and
         Proxy-Authenticate header fields. However, for backward compatibility 
         reasons, the "qop" parameter is optional for clients and
	 servers based on <xref target="RFC3261" format="default" sectionFormat="of" derivedContent="RFC3261"/> to receive. If the "qop" parameter is not specified, then the default 
         value is "auth".
</t>
            <t pn="section-2.6-4.8.2">
         A UAS <bcp14>MUST</bcp14> always send a "qop" parameter in WWW-Authenticate
         and Proxy-Authenticate header field values, and a UAC <bcp14>MUST</bcp14>
         send the "qop" parameter in any resulting authorization header
         field.
            </t>
          </li>
        </ol>
        <t pn="section-2.6-5">
      The usage of the Authentication-Info header field continues to be
      allowed, since it provides integrity checks over the bodies and
      provides mutual authentication.
        </t>
      </section>
      <section anchor="abnf" numbered="true" removeInRFC="false" toc="include" pn="section-2.7">
        <name slugifiedName="name-abnf-for-sip">ABNF for SIP</name>
        <t pn="section-2.7-1">
      This document updates the ABNF <xref target="RFC5234" format="default" sectionFormat="of" derivedContent="RFC5234"/> for SIP as
      follows.
        </t>
        <t pn="section-2.7-2">
      It extends the request-digest as follows to allow for different
      digest sizes:
        </t>
        <sourcecode name="" type="abnf" markers="false" pn="section-2.7-3">
      request-digest = LDQUOT *LHEX RDQUOT
</sourcecode>
        <t pn="section-2.7-4">
      The number of hex digits is implied by the length of the value of the algorithm used, 
      with a minimum size of 32. A parameter with an empty value (empty string) 
      is allowed when the UAC has not yet received a challenge.
        </t>
        <t pn="section-2.7-5">
      It extends the algorithm parameter as follows to allow any algorithm 
      in the registry to be used:
        </t>
        <sourcecode name="" type="" markers="false" pn="section-2.7-6">
algorithm =  "algorithm" EQUAL ( "MD5" / "MD5-sess" / "SHA-256" /
"SHA-256-sess" /
"SHA-512-256" /  "SHA-512-256-sess" / token )
</sourcecode>
      </section>
    </section>
    <section anchor="security.considerations" numbered="true" removeInRFC="false" toc="include" pn="section-3">
      <name slugifiedName="name-security-considerations">Security Considerations</name>
      <t pn="section-3-1">
    This specification adds new secure algorithms to be used with the
    Digest mechanism to authenticate users. The obsolete MD5 algorithm
    remains only for backward compatibility with <xref target="RFC2617" format="default" sectionFormat="of" derivedContent="RFC2617"/>, but its use is
    <bcp14>NOT RECOMMENDED</bcp14>.
      </t>
      <t pn="section-3-2">
    This opens the system to the potential for a downgrade attack by an on-path attacker.
    The most effective way of dealing with this type of attack is to either validate the 
    client and challenge it accordingly or remove the support for backward compatibility 
    by not supporting MD5.
      </t>
      <t pn="section-3-3">
  See <xref target="RFC7616" sectionFormat="of" section="5" format="default" derivedLink="https://rfc-editor.org/rfc/rfc7616#section-5" derivedContent="RFC7616"/> for a detailed security discussion of
  the Digest Access Authentication scheme.
      </t>
    </section>
    <section anchor="iana.considerations" numbered="true" removeInRFC="false" toc="include" pn="section-4">
      <name slugifiedName="name-iana-considerations">IANA Considerations</name>
      <t pn="section-4-1">
   <xref target="RFC7616" format="default" sectionFormat="of" derivedContent="RFC7616"/> defines an IANA registry named "Hash Algorithms
   for HTTP Digest Authentication" to simplify the introduction of new
   algorithms in the future. This document specifies that algorithms defined in 
   that registry may be used in SIP digest authentication.
      </t>
      <t pn="section-4-2">
  This document has no actions for IANA.
      </t>
    </section>
  </middle>
  <back>
    <references pn="section-5">
      <name slugifiedName="name-references">References</name>
      <references pn="section-5.1">
        <name slugifiedName="name-normative-references">Normative References</name>
        <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 initials="S." surname="Bradner" fullname="S. Bradner">
              <organization showOnFrontPage="true"/>
            </author>
            <date year="1997" month="March"/>
            <abstract>
              <t>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="RFC3261" target="https://www.rfc-editor.org/info/rfc3261" quoteTitle="true" derivedAnchor="RFC3261">
          <front>
            <title>SIP: Session Initiation Protocol</title>
            <author initials="J." surname="Rosenberg" fullname="J. Rosenberg">
              <organization showOnFrontPage="true"/>
            </author>
            <author initials="H." surname="Schulzrinne" fullname="H. Schulzrinne">
              <organization showOnFrontPage="true"/>
            </author>
            <author initials="G." surname="Camarillo" fullname="G. Camarillo">
              <organization showOnFrontPage="true"/>
            </author>
            <author initials="A." surname="Johnston" fullname="A. Johnston">
              <organization showOnFrontPage="true"/>
            </author>
            <author initials="J." surname="Peterson" fullname="J. Peterson">
              <organization showOnFrontPage="true"/>
            </author>
            <author initials="R." surname="Sparks" fullname="R. Sparks">
              <organization showOnFrontPage="true"/>
            </author>
            <author initials="M." surname="Handley" fullname="M. Handley">
              <organization showOnFrontPage="true"/>
            </author>
            <author initials="E." surname="Schooler" fullname="E. Schooler">
              <organization showOnFrontPage="true"/>
            </author>
            <date year="2002" month="June"/>
            <abstract>
              <t>This document describes Session Initiation Protocol (SIP), an application-layer control (signaling) protocol for creating, modifying, and terminating sessions with one or more participants.  These sessions include Internet telephone calls, multimedia distribution, and multimedia conferences.  [STANDARDS-TRACK]</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="3261"/>
          <seriesInfo name="DOI" value="10.17487/RFC3261"/>
        </reference>
        <reference anchor="RFC7234" target="https://www.rfc-editor.org/info/rfc7234" quoteTitle="true" derivedAnchor="RFC7234">
          <front>
            <title>Hypertext Transfer Protocol (HTTP/1.1): Caching</title>
            <author initials="R." surname="Fielding" fullname="R. Fielding" role="editor">
              <organization showOnFrontPage="true"/>
            </author>
            <author initials="M." surname="Nottingham" fullname="M. Nottingham" role="editor">
              <organization showOnFrontPage="true"/>
            </author>
            <author initials="J." surname="Reschke" fullname="J. Reschke" role="editor">
              <organization showOnFrontPage="true"/>
            </author>
            <date year="2014" month="June"/>
            <abstract>
              <t>The Hypertext Transfer Protocol (HTTP) is a stateless \%application- level protocol for distributed, collaborative, hypertext information systems.  This document defines HTTP caches and the associated header fields that control cache behavior or indicate cacheable response messages.</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="7234"/>
          <seriesInfo name="DOI" value="10.17487/RFC7234"/>
        </reference>
        <reference anchor="RFC7616" target="https://www.rfc-editor.org/info/rfc7616" quoteTitle="true" derivedAnchor="RFC7616">
          <front>
            <title>HTTP Digest Access Authentication</title>
            <author initials="R." surname="Shekh-Yusef" fullname="R. Shekh-Yusef" role="editor">
              <organization showOnFrontPage="true"/>
            </author>
            <author initials="D." surname="Ahrens" fullname="D. Ahrens">
              <organization showOnFrontPage="true"/>
            </author>
            <author initials="S." surname="Bremer" fullname="S. Bremer">
              <organization showOnFrontPage="true"/>
            </author>
            <date year="2015" month="September"/>
            <abstract>
              <t>The Hypertext Transfer Protocol (HTTP) provides a simple challenge- response authentication mechanism that may be used by a server to challenge a client request and by a client to provide authentication information.  This document defines the HTTP Digest Authentication scheme that can be used with the HTTP authentication mechanism.</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="7616"/>
          <seriesInfo name="DOI" value="10.17487/RFC7616"/>
        </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 initials="B." surname="Leiba" fullname="B. Leiba">
              <organization showOnFrontPage="true"/>
            </author>
            <date year="2017" month="May"/>
            <abstract>
              <t>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="SHA2" quoteTitle="true" target="https://doi.org/10.6028/NIST.FIPS.180-4" derivedAnchor="SHA2">
          <front>
            <title abbrev="SHA">Secure Hash Standard (SHS)</title>
            <seriesInfo name="DOI" value="10.6028/NIST.FIPS.180-4"/>
            <seriesInfo name="FIPS" value="180-4"/>
            <author>
              <organization showOnFrontPage="true">National Institute of Standards and Technology</organization>
            </author>
            <date month="August" year="2015"/>
          </front>
        </reference>
      </references>
      <references pn="section-5.2">
        <name slugifiedName="name-informative-references">Informative References</name>
        <reference anchor="RFC2617" target="https://www.rfc-editor.org/info/rfc2617" quoteTitle="true" derivedAnchor="RFC2617">
          <front>
            <title>HTTP Authentication: Basic and Digest Access Authentication</title>
            <author initials="J." surname="Franks" fullname="J. Franks">
              <organization showOnFrontPage="true"/>
            </author>
            <author initials="P." surname="Hallam-Baker" fullname="P. Hallam-Baker">
              <organization showOnFrontPage="true"/>
            </author>
            <author initials="J." surname="Hostetler" fullname="J. Hostetler">
              <organization showOnFrontPage="true"/>
            </author>
            <author initials="S." surname="Lawrence" fullname="S. Lawrence">
              <organization showOnFrontPage="true"/>
            </author>
            <author initials="P." surname="Leach" fullname="P. Leach">
              <organization showOnFrontPage="true"/>
            </author>
            <author initials="A." surname="Luotonen" fullname="A. Luotonen">
              <organization showOnFrontPage="true"/>
            </author>
            <author initials="L." surname="Stewart" fullname="L. Stewart">
              <organization showOnFrontPage="true"/>
            </author>
            <date year="1999" month="June"/>
            <abstract>
              <t>This document provides the specification for HTTP's authentication framework, the original Basic authentication scheme and a scheme based on cryptographic hashes, referred to as "Digest Access Authentication". [STANDARDS-TRACK]</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="2617"/>
          <seriesInfo name="DOI" value="10.17487/RFC2617"/>
        </reference>
        <reference anchor="RFC5234" target="https://www.rfc-editor.org/info/rfc5234" quoteTitle="true" derivedAnchor="RFC5234">
          <front>
            <title>Augmented BNF for Syntax Specifications: ABNF</title>
            <author initials="D." surname="Crocker" fullname="D. Crocker" role="editor">
              <organization showOnFrontPage="true"/>
            </author>
            <author initials="P." surname="Overell" fullname="P. Overell">
              <organization showOnFrontPage="true"/>
            </author>
            <date year="2008" month="January"/>
            <abstract>
              <t>Internet technical specifications often need to define a formal syntax.  Over the years, a modified version of Backus-Naur Form (BNF), called Augmented BNF (ABNF), has been popular among many Internet specifications.  The current specification documents ABNF. It balances compactness and simplicity with reasonable representational power.  The differences between standard BNF and ABNF involve naming rules, repetition, alternatives, order-independence, and value ranges.  This specification also supplies additional rule definitions and encoding for a core lexical analyzer of the type common to several Internet specifications.  [STANDARDS-TRACK]</t>
            </abstract>
          </front>
          <seriesInfo name="STD" value="68"/>
          <seriesInfo name="RFC" value="5234"/>
          <seriesInfo name="DOI" value="10.17487/RFC5234"/>
        </reference>
        <reference anchor="RFC6151" target="https://www.rfc-editor.org/info/rfc6151" quoteTitle="true" derivedAnchor="RFC6151">
          <front>
            <title>Updated Security Considerations for the MD5 Message-Digest and the HMAC-MD5 Algorithms</title>
            <author initials="S." surname="Turner" fullname="S. Turner">
              <organization showOnFrontPage="true"/>
            </author>
            <author initials="L." surname="Chen" fullname="L. Chen">
              <organization showOnFrontPage="true"/>
            </author>
            <date year="2011" month="March"/>
            <abstract>
              <t>This document updates the security considerations for the MD5 message digest algorithm.  It also updates the security considerations for HMAC-MD5.  This document is not an Internet Standards Track  specification; it is published for informational purposes.</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="6151"/>
          <seriesInfo name="DOI" value="10.17487/RFC6151"/>
        </reference>
      </references>
    </references>
    <section anchor="acknowledgments" numbered="false" removeInRFC="false" toc="include" pn="section-appendix.a">
      <name slugifiedName="name-acknowledgments">Acknowledgments</name>
      <t pn="section-appendix.a-1">
    The author would like to thank the following individuals
    for their careful review, comments, and suggestions: <contact fullname="Paul Kyzivat"/>,
    <contact fullname="Olle Johansson"/>, <contact fullname="Dale Worley"/>, <contact fullname="Michael Procter"/>, <contact fullname="Inaki Baz Castillo"/>,
    <contact fullname="Tolga Asveren"/>, <contact fullname="Christer Holmberg"/>, <contact fullname="Brian Rosen"/>, <contact fullname="Jean Mahoney"/>, <contact fullname="Adam Roach"/>, 
    <contact fullname="Barry Leiba"/>, <contact fullname="Roni Even"/>, <contact fullname="Eric Vyncke"/>, <contact fullname="Benjamin Kaduk"/>, <contact fullname="Alissa Cooper"/>, <contact fullname="Roman Danyliw"/>, <contact fullname="Alexey Melnikov"/>, and <contact fullname="Maxim Sobolev"/>.
      </t>
    </section>
    <section anchor="authors-addresses" numbered="false" removeInRFC="false" toc="include" pn="section-appendix.b">
      <name slugifiedName="name-authors-address">Author's Address</name>
      <author initials="R." surname="Shekh-Yusef" fullname="Rifaat Shekh-Yusef">
        <organization showOnFrontPage="true">Avaya</organization>
        <address>
          <postal>
            <street>425 Legget Dr.</street>
            <city>Ottawa</city>
            <region>Ontario</region>
            <country>Canada</country>
          </postal>
          <phone>+1-613-595-9106</phone>
          <email>rifaat.ietf@gmail.com</email>
        </address>
      </author>
    </section>
  </back>
</rfc>
