idnits 2.17.1 draft-ietf-bfd-hmac-sha-02.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 19, 2012) is 4200 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 337, 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-02 ** 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 22, 2013 Alcatel-Lucent 6 V. Manral 7 Hewlett-Packard Co. 8 October 19, 2012 10 Authenticating BFD using HMAC-SHA-2 procedures 11 draft-ietf-bfd-hmac-sha-02 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 22, 2013. 47 Copyright Notice 48 Copyright (c) 2012 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 . . . . . . . . . . . . . . . . . . . . . . . . . 3 64 2. Cryptographic Aspects . . . . . . . . . . . . . . . . . . . . . 3 65 3. Procedures at the Sending Side . . . . . . . . . . . . . . . . 5 66 4. Procedure at the Receiving Side . . . . . . . . . . . . . . . . 5 67 5. IANA Considerations . . . . . . . . . . . . . . . . . . . . . . 6 68 6. Security Considerations . . . . . . . . . . . . . . . . . . . . 7 69 7. References . . . . . . . . . . . . . . . . . . . . . . . . . . 7 70 7.1. Normative References . . . . . . . . . . . . . . . . . . . 7 71 7.2. Informative References . . . . . . . . . . . . . . . . . . 8 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, SHA- 92 256, SHA-384, and SHA-512. The HMAC authentication mode defined in 93 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) 168 (4) Result 170 The resultant Second-Hash becomes the Authentication Data that is 171 sent in the Authentication Data field of the BFD Authentication 172 Section. The length of the Authentication Data field is always 173 identical to the message digest size of the specific hash function H 174 that is being used. 176 This also means that the use of hash functions with larger output 177 sizes will also increase the size of BFD Packet as transmitted on the 178 wire. 180 3. Procedures at the Sending Side 182 Before a BFD device sends a BFD packet out, the device needs to 183 select an appropriate BFD SA from its local key table if a keyed 184 digest for the packet is required. If no appropriate SA is 185 avaliable, the BFD packet MUST be discarded. 187 If an appropriate SA is avaliable, the device then derives the key 188 and the associated authentication algorithm (HMAC-SHA-256, HMAC-SHA- 189 384 or HMAC-SHA-512) from the SA. 191 The device then start performing the operations illustrated in 192 Section 2. Before the authentication data is computed, the device 193 MUST fill the Auth Type field and the Auth length field. The 194 Sequence Number field MUST be set to bfd.XmitAuthSeq. 196 The value of Auth Length in the generic authentication section is 197 various according to different authentication algorithms being used. 198 Specifically, the value is 40 for HMAC-SHA-256, 56 for HMAC-SHA-384, 199 and 72 for HMAC- SHA-512. 201 The Key ID is then filled. 203 After that, the authentication data is computed as illustrated in 204 Section 2. 206 The result of the authentication algorithm is placed in the 207 Authentication data, following the Key ID. 209 4. Procedure at the Receiving Side 211 Upon receiving a BFD packet with an generic authentication section 212 appended, a device needs to find an appropriate BFD SA from its local 213 key table to verify the packet. The SA is located by the Key ID in 214 the authentication section of the packet. 216 If there is no SA is associated with the Key ID, the received packet 217 MUST be discarded. 219 If bfd.AuthSeqKnown is 1, the Sequence Number field is examined. For 220 Cryptographic Authentication, if the Sequence Number lies outside of 221 the range of bfd.RcvAuthSeq to bfd.RcvAuthSeq+(3*Detect Mult) 222 inclusive (when treated as an unsigned 32 bit circular number space), 223 the received packet MUST be discarded. For Meticulous Cryptographic 224 Authentication, if the Sequence Number lies outside of the range of 225 bfd.RcvAuthSeq+1 to bfd.RcvAuthSeq+(3*Detect Mult) inclusive (when 226 treated as an unsigned 32 bit circular number space, the received 227 packet MUST be discarded. 229 An authentication Algorithm dependent process then needs to be 230 performed by using the algorithm specified by the appropriate BFD SA 231 for the received packet. 233 Before the device performs any processing, it needs to save the 234 content of the Authentication Value field and set the Authentication 235 Value field with Apad. 237 The device then computes the authentication data as illustrated in 238 Section 2. The calculated data is compared with the received 239 authentication data in the packet. 241 The packet MUST be discarded if the calculated and the received 242 authentication data do not match. In this case, an error event 243 SHOULD be logged. 245 A BFD implementation MAY be in a transition mode where it includes 246 CRYPTO_AUTH or the MET_CRYPTO_AUTH information in packets but never 247 verifies it. This is provided as a transition aid for networks in 248 the process of migrating to the new CRYPTO_AUTH and MET_CRYPTO_AUTH 249 based authentication schemes. 251 5. IANA Considerations 253 This document makes no request of IANA. 255 Note to RFC Editor: this section may be removed on publication as an 256 RFC. 258 6. Security Considerations 260 The approach described in this document enhances the security of the 261 BFD protocol by adding, to the existing BFD cryptographic 262 authentication methods, support for the SHA-2 algorithms defined in 263 the NIST Secure Hash Standard (SHS) using the HMAC mode. However, 264 the confidentiality protection for BFD packets is out of scope of 265 this work . 267 Because all of the currently specified algorithms use symmetric 268 cryptography, one cannot authenticate precisely which BFD device sent 269 a given packet. However, one can authenticate that the sender knew 270 the BFD Security Association (including the BFD SA's parameters) 271 currently in use. 273 To enhance system security, the applied keys should be changed 274 periodically and implementations SHOULD be able to store and use more 275 than one key at the same time. The quality of the security provided 276 by the cryptographic authentication option depends completely on the 277 strength of the cryptographic algorithm and cryptographic mode in 278 use, the strength of the key being used, and the correct 279 implementation of the security mechanism in all communicating BFD 280 implementations. Accordingly, the use of high assurance development 281 methods is recommended. It also requires that all parties maintain 282 the secrecy of the shared secret key. [RFC4086] provides guidance on 283 methods for generating cryptographically random bits. 285 The value Apad is used here primarily for consistency with IETF 286 specifications for HMAC-SHA authentication for RIPv2 [RFC4822], IS-IS 287 [RFC5310] and OSPFv2 [RFC5709]. 289 7. References 291 7.1. Normative References 293 [FIPS-180-2] 294 National Institute of Standards and Technology, FIPS PUB 295 180-2, "The Keyed-Hash Message Authentication Code 296 (HMAC)", August 2002. 298 [FIPS-198] 299 National Institute of Standards and Technology, FIPS PUB 300 198, "The Keyed-Hash Message Authentication Code (HMAC)", 301 March 2002. 303 [I-D.ietf-bfd-generic-crypto-auth] 304 Bhatia, M., Manral, V., and D. Zhang, "BFD Generic 305 Cryptographic Authentication", 306 draft-ietf-bfd-generic-crypto-auth-02 (work in progress), 307 June 2012. 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", 334 draft-ietf-karp-design-guide-10 (work in progress), 335 December 2011. 337 [MD5-attack] 338 Wang, X., Feng, D., Lai, X., and H. Yu, "Collisions for 339 Hash Functions MD4, MD5, HAVAL-128 and RIPEMD", 340 August 2004. 342 [NIST-HMAC-SHA] 343 National Institute of Standards and Technology, Available 344 online at http://csrc.nist.gov/groups/ST/hash/policy.html, 345 "NIST's Policy on Hash Functions", 2006. 347 [RFC1321] Rivest, R., "The MD5 Message-Digest Algorithm", RFC 1321, 348 April 1992. 350 [RFC2104] Krawczyk, H., Bellare, M., and R. Canetti, "HMAC: Keyed- 351 Hashing for Message Authentication", RFC 2104, 352 February 1997. 354 [RFC4086] Eastlake, D., Schiller, J., and S. Crocker, "Randomness 355 Requirements for Security", BCP 106, RFC 4086, June 2005. 357 [RFC4822] Atkinson, R. and M. Fanto, "RIPv2 Cryptographic 358 Authentication", RFC 4822, February 2007. 360 [RFC5310] Bhatia, M., Manral, V., Li, T., Atkinson, R., White, R., 361 and M. Fanto, "IS-IS Generic Cryptographic 362 Authentication", RFC 5310, February 2009. 364 [RFC5709] Bhatia, M., Manral, V., Fanto, M., White, R., Barnes, M., 365 Li, T., and R. Atkinson, "OSPFv2 HMAC-SHA Cryptographic 366 Authentication", RFC 5709, October 2009. 368 [RFC5880] Katz, D. and D. Ward, "Bidirectional Forwarding Detection 369 (BFD)", RFC 5880, June 2010. 371 [RFC6234] Eastlake, D. and T. Hansen, "US Secure Hash Algorithms 372 (SHA and SHA-based HMAC and HKDF)", RFC 6234, May 2011. 374 [SHA-1-attack1] 375 Wang, X., Yin, Y., and H. Yu, "Finding Collisions in the 376 Full SHA-1", 2005. 378 [SHA-1-attack2] 379 Wang, X., Yao, A., and F. Yao, "New Collision Search for 380 SHA-1", 2005. 382 Authors' Addresses 384 Dacheng Zhang 385 Huawei 386 Beijing, 387 China 389 Email: zhangdacheng@huawei.com 391 Manav Bhatia 392 Alcatel-Lucent 393 Bangalore 560045 394 India 396 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