idnits 2.17.1 draft-ietf-ospf-rfc6506bis-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 (November 12, 2013) is 3789 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 6506 (Obsoleted by RFC 7166) -- Obsolete informational reference (is this intentional?): RFC 5996 (Obsoleted by RFC 7296) Summary: 1 error (**), 0 flaws (~~), 1 warning (==), 2 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 OSPF Working Group M. Bhatia 3 Internet-Draft Alcatel-Lucent 4 Obsoletes: 6506 (if approved) V. Manral 5 Intended status: Standards Track Hewlett Packard 6 Expires: May 16, 2014 A. Lindem 7 Ericsson 8 November 12, 2013 10 Supporting Authentication Trailer for OSPFv3 11 draft-ietf-ospf-rfc6506bis-02.txt 13 Abstract 15 Currently, OSPF for IPv6 (OSPFv3) uses IPsec as the only mechanism 16 for authenticating protocol packets. This behavior is different from 17 authentication mechanisms present in other routing protocols (OSPFv2, 18 Intermediate System to Intermediate System (IS-IS), RIP, and Routing 19 Information Protocol Next Generation (RIPng)). In some environments, 20 it has been found that IPsec is difficult to configure and maintain 21 and thus cannot be used. This document defines an alternative 22 mechanism to authenticate OSPFv3 protocol packets so that OSPFv3 does 23 not only depend upon IPsec for authentication. This document 24 obsoletes RFC 6506. 26 Status of this Memo 28 This Internet-Draft is submitted in full conformance with the 29 provisions of BCP 78 and BCP 79. 31 Internet-Drafts are working documents of the Internet Engineering 32 Task Force (IETF). Note that other groups may also distribute 33 working documents as Internet-Drafts. The list of current Internet- 34 Drafts is at http://datatracker.ietf.org/drafts/current/. 36 Internet-Drafts are draft documents valid for a maximum of six months 37 and may be updated, replaced, or obsoleted by other documents at any 38 time. It is inappropriate to use Internet-Drafts as reference 39 material or to cite them other than as "work in progress." 41 This Internet-Draft will expire on May 16, 2014. 43 Copyright Notice 45 Copyright (c) 2013 IETF Trust and the persons identified as the 46 document authors. All rights reserved. 48 This document is subject to BCP 78 and the IETF Trust's Legal 49 Provisions Relating to IETF Documents 50 (http://trustee.ietf.org/license-info) in effect on the date of 51 publication of this document. Please review these documents 52 carefully, as they describe your rights and restrictions with respect 53 to this document. Code Components extracted from this document must 54 include Simplified BSD License text as described in Section 4.e of 55 the Trust Legal Provisions and are provided without warranty as 56 described in the Simplified BSD License. 58 Table of Contents 60 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 3 61 1.1. Requirements . . . . . . . . . . . . . . . . . . . . . . . 4 62 1.2. Summary of Changes from RFC 6506 . . . . . . . . . . . . . 4 63 2. Proposed Solution . . . . . . . . . . . . . . . . . . . . . . 6 64 2.1. AT-Bit in Options Field . . . . . . . . . . . . . . . . . 6 65 2.2. Basic Operation . . . . . . . . . . . . . . . . . . . . . 7 66 2.3. IPv6 Source Address Protection . . . . . . . . . . . . . . 7 67 3. OSPFv3 Security Association . . . . . . . . . . . . . . . . . 9 68 4. Authentication Procedure . . . . . . . . . . . . . . . . . . . 11 69 4.1. Authentication Trailer . . . . . . . . . . . . . . . . . . 11 70 4.1.1. Sequence Number Wrap . . . . . . . . . . . . . . . . . 12 71 4.2. OSPFv3 Header Checksum and LLS Data Block Checksum . . . . 13 72 4.3. Cryptographic Authentication Procedure . . . . . . . . . . 13 73 4.4. Cross-Protocol Attack Mitigation . . . . . . . . . . . . . 14 74 4.5. Cryptographic Aspects . . . . . . . . . . . . . . . . . . 14 75 4.6. Message Verification . . . . . . . . . . . . . . . . . . . 16 76 5. Migration and Backward Compatibility . . . . . . . . . . . . . 19 77 6. Security Considerations . . . . . . . . . . . . . . . . . . . 20 78 7. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 21 79 8. References . . . . . . . . . . . . . . . . . . . . . . . . . . 22 80 8.1. Normative References . . . . . . . . . . . . . . . . . . . 22 81 8.2. Informative References . . . . . . . . . . . . . . . . . . 22 82 Appendix A. Acknowledgments . . . . . . . . . . . . . . . . . . . 24 83 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . . 26 85 1. Introduction 87 Unlike Open Shortest Path First version 2 (OSPFv2) [RFC2328], OSPF 88 for IPv6 (OSPFv3) [RFC5340] does not include the AuType and 89 Authentication fields in its headers for authenticating protocol 90 packets. Instead, OSPFv3 relies on the IPsec protocols 91 Authentication Header (AH) [RFC4302] and Encapsulating Security 92 Payload (ESP) [RFC4303] to provide integrity, authentication, and/or 93 confidentiality. 95 [RFC4552] describes how IPv6 AH and ESP extension headers can be used 96 to provide authentication and/or confidentiality to OSPFv3. 98 However, there are some environments, e.g., Mobile Ad Hoc Networks 99 (MANETs), where IPsec is difficult to configure and maintain, and 100 this mechanism cannot be used. 102 [RFC4552] discusses, at length, the reasoning behind using manually 103 configured keys, rather than some automated key management protocol 104 such as Internet Key Exchange version 2 (IKEv2) [RFC5996]. The 105 primary problem is the lack of a suitable key management mechanism, 106 as OSPFv3 adjacencies are formed on a one-to-many basis and most key 107 management mechanisms are designed for a one-to-one communication 108 model. This forces the system administrator to use manually 109 configured security associations (SAs) and cryptographic keys to 110 provide the authentication and, if desired, confidentiality services. 112 Regarding replay protection, [RFC4552] states that: 114 Since it is not possible using the current standards to provide 115 complete replay protection while using manual keying, the proposed 116 solution will not provide protection against replay attacks. 118 Since there is no replay protection provided there are a number of 119 vulnerabilities in OSPFv3 that have been discussed in [RFC6039]. 121 Since there is no deterministic way to differentiate between 122 encrypted and unencrypted ESP packets by simply examining the packet, 123 it could be difficult for some implementations to prioritize certain 124 OSPFv3 packet types, e.g., Hello packets, over the other types. 126 This document defines a new mechanism that works similarly to OSPFv2 127 [RFC5709] to provide authentication to the OSPFv3 packets and 128 attempts to solve the problems related to replay protection and 129 deterministically disambiguating different OSPFv3 packets as 130 described above. 132 This document adds support for the Secure Hash Algorithms (SHAs) 133 defined in the US NIST Secure Hash Standard (SHS), which is specified 134 by NIST FIPS 180-3. [FIPS-180-3] includes SHA-1, SHA-224, SHA-256, 135 SHA-384, and SHA-512. The Hashed Message Authentication Code (HMAC) 136 authentication mode defined in NIST FIPS 198-1 [FIPS-198-1] is used. 138 It is believed that HMAC as defined in [RFC2104] is mathematically 139 identical to [FIPS-198-1]; it is also believed that algorithms in 140 [RFC6234] are mathematically identical to [FIPS-198-1]. 142 1.1. Requirements 144 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 145 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 146 document are to be interpreted as described in RFC 2119 [RFC2119]. 148 1.2. Summary of Changes from RFC 6506 150 This document includes the following changes from RFC 6506 [RFC6506]: 152 1. Sections 2.2 and 4.2 explicitly state that the Link-Local 153 Signaling (LLS) block checksum calculation is omitted when an 154 OSPFv3 authentication trailer is used for OSPFv3 authentication. 155 The LLS block is included in the authentication digest 156 calculation and computation of a checksum is unnecessary. 157 Clarification of this issue was documented in an erratum. 159 2. Section 3 previously recommended usage of an expired key for 160 transmitted OSPFv3 packets when no valid keys existed. This 161 statement has been removed. 163 3. Section 4.5 includes a correction to the key preparation to use 164 the protocol specific key (Ks) rather than the key (K) as the 165 initial key (Ko). This problem was also documented in an 166 erratum. 168 4. Section 4.5 also includes a discussion of the choice of key 169 length to be the hash length (L) rather than the block size (B). 170 The discussion of this choice was included to clarify an issue 171 raised in a rejected erratum. 173 5. Section 4.1 and 4.6 indicate that sequence number checking is 174 dependent on OSPFv3 packet type in order to account for packet 175 prioritization as specified in [RFC4222]. This was an omission 176 from RFC 6506 [RFC6506]. 178 6. Section 4.6 explicitly states that OSPFv3 packets with a non- 179 existent or expired Security Association (SA) will be dropped. 181 7. Section 5 includes guidance on precisely the actions required for 182 an OSPFv3 router providing a backward compatible transition mode. 184 2. Proposed Solution 186 To perform non-IPsec Cryptographic Authentication, OSPFv3 routers 187 append a special data block, henceforth referred to as the 188 Authentication Trailer, to the end of the OSPFv3 packets. The length 189 of the Authentication Trailer is not included in the length of the 190 OSPFv3 packet but is included in the IPv6 payload length, as shown in 191 Figure 1. 193 +---------------------+ -- -- +----------------------+ 194 | IPv6 Payload Length | ^ ^ | IPv6 Payload Length | 195 | PL = OL + LL | | | | PL = OL + LL + AL | 196 | | v v | | 197 +---------------------+ -- -- +----------------------+ 198 | OSPFv3 Header | ^ ^ | OSPFv3 Header | 199 | Length = OL | | | | Length = OL | 200 | | | OSPFv3 | | | 201 |.....................| | Packet | |......................| 202 | | | Length | | | 203 | OSPFv3 Packet | | | | OSPFv3 Packet | 204 | | v v | | 205 +---------------------+ -- -- +----------------------+ 206 | | ^ ^ | | 207 | Optional LLS | | LLS Data | | Optional LLS | 208 | LLS Block Len = LL | | Block | | LLS Block Len = LL | 209 | | v Length v | | 210 +---------------------+ -- -- +----------------------+ 211 ^ | | 212 AL = PL - (OL + LL) | | Authentication | 213 | | AL = Fixed Trailer + | 214 v | Digest Length | 215 -- +----------------------+ 217 Figure 1: Authentication Trailer in OSPFv3 219 The presence of the Link-Local Signaling (LLS) [RFC5613] block is 220 determined by the L-bit setting in the OSPFv3 Options field in OSPFv3 221 Hello and Database Description packets. If present, the LLS data 222 block is included along with the OSPFv3 packet in the Cryptographic 223 Authentication computation. 225 2.1. AT-Bit in Options Field 227 A new AT-bit (AT stands for Authentication Trailer) is introduced 228 into the OSPFv3 Options field. OSPFv3 routers MUST set the AT-bit in 229 OSPFv3 Hello and Database Description packets to indicate that all 230 the packets on this link will include an Authentication Trailer. For 231 OSPFv3 Hello and Database Description packets, the AT-bit indicates 232 the AT is present. For other OSPFv3 packet types, the OSPFv3 AT-bit 233 setting from the OSPFv3 Hello/Database Description setting is 234 preserved in the OSPFv3 neighbor data structure. OSPFv3 packet types 235 that don't include an OSPFv3 Options field will use the setting from 236 the neighbor data structure to determine whether or not the AT is 237 expected. 239 0 1 2 240 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 241 +-+-+-+-+-+-+-+-+-+-+-+-+-+--+-+--+-+-+--+-+-+--+-+--+ 242 | | | | | | | | | | | | | |AT|L|AF|*|*|DC|R|N|MC|E|V6| 243 +-+-+-+-+-+-+-+-+-+-+-+-+-+--+-+--+-+-+--+-+-+--+-+--+ 245 Figure 2: OSPFv3 Options Field 247 The AT-bit, as shown in the figure above, MUST be set in all OSPFv3 248 Hello and Database Description packets that contain an Authentication 249 Trailer. 251 2.2. Basic Operation 253 The procedure followed for computing the Authentication Trailer is 254 much the same as described in [RFC5709] and [RFC2328]. One 255 difference is that the LLS data block, if present, is included in the 256 Cryptographic Authentication computation. 258 The way the authentication data is carried in the Authentication 259 Trailer is very similar to how it is done in case of [RFC2328]. The 260 only difference between the OSPFv2 Authentication Trailer and the 261 OSPFv3 Authentication Trailer is that information in addition to the 262 message digest is included. The additional information in the OSPFv3 263 Authentication Trailer is included in the message digest computation 264 and is therefore protected by OSPFv3 Cryptographic Authentication as 265 described herein. 267 Consistent with OSPFv2 Cryptographic Authentication [RFC2328] and 268 Link-Local Signaling Cryptographic Authentication [RFC5613], checksum 269 calculation and verification are omitted for both the OSPFv3 header 270 checksum and the LLS Data Block when the OSPFv3 authentication 271 mechanism described in this specification is used. 273 2.3. IPv6 Source Address Protection 275 While OSPFv3 always uses the Router ID to identify OSPFv3 neighbors, 276 the IPv6 source address is learned from OSPFv3 Hello packets and 277 copied into the neighbor data structure [RFC5340]. Hence, OSPFv3 is 278 susceptible to Man-in-the-Middle attacks where the IPv6 source 279 address is modified. To thwart such attacks, the IPv6 source address 280 will be included in the message digest calculation and protected by 281 OSPFv3 authentication. Refer to Section 4.5 for details. This is 282 different than the procedure specified in [RFC5709] but consistent 283 with [MANUAL-KEY]. 285 3. OSPFv3 Security Association 287 An OSPFv3 Security Association (SA) contains a set of parameters 288 shared between any two legitimate OSPFv3 speakers. 290 Parameters associated with an OSPFv3 SA are as follows: 292 o Security Association Identifier (SA ID) 294 This is a 16-bit unsigned integer used to uniquely identify an 295 OSPFv3 SA, as manually configured by the network operator. 297 The receiver determines the active SA by looking at the SA ID 298 field in the incoming protocol packet. 300 The sender, based on the active configuration, selects an SA to 301 use and puts the correct Key ID value associated with the SA in 302 the OSPFv3 protocol packet. If multiple valid and active OSPFv3 303 SAs exist for a given interface, the sender may use any of those 304 SAs to protect the packet. 306 Using SA IDs makes changing keys while maintaining protocol 307 operation convenient. Each SA ID specifies two independent parts, 308 the authentication algorithm and the Authentication Key, as 309 explained below. 311 Normally, an implementation would allow the network operator to 312 configure a set of keys in a key chain, with each key in the chain 313 having a fixed lifetime. The actual operation of these mechanisms 314 is outside the scope of this document. 316 Note that each SA ID can indicate a key with a different 317 authentication algorithm. This allows the introduction of new 318 authentication mechanisms without disrupting existing OSPFv3 319 adjacencies. 321 o Authentication Algorithm 323 This signifies the authentication algorithm to be used with this 324 OSPFv3 SA. This information is never sent in clear text over the 325 wire. Because this information is not sent on the wire, the 326 implementer chooses an implementation-specific representation for 327 this information. 329 Currently, the following algorithms are supported: 331 * HMAC-SHA-1, 332 * HMAC-SHA-256, 334 * HMAC-SHA-384, and 336 * HMAC-SHA-512. 338 o Authentication Key 340 This value denotes the Cryptographic Authentication Key associated 341 with this OSPFv3 SA. The length of this key is variable and 342 depends upon the authentication algorithm specified by the OSPFv3 343 SA. 345 o KeyStartAccept 347 The time that this OSPFv3 router will accept packets that have 348 been created with this OSPFv3 SA. 350 o KeyStartGenerate 352 The time that this OSPFv3 router will begin using this OSPFv3 SA 353 for OSPFv3 packet generation. 355 o KeyStopGenerate 357 The time that this OSPFv3 router will stop using this OSPFv3 SA 358 for OSPFv3 packet generation. 360 o KeyStopAccept 362 The time that this OSPFv3 router will stop accepting packets 363 generated with this OSPFv3 SA. 365 In order to achieve smooth key transition, KeyStartAccept SHOULD be 366 less than KeyStartGenerate, and KeyStopGenerate SHOULD be less than 367 KeyStopAccept. If KeyStartGenerate or KeyStartAccept are left 368 unspecified, the time will default to 0, and the key will be used 369 immediately. If KeyStopGenerate or KeyStopAccept are left 370 unspecified, the time will default to infinity, and the key's 371 lifetime will be infinite. When a new key replaces an old, the 372 KeyStartGenerate time for the new key MUST be less than or equal to 373 the KeyStopGenerate time of the old key. 375 Key storage SHOULD persist across a system restart, warm or cold, to 376 avoid operational issues. In the event that the last key associated 377 with an interface expires, the network operator SHOULD be notified 378 and the OSPFv3 packet MUST NOT be transmitted unauthenticated. 380 4. Authentication Procedure 382 4.1. Authentication Trailer 384 The Authentication Trailer that is appended to the OSPFv3 protocol 385 packet is described below: 387 0 1 2 3 388 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 389 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 390 | Authentication Type | Auth Data Len | 391 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 392 | Reserved | Security Association ID | 393 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 394 | Cryptographic Sequence Number (High-Order 32 Bits) | 395 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 396 | Cryptographic Sequence Number (Low-Order 32 Bits) | 397 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 398 | | 399 | Authentication Data (Variable) | 400 ~ ~ 401 | | 402 | | 403 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 405 Figure 3: Authentication Trailer Format 407 The various fields in the Authentication Trailer are: 409 o Authentication Type 411 16-bit field identifying the type of authentication. The 412 following values are defined in this specification: 414 0 - Reserved. 415 1 - HMAC Cryptographic Authentication as described herein. 417 o Auth Data Len 419 The length in octets of the Authentication Trailer (AT) including 420 both the 16-octet fixed header and the variable length message 421 digest. 423 o Reserved 425 This field is reserved. It SHOULD be set to 0 when sending 426 protocol packets and MUST be ignored when receiving protocol 427 packets. 429 o Security Association Identifier (SA ID) 431 16-bit field that maps to the authentication algorithm and the 432 secret key used to create the message digest appended to the 433 OSPFv3 protocol packet. 435 Though the SA ID implicitly implies the algorithm, the HMAC output 436 size should not be used by implementers as an implicit hint 437 because additional algorithms may be defined in the future that 438 have the same output size. 440 o Cryptographic Sequence Number 442 64-bit strictly increasing sequence number that is used to guard 443 against replay attacks. The 64-bit sequence number MUST be 444 incremented for every OSPFv3 packet sent by the OSPFv3 router. 445 Upon reception, the sequence number MUST be greater than the 446 sequence number in the last accepted OSPFv3 packet of the same 447 OSPFv3 packet type from the sending OSPFv3 neighbor. Otherwise, 448 the OSPFv3 packet is considered a replayed packet and dropped. 449 OSPFv3 packets of different types may arrive out of order if they 450 are prioritized as recommended in [RFC4222]. 452 OSPFv3 routers implementing this specification MUST use available 453 mechanisms to preserve the sequence number's strictly increasing 454 property for the deployed life of the OSPFv3 router (including 455 cold restarts). One mechanism for accomplishing this would be to 456 use the high-order 32 bits of the sequence number as a wrap/boot 457 count that is incremented anytime the OSPFv3 router loses its 458 sequence number state. Sequence number wrap is described in 459 Section 4.1.1. 461 o Authentication Data 463 Variable data that is carrying the digest for the protocol packet 464 and optional LLS data block. 466 4.1.1. Sequence Number Wrap 468 When incrementing the sequence number for each transmitted OSPFv3 469 packet, the sequence number should be treated as an unsigned 64-bit 470 value. If the lower-order 32-bit value wraps, the higher-order 471 32-bit value should be incremented and saved in non-volatile storage. 472 If by some chance the OSPFv3 router is deployed long enough that 473 there is a possibility that the 64-bit sequence number may wrap, all 474 keys, independent of their key distribution mechanism, MUST be reset 475 to avoid the possibility of replay attacks. Once the keys have been 476 changed, the higher-order sequence number can be reset to 0 and saved 477 to non-volatile storage. 479 4.2. OSPFv3 Header Checksum and LLS Data Block Checksum 481 Both the checksum calculation and verification are omitted for the 482 OSPFv3 header checksum and the LLS Data Block checksum [RFC5613] when 483 the OSPFv3 authentication mechanism described in this specification 484 is used. This implies: 486 o For OSPFv3 packets to be transmitted, the OSPFv3 header checksum 487 computation is omitted, and the OSPFv3 header checksum SHOULD be 488 set to 0 prior to computation of the OSPFv3 Authentication Trailer 489 message digest. 491 o For OSPFv3 packets including an LLS Data Block to be transmitted, 492 the OSPFv3 LLS Data Block checksum computation is omitted, and the 493 OSPFv3 LLS Data Block checksum SHOULD be set to 0 prior to 494 computation of the OSPFv3 Authentication Trailer message digest. 496 o For received OSPFv3 packets including an OSPFv3 Authentication 497 Trailer, OSPFv3 header checksum verification MUST be omitted. 498 However, if the OSPFv3 packet does include a non-zero OSPFv3 499 header checksum, it will not be modified by the receiver and will 500 simply be included in the OSPFv3 Authentication Trailer message 501 digest verification. 503 o For received OSPFv3 packets including an LLS Data Block and OSPFv3 504 Authentication Trailer, LLS Data Block checksum verification MUST 505 be omitted. However, if the OSPFv3 packet does include an LLS 506 Block with a non-zero checksum, it will not be modified by the 507 receiver and will simply be included in the OSPFv3 Authentication 508 Trailer message digest verification. 510 4.3. Cryptographic Authentication Procedure 512 As noted earlier, the SA ID maps to the authentication algorithm and 513 the secret key used to generate and verify the message digest. This 514 specification discusses the computation of OSPFv3 Cryptographic 515 Authentication data when any of the NIST SHS family of algorithms is 516 used in the Hashed Message Authentication Code (HMAC) mode. 518 The currently valid algorithms (including mode) for OSPFv3 519 Cryptographic Authentication include: 521 o HMAC-SHA-1, 523 o HMAC-SHA-256, 524 o HMAC-SHA-384, and 526 o HMAC-SHA-512. 528 Of the above, implementations of this specification MUST include 529 support for at least HMAC-SHA-256 and SHOULD include support for 530 HMAC-SHA-1 and MAY also include support for HMAC-SHA-384 and 531 HMAC-SHA-512. 533 Implementations of this specification MUST use HMAC-SHA-256 as the 534 default authentication algorithm. 536 4.4. Cross-Protocol Attack Mitigation 538 In order to prevent cross-protocol replay attacks for protocols 539 sharing common keys, the two-octet OSPFv3 Cryptographic Protocol ID 540 is appended to the Authentication Key prior to use. Other protocols 541 using Cryptographic Authentication as specified herein MUST similarly 542 append their respective Cryptographic Protocol IDs to their keys in 543 this step. Refer to the IANA Considerations (Section 7). 545 4.5. Cryptographic Aspects 547 In the algorithm description below, the following nomenclature, which 548 is consistent with [FIPS-198-1], is used: 550 H is the specific hashing algorithm (e.g., SHA-256). 552 K is the Authentication Key from the OSPFv3 Security Association. 554 Ks is a Protocol-Specific Authentication Key obtained by appending 555 Authentication Key (K) with the two-octet OSPFv3 Cryptographic 556 Protocol ID. 558 Ko is the cryptographic key used with the hash algorithm. 560 B is the block size of H, measured in octets rather than bits. Note 561 that B is the internal block size, not the hash size. 563 For SHA-1 and SHA-256: B == 64 565 For SHA-384 and SHA-512: B == 128 567 L is the length of the hash, measured in octets rather than bits. 569 XOR is the exclusive-or operation. 571 Opad is the hexadecimal value 0x5c repeated B times. 573 Ipad is the hexadecimal value 0x36 repeated B times. 575 Apad is a value that is the same length as the hash output or message 576 digest. The first 16 octets contain the IPv6 source address followed 577 by the hexadecimal value 0x878FE1F3 repeated (L-16)/4 times. This 578 implies that hash output is always a length of at least 16 octets. 580 1. Preparation of the Key 582 The OSPFv3 Cryptographic Protocol ID is appended to the 583 Authentication Key (K) yielding a Protocol-Specific 584 Authentication Key (Ks). In this application, Ko is always L 585 octets long. While [RFC2104] supports a key that is up to B 586 octets long, this application uses L as the Ks length consistent 587 with [RFC4822], [RFC5310], and [RFC5709]. According to 588 [FIPS-198-1], Section 3, keys greater than L octets do not 589 significantly increase the function strength. Ks is computed as 590 follows: 592 If the Protocol-Specific Authentication Key (Ks) is L octets 593 long, then Ko is equal to Ks. If the Protocol-Specific 594 Authentication Key (Ks) is more than L octets long, then Ko is 595 set to H(Ks). If the Protocol-Specific Authentication Key 596 (Ks) is less than L octets long, then Ko is set to the 597 Protocol-Specific Authentication Key (Ks) with zeros appended 598 to the end of the Protocol-Specific Authentication Key (Ks) 599 such that Ko is L octets long. 601 2. First-Hash 603 First, the OSPFv3 packet's Authentication Data field in the 604 Authentication Trailer is filled with the value Apad. This is 605 very similar to the appendage described in [RFC2328], Section 606 D.4.3, Items (6)(a) and (6)(d)). 608 Then, a First-Hash, also known as the inner hash, is computed as 609 follows: 611 First-Hash = H(Ko XOR Ipad || (OSPFv3 Packet)) 613 When XORing Ko and Ipad, Ko will be padded with zeros to the 614 length of Ipad. 616 Implementation Note: The First-Hash above includes the 617 Authentication Trailer, as well as the OSPFv3 packet, as per 618 [RFC2328], Section D.4.3, and, if present, the LLS data block 619 [RFC5613]. 621 The definition of Apad (above) ensures it is always the same 622 length as the hash output. This is consistent with RFC 2328. 623 Note that the "(OSPFv3 Packet)" referenced in the First-Hash 624 function above includes both the optional LLS data block and the 625 OSPFv3 Authentication Trailer. 627 The digest length for SHA-1 is 20 octets; for SHA-256, 32 octets; 628 for SHA-384, 48 octets; and for SHA-512, 64 octets. 630 3. Second-Hash 632 Then a Second-Hash, also known as the outer hash, is computed as 633 follows: 635 Second-Hash = H(Ko XOR Opad || First-Hash) 637 When XORing Ko and Opad, Ko will be padded with zeros to the 638 length of Ipad. 640 4. Result 642 The resulting Second-Hash becomes the authentication data that is 643 sent in the Authentication Trailer of the OSPFv3 packet. The 644 length of the authentication data is always identical to the 645 message digest size of the specific hash function H that is being 646 used. 648 This also means that the use of hash functions with larger output 649 sizes will also increase the size of the OSPFv3 packet as 650 transmitted on the wire. 652 Implementation Note: [RFC2328], Appendix D specifies that the 653 Authentication Trailer is not counted in the OSPF packet's own 654 Length field but is included in the packet's IP Length field. 655 Similar to this, the Authentication Trailer is not included in 656 the OSPFv3 header length but is included in the IPv6 header 657 payload length. 659 4.6. Message Verification 661 A router would determine that OSPFv3 is using an Authentication 662 trailer by examining the AT-bit in the Options field in the OSPFv3 663 header for Hello and Database Description packets. The specification 664 in the Hello and Database Description options indicates that other 665 OSPFv3 packets will include the Authentication Trailer. 667 The Authentication Trailer (AT) is accessed using the OSPFv3 packet 668 header length to access the data after the OSPFv3 packet and, if an 669 LLS data block [RFC5613] is present, using the LLS data block length 670 to access the data after the LLS data block. The L-bit in the OSPFv3 671 options in Hello and Database Description packets is examined to 672 determine if an LLS data block is present. If an LLS data block is 673 present (as specified by the L-bit), it is included along with the 674 OSPFv3 Hello or Database Description packet in the cryptographic 675 authentication computation. 677 Due to the placement of the AT following the LLS data block and the 678 fact that the LLS data block is included in the Cryptographic 679 Authentication computation, OSPFv3 routers supporting this 680 specification MUST minimally support examining the L-bit in the 681 OSPFv3 options and using the length in the LLS data block to access 682 the AT. It is RECOMMENDED that OSPFv3 routers supporting this 683 specification fully support OSPFv3 Link-Local Signaling [RFC5613]. 685 If usage of the Authentication Trailer (AT), as specified herein, is 686 configured for an OSPFv3 link, OSPFv3 Hello and Database Description 687 packets with the AT-bit clear in the options will be dropped. All 688 OSPFv3 packet types will be dropped if AT is configured for the link 689 and the IPv6 header length is less than the amount necessary to 690 include an Authentication Trailer. 692 Locate the receiving interface's OSPFv3 SA using the SA ID in the 693 received AT. If the SA is not found, or if the SA is not valid for 694 reception (i.e., current time < KeyStartAccept or current time >= 695 KeyStopAccept), the OSPFv3 packet is dropped. 697 If the cryptographic sequence number in the AT is less than or equal 698 to the last sequence number in the last OSPFv3 packet of the same 699 OSPFv3 type successfully received from the neighbor, the OSPFv3 700 packet MUST be dropped, and an error event SHOULD be logged. OSPFv3 701 packets of different types may arrive out of order if they are 702 prioritized as recommended in [RFC4222]. 704 Authentication-algorithm-dependent processing needs to be performed, 705 using the algorithm specified by the appropriate OSPFv3 SA for the 706 received packet. 708 Before an implementation performs any processing, it needs to save 709 the values of the Authentication Data field from the Authentication 710 Trailer appended to the OSPFv3 packet. 712 It should then set the Authentication Data field with Apad before the 713 authentication data is computed (as described in Section 4.5). The 714 calculated data is compared with the received authentication data in 715 the Authentication Trailer. If the two do not match, the packet MUST 716 be discarded and an error event SHOULD be logged. 718 After the OSPFv3 packet has been successfully authenticated, 719 implementations MUST store the 64-bit cryptographic sequence number 720 for each OSPFv3 packet type received from the neighbor. The saved 721 cryptographic sequence numbers will be used for replay checking for 722 subsequent packets received from the neighbor. 724 5. Migration and Backward Compatibility 726 All OSPFv3 routers participating on a link SHOULD be migrated to 727 OSPFv3 Authentication at the same time. As with OSPFv2 728 authentication, a mismatch in the SA ID, Authentication Type, or 729 message digest will result in failure to form an adjacency. For 730 multi-access links, communities of OSPFv3 routers could be migrated 731 using different Interface Instance IDs. However, at least one router 732 would need to form adjacencies between both the OSPFv3 routers 733 including and not including the Authentication Trailer. This would 734 result in sub-optimal routing as well as added complexity and is only 735 recommended in cases where authentication is desired on the link and 736 migrating all the routers on the link at the same time isn't 737 feasible. 739 In support of uninterrupted deployment, an OSPFv3 router implementing 740 this specification MAY implement a transition mode where it includes 741 the Authentication Trailer in transmitted packets but does not verify 742 this information in received packets. This is provided as a 743 transition aid for networks in the process of migrating to the 744 authentication mechanism described in this specification. More 745 specifically: 747 1. OSPFv3 routers in transition mode will include the OSPFv3 748 authentication trailer in transmitted packets and set the AT-Bit 749 in the options field of transmitted Hello and Database 750 Description packets. OSPFv3 routers receiving these packets and 751 not having authentication configured will ignore the 752 authentication trailer and AT-bit. 754 2. OSPFv3 routers in transition mode will also calculate and set the 755 OSPFv3 header checksum and the LLS block checksum in transmitted 756 packets so that they will not be dropped by OSPFv3 routers 757 without authentication configured. 759 3. OSPFv3 routers in transition mode will authenticate received 760 packets that either have the AT-Bit set in the options field for 761 Hello or Database Description packets or are from a neighbor that 762 previously set the AT-Bit in the options field of successfully 763 authenticated Hello and Database Description packets. 765 4. OSPFv3 routers in transition mode will also accept packets 766 without the options field AT-Bit set in Hello and Database 767 Description packets. These packets will be assumed to be from 768 OSPFv3 routers without authentication configured and they will 769 not be authenticated. Additionally, the OSPFv3 header checksum 770 and LLS block checksum will be validated. 772 6. Security Considerations 774 The document proposes extensions to OSPFv3 that would make it more 775 secure than [RFC5340]. It does not provide confidentiality as a 776 routing protocol contains information that does not need to be kept 777 secret. It does, however, provide means to authenticate the sender 778 of the packets that are of interest. It addresses all the security 779 issues that have been identified in [RFC6039] and [RFC6506]. 781 It should be noted that the authentication method described in this 782 document is not being used to authenticate the specific originator of 783 a packet but is rather being used to confirm that the packet has 784 indeed been issued by a router that has access to the Authentication 785 Key. 787 Deployments SHOULD use sufficiently long and random values for the 788 Authentication Key so that guessing and other cryptographic attacks 789 on the key are not feasible in their environments. Furthermore, it 790 is RECOMMENDED that Authentication Keys incorporate at least 128 791 pseudo-random bits to minimize the risk of such attacks. In support 792 of these recommendations, management systems SHOULD support 793 hexadecimal input of Authentication Keys. 795 The mechanism described herein is not perfect and does not need to be 796 perfect. Instead, this mechanism represents a significant increase 797 in the effort required for an adversary to successfully attack the 798 OSPFv3 protocol while not causing undue implementation, deployment, 799 or operational complexity. 801 Refer to [RFC4552] for additional considerations on manual keying. 803 7. IANA Considerations 805 IANA has allocated the AT-bit (0x000400) in the "OSPFv3 Options (24 806 bits)" registry as described in Section 2.1. 808 IANA has created the "OSPFv3 Authentication Trailer Options" 809 registry. This new registry initially includes the "OSPFv3 810 Authentication Types" registry, which defines valid values for the 811 Authentication Type field in the OSPFv3 Authentication Trailer. The 812 registration procedure is Standards Action. 814 +-------------+-----------------------------------+ 815 | Value/Range | Designation | 816 +-------------+-----------------------------------+ 817 | 0 | Reserved | 818 | | | 819 | 1 | HMAC Cryptographic Authentication | 820 | | | 821 | 2-65535 | Unassigned | 822 +-------------+-----------------------------------+ 824 OSPFv3 Authentication Types 826 Finally, IANA has created the "Keying and Authentication for Routing 827 Protocols (KARP) Parameters" category. This new category initially 828 includes the "Authentication Cryptographic Protocol ID" registry, 829 which provides unique protocol-specific values for cryptographic 830 applications, such as but not limited to, prevention of cross- 831 protocol replay attacks. Values can be assigned for both native 832 IPv4/IPv6 protocols and UDP/TCP protocols. The registration 833 procedure is Standards Action. 835 +-------------+----------------------+ 836 | Value/Range | Designation | 837 +-------------+----------------------+ 838 | 0 | Reserved | 839 | | | 840 | 1 | OSPFv3 | 841 | | | 842 | 2-65535 | Unassigned | 843 +-------------+----------------------+ 845 Cryptographic Protocol ID 847 8. References 849 8.1. Normative References 851 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 852 Requirement Levels", BCP 14, RFC 2119, March 1997. 854 [RFC2328] Moy, J., "OSPF Version 2", STD 54, RFC 2328, April 1998. 856 [RFC5340] Coltun, R., Ferguson, D., Moy, J., and A. Lindem, "OSPF 857 for IPv6", RFC 5340, July 2008. 859 [RFC5709] Bhatia, M., Manral, V., Fanto, M., White, R., Barnes, M., 860 Li, T., and R. Atkinson, "OSPFv2 HMAC-SHA Cryptographic 861 Authentication", RFC 5709, October 2009. 863 [RFC6506] Bhatia, M., Manral, V., and A. Lindem, "Supporting 864 Authentication Trailer for OSPFv3", RFC 6506, 865 February 2012. 867 8.2. Informative References 869 [FIPS-180-3] 870 US National Institute of Standards and Technology, "Secure 871 Hash Standard (SHS)", FIPS PUB 180-3, October 2008. 873 [FIPS-198-1] 874 US National Institute of Standards and Technology, "The 875 Keyed-Hash Message Authentication Code (HMAC)", FIPS 876 PUB 198, July 2008. 878 [MANUAL-KEY] 879 Bhatia, M., Hartman, S., Zhang, D., and A. Lindem, 880 "Security Extension for OSPFv2 when using Manual Key 881 Management", Work in Progress, October 2011. 883 [RFC2104] Krawczyk, H., Bellare, M., and R. Canetti, "HMAC: Keyed- 884 Hashing for Message Authentication", RFC 2104, 885 February 1997. 887 [RFC4222] Choudhury, G., "Prioritized Treatment of Specific OSPF 888 Version 2 Packets and Congestion Avoidance", BCP 112, 889 RFC 4222, October 2005. 891 [RFC4302] Kent, S., "IP Authentication Header", RFC 4302, 892 December 2005. 894 [RFC4303] Kent, S., "IP Encapsulating Security Payload (ESP)", 895 RFC 4303, December 2005. 897 [RFC4552] Gupta, M. and N. Melam, "Authentication/Confidentiality 898 for OSPFv3", RFC 4552, June 2006. 900 [RFC4822] Atkinson, R. and M. Fanto, "RIPv2 Cryptographic 901 Authentication", RFC 4822, February 2007. 903 [RFC5310] Bhatia, M., Manral, V., Li, T., Atkinson, R., White, R., 904 and M. Fanto, "IS-IS Generic Cryptographic 905 Authentication", RFC 5310, February 2009. 907 [RFC5613] Zinin, A., Roy, A., Nguyen, L., Friedman, B., and D. 908 Yeung, "OSPF Link-Local Signaling", RFC 5613, August 2009. 910 [RFC5996] Kaufman, C., Hoffman, P., Nir, Y., and P. Eronen, 911 "Internet Key Exchange Protocol Version 2 (IKEv2)", 912 RFC 5996, September 2010. 914 [RFC6039] Manral, V., Bhatia, M., Jaeggli, J., and R. White, "Issues 915 with Existing Cryptographic Protection Methods for Routing 916 Protocols", RFC 6039, October 2010. 918 [RFC6234] Eastlake, D. and T. Hansen, "US Secure Hash Algorithms 919 (SHA and SHA-based HMAC and HKDF)", RFC 6234, May 2011. 921 Appendix A. Acknowledgments 923 First and foremost, thanks to the US National Institute of Standards 924 and Technology for their work on the SHA [FIPS-180-3] and HMAC 925 [FIPS-198-1]. 927 Thanks also need to go to the authors of the HMAC-SHA authentication 928 RFCs including [RFC4822], [RFC5310], and [RFC5709]. The basic HMAC- 929 SHA procedures were originally described by Ran Atkinson and Tony Li 930 in [RFC4822]. 932 Also, thanks to Ran Atkinson for help in the analysis of RFC 6506 933 errata. 935 Thanks to Srinivasan K L and Marek Karasek for their identification 936 and submission of RFC 6506 errata. 938 Thanks to Sam Hartman for discussions on replay mitigation and the 939 use of a 64-bit strictly increasing sequence number. Also, thanks to 940 Sam for comments during IETF last call with respect to the OSPFv3 SA 941 and sharing of key between protocols. 943 Thanks to Michael Barnes for numerous comments and strong input on 944 the coverage of LLS by the Authentication Trailer (AT). 946 Thanks to Marek Karasek for providing the specifics with respect to 947 backward compatible transition mode. 949 Thanks to Michael Dubrovskiy and Anton Smirnov for comments on draft 950 revisions. 952 Thanks to Rajesh Shetty for numerous comments, including the 953 suggestion to include an Authentication Type field in the 954 Authentication Trailer for extendibility. 956 Thanks to Uma Chunduri for suggesting that we may want to protect the 957 IPv6 source address even though OSPFv3 uses the Router ID for 958 neighbor identification. 960 Thanks to Srinivasan KL, Shraddha H, Alan Davey, Russ White, Stan 961 Ratliff, and Glen Kent for their support and review comments. 963 Thanks to Alia Atlas for comments made under the purview of the 964 Routing Directorate review. 966 Thanks to Stephen Farrell for comments during the IESG review. 967 Stephen was also involved in the discussion of cross-protocol 968 attacks. 970 Thanks to Brian Carpenter for comments made during Gen-ART review. 972 Authors' Addresses 974 Manav Bhatia 975 Alcatel-Lucent 976 Bangalore 977 India 979 Email: manav.bhatia@alcatel-lucent.com 981 Vishwas Manral 982 Hewlett Packard 983 USA 985 Email: vishwas.manral@hp.com 987 Acee Lindem 988 Ericsson 989 102 Carric Bend Court 990 Cary, NC 27519 991 USA 993 Email: acee.lindem@ericsson.com