idnits 2.17.1 draft-ietf-bfd-hmac-sha-04.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 : ---------------------------------------------------------------------------- No issues found here. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year -- The document date (October 15, 2013) is 3839 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) == Unused Reference: 'RFC6039' is defined on line 312, but no explicit reference was found in the text == Unused Reference: 'Dobb96a' is defined on line 326, but no explicit reference was found in the text == Unused Reference: 'Dobb96b' is defined on line 328, but no explicit reference was found in the text == Unused Reference: 'I-D.ietf-karp-design-guide' is defined on line 331, but no explicit reference was found in the text == Unused Reference: 'MD5-attack' is defined on line 336, but no explicit reference was found in the text -- Possible downref: Non-RFC (?) normative reference: ref. 'FIPS-180-2' -- Possible downref: Non-RFC (?) normative reference: ref. 'FIPS-198' == Outdated reference: A later version (-06) exists of draft-ietf-bfd-generic-crypto-auth-04 ** Downref: Normative reference to an Informational RFC: RFC 6039 ** Downref: Normative reference to an Informational RFC: RFC 6151 ** Downref: Normative reference to an Informational RFC: RFC 6194 Summary: 3 errors (**), 0 flaws (~~), 7 warnings (==), 3 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 Network Working Group D. Zhang 3 Internet-Draft Huawei 4 Intended status: Standards Track M. Bhatia 5 Expires: April 18, 2014 Alcatel-Lucent 6 V. Manral 7 Hewlett-Packard Co. 8 October 15, 2013 10 Authenticating BFD using HMAC-SHA-2 procedures 11 draft-ietf-bfd-hmac-sha-04 13 Abstract 15 This document describes the mechanism to authenticate Bidirectional 16 Forwarding Detection (BFD) protocol packets using Hashed Message 17 Authentication Mode (HMAC) with the SHA-256, SHA-384, and SHA-512 18 algorithms. The described mechanism uses the Generic Cryptographic 19 Authentication and Generic Meticulous Cryptographic Authentication 20 sections to carry the authentication data. This document updates, 21 but does not supercede, the cryptographic authentication mechanism 22 specified in RFC 5880. 24 Requirements Language 26 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 27 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 28 document are to be interpreted as described in RFC 2119 [RFC2119]. 30 Status of This Memo 32 This Internet-Draft is submitted in full conformance with the 33 provisions of BCP 78 and BCP 79. 35 Internet-Drafts are working documents of the Internet Engineering 36 Task Force (IETF). Note that other groups may also distribute 37 working documents as Internet-Drafts. The list of current Internet- 38 Drafts is at http://datatracker.ietf.org/drafts/current/. 40 Internet-Drafts are draft documents valid for a maximum of six months 41 and may be updated, replaced, or obsoleted by other documents at any 42 time. It is inappropriate to use Internet-Drafts as reference 43 material or to cite them other than as "work in progress." 45 This Internet-Draft will expire on April 18, 2014. 47 Copyright Notice 48 Copyright (c) 2013 IETF Trust and the persons identified as the 49 document authors. All rights reserved. 51 This document is subject to BCP 78 and the IETF Trust's Legal 52 Provisions Relating to IETF Documents 53 (http://trustee.ietf.org/license-info) in effect on the date of 54 publication of this document. Please review these documents 55 carefully, as they describe your rights and restrictions with respect 56 to this document. Code Components extracted from this document must 57 include Simplified BSD License text as described in Section 4.e of 58 the Trust Legal Provisions and are provided without warranty as 59 described in the Simplified BSD License. 61 Table of Contents 63 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2 64 2. Cryptographic Aspects . . . . . . . . . . . . . . . . . . . . 3 65 3. Procedures at the Sending Side . . . . . . . . . . . . . . . 4 66 4. Procedure at the Receiving Side . . . . . . . . . . . . . . . 5 67 5. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 6 68 6. Security Considerations . . . . . . . . . . . . . . . . . . . 6 69 7. References . . . . . . . . . . . . . . . . . . . . . . . . . 7 70 7.1. Normative References . . . . . . . . . . . . . . . . . . 7 71 7.2. Informative References . . . . . . . . . . . . . . . . . 7 72 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 9 74 1. Introduction 76 The cryptographic authentication mechanisms specified in [RFC5880] 77 defines MD5 [RFC1321] and Secure Hash Algorithm (SHA-1) algorithms to 78 authenticate BFD packets. The recent escalating series of attacks on 79 MD5 and SHA-1 [SHA-1-attack1] [SHA-1-attack2] raise concerns about 80 their remaining useful lifetime [RFC6151] [RFC6194]. 82 These attacks may not necessarily result in direct vulnerabilities 83 for Keyed-MD5 and Keyed-SHA-1 digests as message authentication codes 84 because the colliding message may not correspond to a syntactically 85 correct BFD protocol packet. Regardless, there is a need felt to 86 deprecate MD5 and SHA-1 as the basis for the HMAC algorithm in favor 87 of stronger digest algorithms. 89 This document adds support for Secure Hash Algorithms (SHA) defined 90 in the US NIST Secure Hash Standard (SHS), which is defined by NIST 91 FIPS 180-2 [FIPS-180-2]. [FIPS-180-2] includes SHA-1, SHA-224, 92 SHA-256, SHA-384, and SHA-512. The HMAC authentication mode defined 93 in NIST FIPS 198 is used [FIPS-198]. 95 It is believed that the HMAC algorithms defined in [RFC2104] is 96 mathematically identical to their counterparts in [FIPS-198] and it 97 is also believed that algorithms in [RFC6234] are mathematically 98 identical to those defined in [FIPS-180-2]. 100 It should be noted that the collision attacks currently known against 101 SHA-1 do not apply when SHA-1 is used in the HMAC construction. NIST 102 will be supporting HMAC-SHA-1 even after 2010 [NIST-HMAC-SHA] , 103 whereas it would be dropping support for SHA-1 in digital signatures. 105 [I-D.ietf-bfd-generic-crypto-auth] defines new authentication types - 106 Generic Cryptographic Authentication and Generic Meticulous 107 Cryptographic Authentication that can be used for carrying the 108 authentication digests defined in this document. 110 Implementations of this specification must include support for at 111 least HMAC-SHA-256 and may include support for either of HMAC-SHA-384 112 or HMAC-SHA-512. 114 2. Cryptographic Aspects 116 In the algorithm description below, the following nomenclature, which 117 is consistent with [FIPS-198], is used: 119 H is the specific hashing algorithm (e.g. SHA-256). 121 K is the password for the BFD packet. 123 Ko is the cryptographic key used with the hash algorithm. 125 B is the block size of H, measured in octets rather than bits. Note 126 that B is the internal block size, not the hash size. For SHA-1 and 127 SHA-256: B == 64 For SHA-384 and SHA-512: B == 128 L is the length of 128 the hash, measured in octets rather than bits. 130 XOR is the exclusive-or operation. 132 Opad is the hexadecimal value 0x5c repeated B times. 134 Ipad is the hexadecimal value 0x36 repeated B times. 136 Apad is the hexadecimal value 0x878FE1F3 repeated (L/4) times. 138 (1) Preparation of the Key 140 In this application, Ko is always L octets long. 142 If the Authentication Key (K) is L octets long, then Ko is equal to 143 K. If the Authentication Key (K) is more than L octets long, then Ko 144 is set to H(K). If the Authentication Key (K) is less than L octets 145 long, then Ko is set to the Authentication Key (K) with zeros 146 appended to the end of the Authentication Key (K) such that Ko is L 147 octets long. 149 (2) First Hash 151 First, the Authentication Data field in the Generic Authentication 152 Section is filled with the value of Apad and the Authentication Type 153 field is set to 6 or 7 depending upon which Authentication Type is 154 being used. The Sequence Number field MUST be set to 155 bfd.XmitAuthSeq. 157 Then, a first hash, also known as the inner hash, is computed as 158 follows: 160 First-Hash = H(Ko XOR Ipad || (BFD Packet)) 162 (3) Second Hash T 164 Then a second hash, also known as the outer hash, is computed as 165 follows: 167 Second-Hash = H(Ko XOR Opad || First-Hash) 169 (4) Result 171 The resultant Second-Hash becomes the Authentication Data that is 172 sent in the Authentication Data field of the BFD Authentication 173 Section. The length of the Authentication Data field is always 174 identical to the message digest size of the specific hash function H 175 that is being used. 177 This also means that the use of hash functions with larger output 178 sizes will also increase the size of BFD Packet as transmitted on the 179 wire. 181 3. Procedures at the Sending Side 183 Before a BFD device sends a BFD packet out, the device needs to 184 select an appropriate BFD SA from its local key table if a keyed 185 digest for the packet is required. If no appropriate SA is 186 avaliable, the BFD packet MUST be discarded. 188 If an appropriate SA is avaliable, the device then derives the key 189 and the associated authentication algorithm (HMAC-SHA-256, HMAC- 190 SHA-384 or HMAC-SHA-512) from the SA. 192 The device then start performing the operations illustrated in 193 Section 2. Before the authentication data is computed, the device 194 MUST fill the Auth Type field and the Auth length field. The 195 Sequence Number field MUST be set to bfd.XmitAuthSeq. 197 The value of Auth Length in the generic authentication section is 198 various according to different authentication algorithms being used. 199 Specifically, the value is 40 for HMAC-SHA-256, 56 for HMAC-SHA-384, 200 and 72 for HMAC- SHA-512. 202 The Key ID is then filled. 204 After that, the authentication data is computed as illustrated in 205 Section 2. 207 The result of the authentication algorithm is placed in the 208 Authentication data, following the Key ID. 210 4. Procedure at the Receiving Side 212 Upon receiving a BFD packet with an generic authentication section 213 appended, a device needs to find an appropriate BFD SA from its local 214 key table to verify the packet. The SA is located by the Key ID in 215 the authentication section of the packet. 217 If there is no SA is associated with the Key ID, the received packet 218 MUST be discarded. 220 If bfd.AuthSeqKnown is 1, the Sequence Number field is examined. For 221 Cryptographic Authentication, if the Sequence Number lies outside of 222 the range of bfd.RcvAuthSeq to bfd.RcvAuthSeq+(3*Detect Mult) 223 inclusive (when treated as an unsigned 32 bit circular number space), 224 the received packet MUST be discarded. For Meticulous Cryptographic 225 Authentication, if the Sequence Number lies outside of the range of 226 bfd.RcvAuthSeq+1 to bfd.RcvAuthSeq+(3*Detect Mult) inclusive (when 227 treated as an unsigned 32 bit circular number space, the received 228 packet MUST be discarded. 230 An authentication Algorithm dependent process then needs to be 231 performed by using the algorithm specified by the appropriate BFD SA 232 for the received packet. 234 Before the device performs any processing, it needs to save the 235 content of the Authentication Value field and set the Authentication 236 Value field with Apad. 238 The device then computes the authentication data as illustrated in 239 Section 2. The calculated data is compared with the received 240 authentication data in the packet. 242 The packet MUST be discarded if the calculated and the received 243 authentication data do not match. In this case, an error event 244 SHOULD be logged. 246 A BFD implementation MAY be in a transition mode where it includes 247 CRYPTO_AUTH or the MET_CRYPTO_AUTH information in packets but never 248 verifies it. This is provided as a transition aid for networks in 249 the process of migrating to the new CRYPTO_AUTH and MET_CRYPTO_AUTH 250 based authentication schemes. 252 5. IANA Considerations 254 This document makes no request of IANA. 256 Note to RFC Editor: this section may be removed on publication as an 257 RFC. 259 6. Security Considerations 261 The approach described in this document enhances the security of the 262 BFD protocol by adding, to the existing BFD cryptographic 263 authentication methods, support for the SHA-2 algorithms defined in 264 the NIST Secure Hash Standard (SHS) using the HMAC mode. However, 265 the confidentiality protection for BFD packets is out of scope of 266 this work . 268 Because all of the currently specified algorithms use symmetric 269 cryptography, one cannot authenticate precisely which BFD device sent 270 a given packet. However, one can authenticate that the sender knew 271 the BFD Security Association (including the BFD SA's parameters) 272 currently in use. 274 To enhance system security, the applied keys should be changed 275 periodically and implementations SHOULD be able to store and use more 276 than one key at the same time. The quality of the security provided 277 by the cryptographic authentication option depends completely on the 278 strength of the cryptographic algorithm and cryptographic mode in 279 use, the strength of the key being used, and the correct 280 implementation of the security mechanism in all communicating BFD 281 implementations. Accordingly, the use of high assurance development 282 methods is recommended. It also requires that all parties maintain 283 the secrecy of the shared secret key. [RFC4086] provides guidance on 284 methods for generating cryptographically random bits. 286 The value Apad is used here primarily for consistency with IETF 287 specifications for HMAC-SHA authentication for RIPv2 [RFC4822], IS-IS 288 [RFC5310] and OSPFv2 [RFC5709]. 290 7. References 292 7.1. Normative References 294 [FIPS-180-2] 295 National Institute of Standards and Technology, FIPS PUB 296 180-2, "The Keyed-Hash Message Authentication Code 297 (HMAC)", August 2002. 299 [FIPS-198] 300 National Institute of Standards and Technology, FIPS PUB 301 198, "The Keyed-Hash Message Authentication Code (HMAC)", 302 March 2002. 304 [I-D.ietf-bfd-generic-crypto-auth] 305 Bhatia, M., Manral, V., and D. Zhang, "BFD Generic 306 Cryptographic Authentication", draft-ietf-bfd-generic- 307 crypto-auth-04 (work in progress), April 2013. 309 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 310 Requirement Levels", BCP 14, RFC 2119, March 1997. 312 [RFC6039] Manral, V., Bhatia, M., Jaeggli, J., and R. White, "Issues 313 with Existing Cryptographic Protection Methods for Routing 314 Protocols", RFC 6039, October 2010. 316 [RFC6151] Turner, S. and L. Chen, "Updated Security Considerations 317 for the MD5 Message-Digest and the HMAC-MD5 Algorithms", 318 RFC 6151, March 2011. 320 [RFC6194] Polk, T., Chen, L., Turner, S., and P. Hoffman, "Security 321 Considerations for the SHA-0 and SHA-1 Message-Digest 322 Algorithms", RFC 6194, March 2011. 324 7.2. Informative References 326 [Dobb96a] Dobbertin, H., "Cryptanalysis of MD5 Compress", May 1996. 328 [Dobb96b] Dobbertin, H., "The Status of MD5 After a Recent Attack", 329 CryptoBytes", 1996. 331 [I-D.ietf-karp-design-guide] 332 Lebovitz, G. and M. Bhatia, "Keying and Authentication for 333 Routing Protocols (KARP) Design Guidelines", draft-ietf- 334 karp-design-guide-10 (work in progress), December 2011. 336 [MD5-attack] 337 Wang, X., Feng, D., Lai, X., and H. Yu, "Collisions for 338 Hash Functions MD4, MD5, HAVAL-128 and RIPEMD", August 339 2004. 341 [NIST-HMAC-SHA] 342 National Institute of Standards and Technology, Available 343 online at http://csrc.nist.gov/groups/ST/hash/policy.html, 344 "NIST's Policy on Hash Functions", 2006. 346 [RFC1321] Rivest, R., "The MD5 Message-Digest Algorithm", RFC 1321, 347 April 1992. 349 [RFC2104] Krawczyk, H., Bellare, M., and R. Canetti, "HMAC: Keyed- 350 Hashing for Message Authentication", RFC 2104, February 351 1997. 353 [RFC4086] Eastlake, D., Schiller, J., and S. Crocker, "Randomness 354 Requirements for Security", BCP 106, RFC 4086, June 2005. 356 [RFC4822] Atkinson, R. and M. Fanto, "RIPv2 Cryptographic 357 Authentication", RFC 4822, February 2007. 359 [RFC5310] Bhatia, M., Manral, V., Li, T., Atkinson, R., White, R., 360 and M. Fanto, "IS-IS Generic Cryptographic 361 Authentication", RFC 5310, February 2009. 363 [RFC5709] Bhatia, M., Manral, V., Fanto, M., White, R., Barnes, M., 364 Li, T., and R. Atkinson, "OSPFv2 HMAC-SHA Cryptographic 365 Authentication", RFC 5709, October 2009. 367 [RFC5880] Katz, D. and D. Ward, "Bidirectional Forwarding Detection 368 (BFD)", RFC 5880, June 2010. 370 [RFC6234] Eastlake, D. and T. Hansen, "US Secure Hash Algorithms 371 (SHA and SHA-based HMAC and HKDF)", RFC 6234, May 2011. 373 [SHA-1-attack1] 374 Wang, X., Yin, Y., and H. Yu, "Finding Collisions in the 375 Full SHA-1", 2005. 377 [SHA-1-attack2] 378 Wang, X., Yao, A., and F. Yao, "New Collision Search for 379 SHA-1", 2005. 381 Authors' Addresses 383 Dacheng Zhang 384 Huawei 385 Beijing 386 China 388 Email: zhangdacheng@huawei.com 390 Manav Bhatia 391 Alcatel-Lucent 392 Bangalore 560045 393 India 395 Email: manav.bhatia@alcatel-lucent.com 397 Vishwas Manral 398 Hewlett-Packard Co. 399 19111 Pruneridge Ave. 400 Cupertino, CA 95014 401 USA 403 Email: vishwas.manral@hp.com