idnits 2.17.1 draft-yusef-sipcore-digest-scheme-06.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- -- The draft header indicates that this document updates RFC3261, but the abstract doesn't seem to mention this, which it should. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year (Using the creation date from RFC3261, updated by this document, for RFC5378 checks: 2000-07-17) -- The document seems to contain a disclaimer for pre-RFC5378 work, and may have content which was first submitted before 10 November 2008. The disclaimer is necessary when there are original authors that you have been unable to contact, or if some do not wish to grant the BCP78 rights to the IETF Trust. If you are able to get all authors (current and original) to grant those rights, you can and should remove the disclaimer; otherwise, the disclaimer is needed and you can ignore this comment. (See the Legal Provisions document at https://trustee.ietf.org/license-info for more information.) -- The document date (September 18, 2017) is 2411 days in the past. Is this intentional? Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) ** Obsolete normative reference: RFC 7234 (Obsoleted by RFC 9111) Summary: 1 error (**), 0 flaws (~~), 1 warning (==), 3 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 SIP Core R. Shekh-Yusef 3 Internet-Draft Avaya 4 Updates: 3261 (if approved) September 18, 2017 5 Intended status: Standards Track 6 Expires: March 22, 2018 8 The Session Initiation Protocol (SIP) Digest Authentication Scheme 9 draft-yusef-sipcore-digest-scheme-06 11 Abstract 13 This document updates the Digest Access Authentication scheme used by 14 the Session Initiation Protocol (SIP) to add support for SHA2 digest 15 algorithms to replace the MD5 algorithm. 17 Status of This Memo 19 This Internet-Draft is submitted in full conformance with the 20 provisions of BCP 78 and BCP 79. 22 Internet-Drafts are working documents of the Internet Engineering 23 Task Force (IETF). Note that other groups may also distribute 24 working documents as Internet-Drafts. The list of current Internet- 25 Drafts is at https://datatracker.ietf.org/drafts/current/. 27 Internet-Drafts are draft documents valid for a maximum of six months 28 and may be updated, replaced, or obsoleted by other documents at any 29 time. It is inappropriate to use Internet-Drafts as reference 30 material or to cite them other than as "work in progress." 32 This Internet-Draft will expire on March 22, 2018. 34 Copyright Notice 36 Copyright (c) 2017 IETF Trust and the persons identified as the 37 document authors. All rights reserved. 39 This document is subject to BCP 78 and the IETF Trust's Legal 40 Provisions Relating to IETF Documents 41 (https://trustee.ietf.org/license-info) in effect on the date of 42 publication of this document. Please review these documents 43 carefully, as they describe your rights and restrictions with respect 44 to this document. Code Components extracted from this document must 45 include Simplified BSD License text as described in Section 4.e of 46 the Trust Legal Provisions and are provided without warranty as 47 described in the Simplified BSD License. 49 This document may contain material from IETF Documents or IETF 50 Contributions published or made publicly available before November 51 10, 2008. The person(s) controlling the copyright in some of this 52 material may not have granted the IETF Trust the right to allow 53 modifications of such material outside the IETF Standards Process. 54 Without obtaining an adequate license from the person(s) controlling 55 the copyright in such materials, this document may not be modified 56 outside the IETF Standards Process, and derivative works of it may 57 not be created outside the IETF Standards Process, except to format 58 it for publication as an RFC or to translate it into languages other 59 than English. 61 Table of Contents 63 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2 64 1.1. Terminology . . . . . . . . . . . . . . . . . . . . . . . 3 65 2. The SIP Digest Authentication Scheme . . . . . . . . . . . . 3 66 2.1. Hash Algorithms . . . . . . . . . . . . . . . . . . . . . 3 67 2.2. Representation of Digest Values . . . . . . . . . . . . . 3 68 2.3. The Authenticate Response Header . . . . . . . . . . . . 4 69 2.4. The Authorization Request Header . . . . . . . . . . . . 4 70 2.5. Forking . . . . . . . . . . . . . . . . . . . . . . . . . 4 71 2.6. HTTP Modifications . . . . . . . . . . . . . . . . . . . 5 72 3. Augmented BNF for the SIP Protocol . . . . . . . . . . . . . 6 73 4. Security Considerations . . . . . . . . . . . . . . . . . . . 7 74 5. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 7 75 6. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . 7 76 7. Normative References . . . . . . . . . . . . . . . . . . . . 7 77 Author's Address . . . . . . . . . . . . . . . . . . . . . . . . 8 79 1. Introduction 81 The SIP protocol [RFC3261] uses the same mechanism used by the HTTP 82 protocol for authenticating users, which is a simple challenge- 83 response authentication mechanism that allows a server to challenge a 84 client request and allows a client to provide authentication 85 information in response to that challenge. 87 The SIP protocol uses the Digest Authentication scheme that is used 88 with the HTTP authentication mechanism, which by default uses MD5 as 89 the default algorithm. 91 The HTTP Digest Access Authentication [RFC7616] document defines the 92 Digest Authentication scheme and defines a few algorithms that could 93 be used with the Digest Authentication scheme, and establishes a 94 registry for these algorithms to allow for additional algorithms to 95 be added in the future. 97 This document updates the Digest Access Authentication scheme used by 98 SIP to add support for SHA2 digest algorithms to replace the MD5 99 algorithm. 101 1.1. Terminology 103 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 104 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 105 document are to be interpreted as described in [RFC2119]. 107 2. The SIP Digest Authentication Scheme 109 This section describes the modifications to the operation of the 110 Digest mechanism as specified in [RFC3261] in order to support the 111 SHA- 256 and SHA-512/256 algorithms as described in [RFC7616], and 112 also to require support for the "qop" option." 114 2.1. Hash Algorithms 116 The Digest scheme has an 'algorithm' parameter that specifies the 117 algorithm to be used to compute the digest of the response. The IANA 118 registry named "HTTP Digest Hash Algorithms" specifies the algorithms 119 that correspond to 'algorithm' values, and specifies a priority for 120 each algorithm. 122 [RFC3261] specifies only one algorithm, MD5, which is used by 123 default. This document extends [RFC3261] to allow use of any 124 registered algorithm. 126 The priority of the algorithm defines its usage preference. UAs 127 SHOULD prefer algorithms with higher priorities. 129 Note that [RFC7616] defines a -sess variant for each algorithm; the 130 -sess variants are not used with SIP. 132 2.2. Representation of Digest Values 134 The size of the digest depends on the algorithm used. The bits in 135 the digest are converted from the most significant to the least 136 significant bit, four bits at a time to the ASCII representation as 137 follows. Each four bits is represented by its familiar hexadecimal 138 notation from the characters 0123456789abcdef, that is binary 0000 is 139 represented by the character '0', 0001 by '1' and so on up to the 140 representation of 1111 as 'f'. If the MD5 algorithm is used to 141 calculate the digest, then the digest will be represented as 32 142 hexadecimal characters, SHA-256 and SHA-512/256 by 64 hexadecimal 143 characters. 145 2.3. The Authenticate Response Header 147 When a UAS receives a request from a UAC, and an acceptable 148 Authorization header is not sent, the UAS can challenge the 149 originator to provide credentials by rejecting the request with a 150 401/407 status code with the WWW-Authenticate/Proxy-Authenticate 151 header field. The UAS MAY include multiple WWW-Authenticate/Proxy- 152 Authenticate headers to allow the UAS to utilize the best available 153 algorithm supported by the client. 155 If the UAS challenges with multiple WWW-Authenticate/Proxy- 156 Authenticate headers with the same realm, then each one of these 157 headers MUST use a different digest algorithm. The UAS MUST add 158 these headers to the response in the order that it would prefer to 159 see them used, starting with the most preferred algorithm at the top, 160 followed by the less preferred algorithms. 162 2.4. The Authorization Request Header 164 When the UAC receives a response with multiple headers with the same 165 realm it SHOULD use the topmost header that it supports, unless a 166 local policy dictates otherwise. The client MUST ignore any 167 challenge it does not understand. 169 When the UAC receives a 401 response with multiple WWW-Authenticate 170 headers with different realms it SHOULD retry and include an 171 Authorization header containing credentials that match the topmost 172 header of any one of the realms. 174 If the UAC cannot respond to any of the challenges in the response, 175 then it should abandon attempts to send the request; e.g., if the UAC 176 does not have credentials for any of the realms. 178 2.5. Forking 180 Section 22.3 of [RFC3261] discusses the operation of the proxy-to- 181 user authentication, which describes the operation of the proxy when 182 it forks a request. This section introduces some clarification to 183 that operation. 185 If a request is forked, various proxy servers and/or UAs may wish to 186 challenge the UAC. In this case, the forking proxy server is 187 responsible for aggregating these challenges into a single response. 188 Each WWW-Authenticate and Proxy-Authenticate value received in 189 responses to the forked request MUST be placed into the single 190 response that is sent by the forking proxy to the UA. 192 When the forking proxy places multiple WWW-Authenticate and Proxy- 193 Authenticate header fields from one received response into the single 194 response it MUST maintain the order of these header fields. The 195 ordering of the header field values from the various proxies is not 196 significant. 198 2.6. HTTP Modifications 200 This section describes the modifications and clarifications required 201 to apply the HTTP Digest authentication scheme to SIP. The SIP 202 scheme usage is similar to that for HTTP. The changes specified here 203 are mostly copied from section 22.4 of [RFC3261] with few changes. 205 SIP clients and servers MUST NOT accept or request Basic 206 authentication. 208 The rules for Digest authentication follow those defined in HTTP, 209 with "HTTP/1.1" replaced by "SIP/2.0" in addition to the following 210 differences: 212 1. The URI included in the challenge has the following BNF: 214 URI = Request-URI 216 2. The 'uri' parameter of the Authorization header field MUST be 217 enclosed in quotation marks. 219 3. The BNF for digest-uri-value is: 221 digest-uri-value = Request-URI 223 4. The example procedure for choosing a nonce based on Etag does not 224 work for SIP. 226 5. The text in [RFC7234] regarding cache operation does not apply to 227 SIP. 229 6. [RFC7616] requires that a server check that the URI in the 230 request line and the URI included in the Authorization header field 231 point to the same resource. In a SIP context, these two URIs may 232 refer to different users, due to forwarding at some proxy. 233 Therefore, in SIP, a server MAY check that the Request-URI in the 234 Authorization header field value corresponds to a user for whom the 235 server is willing to accept forwarded or direct requests, but it is 236 not necessarily a failure if the two fields are not equivalent. 238 7. As a clarification to the calculation of the A2 value for message 239 integrity assurance in the Digest authentication scheme, implementers 240 should assume, when the entity-body is empty (that is, when SIP 241 messages have no body) that the hash of the entity-body resolves to 242 the hash of an empty string: 244 H(entity-body) = ("") 246 For example, when the chosen algorithm is SHA-256, then: 248 H(entity-body) = SHA-256("") = 249 "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" 251 8. Servers MUST be able to properly handle "qop" parameter received 252 in an authorization header field, and clients MUST be able to 253 properly handle "qop" parameter received in WWW-Authenticate and 254 Proxy-Authenticate header fields. Servers MUST always send a "qop" 255 parameter in WWW-Authenticate and Proxy-Authenticate header field 256 values, and clients MUST send the "qop" parameter in any resulting 257 authorization header field. 259 The usage of the Authentication-Info header field continue to be 260 allowed, since it provides integrity checks over the bodies and 261 provides mutual authentication. 263 3. Augmented BNF for the SIP Protocol 265 This document updates the Augmented BNF for the SIP Protocol as 266 follows. 268 It extends the request-digest as follows to allow for different 269 digest sizes: 271 request-digest = LDQUOT *LHEX RDQUOT 273 The number of hex digits must be specified by the specification of 274 the algorithm used. 276 It extends the algorithm parameter as follows to allow for SHA2 277 algorithms to be used: 279 algorithm = "algorithm" EQUAL ( "MD5" / "SHA-512-256" / "SHA-256" 280 / token ) 282 4. Security Considerations 284 This specification adds new secure algorithms to be used to with the 285 Digest mechanism to authenticate users, but leaves the broken MD5 286 algorithm for backward compatibility. 288 This opens the system to the potential of a downgrade attack by man- 289 in-the-middle. The most effective way of dealing with this type of 290 attack is to remove the support for backward compatibility. 292 See section 5 of [RFC7616] for a detailed security discussion of the 293 Digest scheme. 295 5. IANA Considerations 297 [RFC7616] defines an IANA registry named "Hash Algorithms for HTTP 298 Digest Authentication" to simplify the introduction of new algorithms 299 in the future. This document will use the algorithms defined in that 300 registry. 302 6. Acknowledgments 304 The author would like to thank the following individuals for their 305 careful reviews, comments, and suggestions: Paul Kyzivat, Olle 306 Johansson, Dale Worley, Michael Procter, Inaki Baz Castillo, and 307 Tolga Asveren. 309 7. Normative References 311 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 312 Requirement Levels", BCP 14, RFC 2119, March 1997. 314 [RFC3261] Rosenberg, J., Schulzrinne, H., Camarillo, H., Johnston, 315 A., Peterson, J., Sparks, R., Handley, M., and E. 316 Schooler, "SIP: Session Initiation Protocol", RFC 3261, 317 June 2002. 319 [RFC7234] Fielding, R., Nottingham, M., and J. Reschke, "Hypertext 320 Transfer Protocol (HTTP/1.1): Caching", RFC 7234, June 321 2014. 323 [RFC7616] Shekh-Yusef, R., Ahrens, D., and S. Bremer, "HTTP Digest 324 Access Authentication", RFC 7616, September 2015. 326 Author's Address 328 Rifaat Shekh-Yusef 329 Avaya 330 250 Sidney Street 331 Belleville, Ontario 332 Canada 334 Phone: +1-613-967-5176 335 EMail: rifaat.ietf@gmail.com