idnits 2.17.00 (12 Aug 2021) /tmp/idnits64905/draft-ietf-ospf-rfc6506bis-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 (December 8, 2013) is 3086 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: June 11, 2014 A. Lindem 7 Ericsson 8 December 8, 2013 10 Supporting Authentication Trailer for OSPFv3 11 draft-ietf-ospf-rfc6506bis-04.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. 25 The OSPFv3 Authentication Trailer was originally defined in RFC 6506. 26 This document obsoletes RFC 6506 by providing a revised definition 27 including clarifications and refinements of the procedures. 29 Status of this Memo 31 This Internet-Draft is submitted in full conformance with the 32 provisions of BCP 78 and BCP 79. 34 Internet-Drafts are working documents of the Internet Engineering 35 Task Force (IETF). Note that other groups may also distribute 36 working documents as Internet-Drafts. The list of current Internet- 37 Drafts is at http://datatracker.ietf.org/drafts/current/. 39 Internet-Drafts are draft documents valid for a maximum of six months 40 and may be updated, replaced, or obsoleted by other documents at any 41 time. It is inappropriate to use Internet-Drafts as reference 42 material or to cite them other than as "work in progress." 44 This Internet-Draft will expire on June 11, 2014. 46 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 . . . . . . . . . . . . . . . . . . . . . . . . . 3 64 1.1. Requirements . . . . . . . . . . . . . . . . . . . . . . . 4 65 1.2. Summary of Changes from RFC 6506 . . . . . . . . . . . . . 4 66 2. Proposed Solution . . . . . . . . . . . . . . . . . . . . . . 6 67 2.1. AT-Bit in Options Field . . . . . . . . . . . . . . . . . 6 68 2.2. Basic Operation . . . . . . . . . . . . . . . . . . . . . 7 69 2.3. IPv6 Source Address Protection . . . . . . . . . . . . . . 7 70 3. OSPFv3 Security Association . . . . . . . . . . . . . . . . . 9 71 4. Authentication Procedure . . . . . . . . . . . . . . . . . . . 11 72 4.1. Authentication Trailer . . . . . . . . . . . . . . . . . . 11 73 4.1.1. Sequence Number Wrap . . . . . . . . . . . . . . . . . 12 74 4.2. OSPFv3 Header Checksum and LLS Data Block Checksum . . . . 13 75 4.3. Cryptographic Authentication Procedure . . . . . . . . . . 13 76 4.4. Cross-Protocol Attack Mitigation . . . . . . . . . . . . . 14 77 4.5. Cryptographic Aspects . . . . . . . . . . . . . . . . . . 14 78 4.6. Message Verification . . . . . . . . . . . . . . . . . . . 16 79 5. Migration and Backward Compatibility . . . . . . . . . . . . . 19 80 6. Security Considerations . . . . . . . . . . . . . . . . . . . 20 81 7. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 21 82 8. References . . . . . . . . . . . . . . . . . . . . . . . . . . 22 83 8.1. Normative References . . . . . . . . . . . . . . . . . . . 22 84 8.2. Informative References . . . . . . . . . . . . . . . . . . 22 85 Appendix A. Acknowledgments . . . . . . . . . . . . . . . . . . . 24 86 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . . 26 88 1. Introduction 90 Unlike Open Shortest Path First version 2 (OSPFv2) [RFC2328], OSPF 91 for IPv6 (OSPFv3) [RFC5340] does not include the AuType and 92 Authentication fields in its headers for authenticating protocol 93 packets. Instead, OSPFv3 relies on the IPsec protocols 94 Authentication Header (AH) [RFC4302] and Encapsulating Security 95 Payload (ESP) [RFC4303] to provide integrity, authentication, and/or 96 confidentiality. 98 [RFC4552] describes how IPv6 AH and ESP extension headers can be used 99 to provide authentication and/or confidentiality to OSPFv3. 101 However, there are some environments, e.g., Mobile Ad Hoc Networks 102 (MANETs), where IPsec is difficult to configure and maintain, and 103 this mechanism cannot be used. 105 [RFC4552] discusses, at length, the reasoning behind using manually 106 configured keys, rather than some automated key management protocol 107 such as Internet Key Exchange version 2 (IKEv2) [RFC5996]. The 108 primary problem is the lack of a suitable key management mechanism, 109 as OSPFv3 adjacencies are formed on a one-to-many basis and most key 110 management mechanisms are designed for a one-to-one communication 111 model. This forces the system administrator to use manually 112 configured security associations (SAs) and cryptographic keys to 113 provide the authentication and, if desired, confidentiality services. 115 Regarding replay protection, [RFC4552] states that: 117 Since it is not possible using the current standards to provide 118 complete replay protection while using manual keying, the proposed 119 solution will not provide protection against replay attacks. 121 Since there is no replay protection provided there are a number of 122 vulnerabilities in OSPFv3 that have been discussed in [RFC6039]. 124 While techniques exist to identify ESP Null packets [RFC5879], these 125 techniques are generally not implemented in the data planes of OSPFv3 126 routers. This makes it very difficult for implementations to examine 127 OSPFv3 packet and prioritize certain OSPFv3 packet types, e.g., Hello 128 packets, over the other types. 130 This document defines a new mechanism that works similarly to OSPFv2 131 [RFC5709] to provide authentication to the OSPFv3 packets and 132 attempts to solve the problems related to replay protection and 133 deterministically disambiguating different OSPFv3 packets as 134 described above. 136 This document adds support for the Secure Hash Algorithms (SHAs) 137 defined in the US NIST Secure Hash Standard (SHS), which is specified 138 by NIST FIPS 180-3. [FIPS-180-3] includes SHA-1, SHA-224, SHA-256, 139 SHA-384, and SHA-512. The Hashed Message Authentication Code (HMAC) 140 authentication mode defined in NIST FIPS 198-1 [FIPS-198-1] is used. 142 It is believed that HMAC as defined in [RFC2104] is mathematically 143 identical to [FIPS-198-1]; it is also believed that algorithms in 144 [RFC6234] are mathematically identical to [FIPS-198-1]. 146 1.1. Requirements 148 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 149 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 150 document are to be interpreted as described in RFC 2119 [RFC2119]. 152 1.2. Summary of Changes from RFC 6506 154 This document includes the following changes from RFC 6506 [RFC6506]: 156 1. Sections 2.2 and 4.2 explicitly state that the Link-Local 157 Signaling (LLS) block checksum calculation is omitted when an 158 OSPFv3 authentication trailer is used for OSPFv3 authentication. 159 The LLS block is included in the authentication digest 160 calculation and computation of a checksum is unnecessary. 161 Clarification of this issue was documented in an erratum. 163 2. Section 3 previously recommended usage of an expired key for 164 transmitted OSPFv3 packets when no valid keys existed. This 165 statement has been removed. 167 3. Section 4.5 includes a correction to the key preparation to use 168 the protocol specific key (Ks) rather than the key (K) as the 169 initial key (Ko). This problem was also documented in an 170 erratum. 172 4. Section 4.5 also includes a discussion of the choice of key 173 length to be the hash length (L) rather than the block size (B). 174 The discussion of this choice was included to clarify an issue 175 raised in a rejected erratum. 177 5. Section 4.1 and 4.6 indicate that sequence number checking is 178 dependent on OSPFv3 packet type in order to account for packet 179 prioritization as specified in [RFC4222]. This was an omission 180 from RFC 6506 [RFC6506]. 182 6. Section 4.6 explicitly states that OSPFv3 packets with a non- 183 existent or expired Security Association (SA) will be dropped. 185 7. Section 5 includes guidance on precisely the actions required for 186 an OSPFv3 router providing a backward compatible transition mode. 188 2. Proposed Solution 190 To perform non-IPsec Cryptographic Authentication, OSPFv3 routers 191 append a special data block, henceforth referred to as the 192 Authentication Trailer, to the end of the OSPFv3 packets. The length 193 of the Authentication Trailer is not included in the length of the 194 OSPFv3 packet but is included in the IPv6 payload length, as shown in 195 Figure 1. 197 +---------------------+ -- -- +----------------------+ 198 | IPv6 Payload Length | ^ ^ | IPv6 Payload Length | 199 | PL = OL + LL | | | | PL = OL + LL + AL | 200 | | v v | | 201 +---------------------+ -- -- +----------------------+ 202 | OSPFv3 Header | ^ ^ | OSPFv3 Header | 203 | Length = OL | | | | Length = OL | 204 | | | OSPFv3 | | | 205 |.....................| | Packet | |......................| 206 | | | Length | | | 207 | OSPFv3 Packet | | | | OSPFv3 Packet | 208 | | v v | | 209 +---------------------+ -- -- +----------------------+ 210 | | ^ ^ | | 211 | Optional LLS | | LLS Data | | Optional LLS | 212 | LLS Block Len = LL | | Block | | LLS Block Len = LL | 213 | | v Length v | | 214 +---------------------+ -- -- +----------------------+ 215 ^ | | 216 AL = PL - (OL + LL) | | Authentication | 217 | | AL = Fixed Trailer + | 218 v | Digest Length | 219 -- +----------------------+ 221 Figure 1: Authentication Trailer in OSPFv3 223 The presence of the Link-Local Signaling (LLS) [RFC5613] block is 224 determined by the L-bit setting in the OSPFv3 Options field in OSPFv3 225 Hello and Database Description packets. If present, the LLS data 226 block is included along with the OSPFv3 packet in the Cryptographic 227 Authentication computation. 229 2.1. AT-Bit in Options Field 231 A new AT-bit (AT stands for Authentication Trailer) is introduced 232 into the OSPFv3 Options field. OSPFv3 routers MUST set the AT-bit in 233 OSPFv3 Hello and Database Description packets to indicate that all 234 the packets on this link will include an Authentication Trailer. For 235 OSPFv3 Hello and Database Description packets, the AT-bit indicates 236 the AT is present. For other OSPFv3 packet types, the OSPFv3 AT-bit 237 setting from the OSPFv3 Hello/Database Description setting is 238 preserved in the OSPFv3 neighbor data structure. OSPFv3 packet types 239 that don't include an OSPFv3 Options field will use the setting from 240 the neighbor data structure to determine whether or not the AT is 241 expected. 243 0 1 2 244 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 245 +-+-+-+-+-+-+-+-+-+-+-+-+-+--+-+--+-+-+--+-+-+--+-+--+ 246 | | | | | | | | | | | | | |AT|L|AF|*|*|DC|R|N|MC|E|V6| 247 +-+-+-+-+-+-+-+-+-+-+-+-+-+--+-+--+-+-+--+-+-+--+-+--+ 249 Figure 2: OSPFv3 Options Field 251 The AT-bit, as shown in the figure above, MUST be set in all OSPFv3 252 Hello and Database Description packets that contain an Authentication 253 Trailer. 255 2.2. Basic Operation 257 The procedure followed for computing the Authentication Trailer is 258 much the same as described in [RFC5709] and [RFC2328]. One 259 difference is that the LLS data block, if present, is included in the 260 Cryptographic Authentication computation. 262 The way the authentication data is carried in the Authentication 263 Trailer is very similar to how it is done in case of [RFC2328]. The 264 only difference between the OSPFv2 Authentication Trailer and the 265 OSPFv3 Authentication Trailer is that information in addition to the 266 message digest is included. The additional information in the OSPFv3 267 Authentication Trailer is included in the message digest computation 268 and is therefore protected by OSPFv3 Cryptographic Authentication as 269 described herein. 271 Consistent with OSPFv2 Cryptographic Authentication [RFC2328] and 272 Link-Local Signaling Cryptographic Authentication [RFC5613], checksum 273 calculation and verification are omitted for both the OSPFv3 header 274 checksum and the LLS Data Block when the OSPFv3 authentication 275 mechanism described in this specification is used. 277 2.3. IPv6 Source Address Protection 279 While OSPFv3 always uses the Router ID to identify OSPFv3 neighbors, 280 the IPv6 source address is learned from OSPFv3 Hello packets and 281 copied into the neighbor data structure [RFC5340]. Hence, OSPFv3 is 282 susceptible to Man-in-the-Middle attacks where the IPv6 source 283 address is modified. To thwart such attacks, the IPv6 source address 284 will be included in the message digest calculation and protected by 285 OSPFv3 authentication. Refer to Section 4.5 for details. This is 286 different than the procedure specified in [RFC5709] but consistent 287 with [MANUAL-KEY]. 289 3. OSPFv3 Security Association 291 An OSPFv3 Security Association (SA) contains a set of parameters 292 shared between any two legitimate OSPFv3 speakers. 294 Parameters associated with an OSPFv3 SA are as follows: 296 o Security Association Identifier (SA ID) 298 This is a 16-bit unsigned integer used to uniquely identify an 299 OSPFv3 SA, as manually configured by the network operator. 301 The receiver determines the active SA by looking at the SA ID 302 field in the incoming protocol packet. 304 The sender, based on the active configuration, selects an SA to 305 use and puts the correct Key ID value associated with the SA in 306 the OSPFv3 protocol packet. If multiple valid and active OSPFv3 307 SAs exist for a given interface, the sender may use any of those 308 SAs to protect the packet. 310 Using SA IDs makes changing keys while maintaining protocol 311 operation convenient. Each SA ID specifies two independent parts, 312 the authentication algorithm and the Authentication Key, as 313 explained below. 315 Normally, an implementation would allow the network operator to 316 configure a set of keys in a key chain, with each key in the chain 317 having a fixed lifetime. The actual operation of these mechanisms 318 is outside the scope of this document. 320 Note that each SA ID can indicate a key with a different 321 authentication algorithm. This allows the introduction of new 322 authentication mechanisms without disrupting existing OSPFv3 323 adjacencies. 325 o Authentication Algorithm 327 This signifies the authentication algorithm to be used with this 328 OSPFv3 SA. This information is never sent in clear text over the 329 wire. Because this information is not sent on the wire, the 330 implementer chooses an implementation-specific representation for 331 this information. 333 Currently, the following algorithms are supported: 335 * HMAC-SHA-1, 336 * HMAC-SHA-256, 338 * HMAC-SHA-384, and 340 * HMAC-SHA-512. 342 o Authentication Key 344 This value denotes the Cryptographic Authentication Key associated 345 with this OSPFv3 SA. The length of this key is variable and 346 depends upon the authentication algorithm specified by the OSPFv3 347 SA. 349 o KeyStartAccept 351 The time that this OSPFv3 router will accept packets that have 352 been created with this OSPFv3 SA. 354 o KeyStartGenerate 356 The time that this OSPFv3 router will begin using this OSPFv3 SA 357 for OSPFv3 packet generation. 359 o KeyStopGenerate 361 The time that this OSPFv3 router will stop using this OSPFv3 SA 362 for OSPFv3 packet generation. 364 o KeyStopAccept 366 The time that this OSPFv3 router will stop accepting packets 367 generated with this OSPFv3 SA. 369 In order to achieve smooth key transition, KeyStartAccept SHOULD be 370 less than KeyStartGenerate, and KeyStopGenerate SHOULD be less than 371 KeyStopAccept. If KeyStartGenerate or KeyStartAccept are left 372 unspecified, the time will default to 0, and the key will be used 373 immediately. If KeyStopGenerate or KeyStopAccept are left 374 unspecified, the time will default to infinity, and the key's 375 lifetime will be infinite. When a new key replaces an old, the 376 KeyStartGenerate time for the new key MUST be less than or equal to 377 the KeyStopGenerate time of the old key. 379 Key storage SHOULD persist across a system restart, warm or cold, to 380 avoid operational issues. In the event that the last key associated 381 with an interface expires, the network operator SHOULD be notified 382 and the OSPFv3 packet MUST NOT be transmitted unauthenticated. 384 4. Authentication Procedure 386 4.1. Authentication Trailer 388 The Authentication Trailer that is appended to the OSPFv3 protocol 389 packet is described below: 391 0 1 2 3 392 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 393 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 394 | Authentication Type | Auth Data Len | 395 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 396 | Reserved | Security Association ID | 397 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 398 | Cryptographic Sequence Number (High-Order 32 Bits) | 399 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 400 | Cryptographic Sequence Number (Low-Order 32 Bits) | 401 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 402 | | 403 | Authentication Data (Variable) | 404 ~ ~ 405 | | 406 | | 407 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 409 Figure 3: Authentication Trailer Format 411 The various fields in the Authentication Trailer are: 413 o Authentication Type 415 16-bit field identifying the type of authentication. The 416 following values are defined in this specification: 418 0 - Reserved. 419 1 - HMAC Cryptographic Authentication as described herein. 421 o Auth Data Len 423 The length in octets of the Authentication Trailer (AT) including 424 both the 16-octet fixed header and the variable length message 425 digest. 427 o Reserved 429 This field is reserved. It SHOULD be set to 0 when sending 430 protocol packets and MUST be ignored when receiving protocol 431 packets. 433 o Security Association Identifier (SA ID) 435 16-bit field that maps to the authentication algorithm and the 436 secret key used to create the message digest appended to the 437 OSPFv3 protocol packet. 439 Though the SA ID implicitly implies the algorithm, the HMAC output 440 size should not be used by implementers as an implicit hint 441 because additional algorithms may be defined in the future that 442 have the same output size. 444 o Cryptographic Sequence Number 446 64-bit strictly increasing sequence number that is used to guard 447 against replay attacks. The 64-bit sequence number MUST be 448 incremented for every OSPFv3 packet sent by the OSPFv3 router. 449 Upon reception, the sequence number MUST be greater than the 450 sequence number in the last accepted OSPFv3 packet of the same 451 OSPFv3 packet type from the sending OSPFv3 neighbor. Otherwise, 452 the OSPFv3 packet is considered a replayed packet and dropped. 453 OSPFv3 packets of different types may arrive out of order if they 454 are prioritized as recommended in [RFC4222]. 456 OSPFv3 routers implementing this specification MUST use available 457 mechanisms to preserve the sequence number's strictly increasing 458 property for the deployed life of the OSPFv3 router (including 459 cold restarts). One mechanism for accomplishing this would be to 460 use the high-order 32 bits of the sequence number as a wrap/boot 461 count that is incremented anytime the OSPFv3 router loses its 462 sequence number state. Sequence number wrap is described in 463 Section 4.1.1. 465 o Authentication Data 467 Variable data that is carrying the digest for the protocol packet 468 and optional LLS data block. 470 4.1.1. Sequence Number Wrap 472 When incrementing the sequence number for each transmitted OSPFv3 473 packet, the sequence number should be treated as an unsigned 64-bit 474 value. If the lower-order 32-bit value wraps, the higher-order 475 32-bit value should be incremented and saved in non-volatile storage. 476 If by some chance the OSPFv3 router is deployed long enough that 477 there is a possibility that the 64-bit sequence number may wrap, all 478 keys, independent of their key distribution mechanism, MUST be reset 479 to avoid the possibility of replay attacks. Once the keys have been 480 changed, the higher-order sequence number can be reset to 0 and saved 481 to non-volatile storage. 483 4.2. OSPFv3 Header Checksum and LLS Data Block Checksum 485 Both the checksum calculation and verification are omitted for the 486 OSPFv3 header checksum and the LLS Data Block checksum [RFC5613] when 487 the OSPFv3 authentication mechanism described in this specification 488 is used. This implies: 490 o For OSPFv3 packets to be transmitted, the OSPFv3 header checksum 491 computation is omitted, and the OSPFv3 header checksum SHOULD be 492 set to 0 prior to computation of the OSPFv3 Authentication Trailer 493 message digest. 495 o For OSPFv3 packets including an LLS Data Block to be transmitted, 496 the OSPFv3 LLS Data Block checksum computation is omitted, and the 497 OSPFv3 LLS Data Block checksum SHOULD be set to 0 prior to 498 computation of the OSPFv3 Authentication Trailer message digest. 500 o For received OSPFv3 packets including an OSPFv3 Authentication 501 Trailer, OSPFv3 header checksum verification MUST be omitted. 502 However, if the OSPFv3 packet does include a non-zero OSPFv3 503 header checksum, it will not be modified by the receiver and will 504 simply be included in the OSPFv3 Authentication Trailer message 505 digest verification. 507 o For received OSPFv3 packets including an LLS Data Block and OSPFv3 508 Authentication Trailer, LLS Data Block checksum verification MUST 509 be omitted. However, if the OSPFv3 packet does include an LLS 510 Block with a non-zero checksum, it will not be modified by the 511 receiver and will simply be included in the OSPFv3 Authentication 512 Trailer message digest verification. 514 4.3. Cryptographic Authentication Procedure 516 As noted earlier, the SA ID maps to the authentication algorithm and 517 the secret key used to generate and verify the message digest. This 518 specification discusses the computation of OSPFv3 Cryptographic 519 Authentication data when any of the NIST SHS family of algorithms is 520 used in the Hashed Message Authentication Code (HMAC) mode. 522 The currently valid algorithms (including mode) for OSPFv3 523 Cryptographic Authentication include: 525 o HMAC-SHA-1, 527 o HMAC-SHA-256, 528 o HMAC-SHA-384, and 530 o HMAC-SHA-512. 532 Of the above, implementations of this specification MUST include 533 support for at least HMAC-SHA-256 and SHOULD include support for 534 HMAC-SHA-1 and MAY also include support for HMAC-SHA-384 and 535 HMAC-SHA-512. 537 Implementations of this specification MUST use HMAC-SHA-256 as the 538 default authentication algorithm. 540 4.4. Cross-Protocol Attack Mitigation 542 In order to prevent cross-protocol replay attacks for protocols 543 sharing common keys, the two-octet OSPFv3 Cryptographic Protocol ID 544 is appended to the Authentication Key prior to use. Other protocols 545 using Cryptographic Authentication as specified herein MUST similarly 546 append their respective Cryptographic Protocol IDs to their keys in 547 this step. Refer to the IANA Considerations (Section 7). 549 4.5. Cryptographic Aspects 551 In the algorithm description below, the following nomenclature, which 552 is consistent with [FIPS-198-1], is used: 554 H is the specific hashing algorithm (e.g., SHA-256). 556 K is the Authentication Key from the OSPFv3 Security Association. 558 Ks is a Protocol-Specific Authentication Key obtained by appending 559 Authentication Key (K) with the two-octet OSPFv3 Cryptographic 560 Protocol ID. 562 Ko is the cryptographic key used with the hash algorithm. 564 B is the block size of H, measured in octets rather than bits. Note 565 that B is the internal block size, not the hash size. 567 For SHA-1 and SHA-256: B == 64 569 For SHA-384 and SHA-512: B == 128 571 L is the length of the hash, measured in octets rather than bits. 573 XOR is the exclusive-or operation. 575 Opad is the hexadecimal value 0x5c repeated B times. 577 Ipad is the hexadecimal value 0x36 repeated B times. 579 Apad is a value that is the same length as the hash output or message 580 digest. The first 16 octets contain the IPv6 source address followed 581 by the hexadecimal value 0x878FE1F3 repeated (L-16)/4 times. This 582 implies that hash output is always a length of at least 16 octets. 584 1. Preparation of the Key 586 The OSPFv3 Cryptographic Protocol ID is appended to the 587 Authentication Key (K) yielding a Protocol-Specific 588 Authentication Key (Ks). In this application, Ko is always L 589 octets long. While [RFC2104] supports a key that is up to B 590 octets long, this application uses L as the Ks length consistent 591 with [RFC4822], [RFC5310], and [RFC5709]. According to 592 [FIPS-198-1], Section 3, keys greater than L octets do not 593 significantly increase the function strength. Ks is computed as 594 follows: 596 If the Protocol-Specific Authentication Key (Ks) is L octets 597 long, then Ko is equal to Ks. If the Protocol-Specific 598 Authentication Key (Ks) is more than L octets long, then Ko is 599 set to H(Ks). If the Protocol-Specific Authentication Key 600 (Ks) is less than L octets long, then Ko is set to the 601 Protocol-Specific Authentication Key (Ks) with zeros appended 602 to the end of the Protocol-Specific Authentication Key (Ks) 603 such that Ko is L octets long. 605 2. First-Hash 607 First, the OSPFv3 packet's Authentication Data field in the 608 Authentication Trailer is filled with the value Apad. This is 609 very similar to the appendage described in [RFC2328], Section 610 D.4.3, Items (6)(a) and (6)(d)). 612 Then, a First-Hash, also known as the inner hash, is computed as 613 follows: 615 First-Hash = H(Ko XOR Ipad || (OSPFv3 Packet)) 617 When XORing Ko and Ipad, Ko will be padded with zeros to the 618 length of Ipad. 620 Implementation Note: The First-Hash above includes the 621 Authentication Trailer, as well as the OSPFv3 packet, as per 622 [RFC2328], Section D.4.3, and, if present, the LLS data block 623 [RFC5613]. 625 The definition of Apad (above) ensures it is always the same 626 length as the hash output. This is consistent with RFC 2328. 627 Note that the "(OSPFv3 Packet)" referenced in the First-Hash 628 function above includes both the optional LLS data block and the 629 OSPFv3 Authentication Trailer. 631 The digest length for SHA-1 is 20 octets; for SHA-256, 32 octets; 632 for SHA-384, 48 octets; and for SHA-512, 64 octets. 634 3. Second-Hash 636 Then a Second-Hash, also known as the outer hash, is computed as 637 follows: 639 Second-Hash = H(Ko XOR Opad || First-Hash) 641 When XORing Ko and Opad, Ko will be padded with zeros to the 642 length of Ipad. 644 4. Result 646 The resulting Second-Hash becomes the authentication data that is 647 sent in the Authentication Trailer of the OSPFv3 packet. The 648 length of the authentication data is always identical to the 649 message digest size of the specific hash function H that is being 650 used. 652 This also means that the use of hash functions with larger output 653 sizes will also increase the size of the OSPFv3 packet as 654 transmitted on the wire. 656 Implementation Note: [RFC2328], Appendix D specifies that the 657 Authentication Trailer is not counted in the OSPF packet's own 658 Length field but is included in the packet's IP Length field. 659 Similar to this, the Authentication Trailer is not included in 660 the OSPFv3 header length but is included in the IPv6 header 661 payload length. 663 4.6. Message Verification 665 A router would determine that OSPFv3 is using an Authentication 666 trailer by examining the AT-bit in the Options field in the OSPFv3 667 header for Hello and Database Description packets. The specification 668 in the Hello and Database Description options indicates that other 669 OSPFv3 packets will include the Authentication Trailer. 671 The Authentication Trailer (AT) is accessed using the OSPFv3 packet 672 header length to access the data after the OSPFv3 packet and, if an 673 LLS data block [RFC5613] is present, using the LLS data block length 674 to access the data after the LLS data block. The L-bit in the OSPFv3 675 options in Hello and Database Description packets is examined to 676 determine if an LLS data block is present. If an LLS data block is 677 present (as specified by the L-bit), it is included along with the 678 OSPFv3 Hello or Database Description packet in the cryptographic 679 authentication computation. 681 Due to the placement of the AT following the LLS data block and the 682 fact that the LLS data block is included in the Cryptographic 683 Authentication computation, OSPFv3 routers supporting this 684 specification MUST minimally support examining the L-bit in the 685 OSPFv3 options and using the length in the LLS data block to access 686 the AT. It is RECOMMENDED that OSPFv3 routers supporting this 687 specification fully support OSPFv3 Link-Local Signaling [RFC5613]. 689 If usage of the Authentication Trailer (AT), as specified herein, is 690 configured for an OSPFv3 link, OSPFv3 Hello and Database Description 691 packets with the AT-bit clear in the options will be dropped. All 692 OSPFv3 packet types will be dropped if AT is configured for the link 693 and the IPv6 header length is less than the amount necessary to 694 include an Authentication Trailer. 696 Locate the receiving interface's OSPFv3 SA using the SA ID in the 697 received AT. If the SA is not found, or if the SA is not valid for 698 reception (i.e., current time < KeyStartAccept or current time >= 699 KeyStopAccept), the OSPFv3 packet is dropped. 701 If the cryptographic sequence number in the AT is less than or equal 702 to the last sequence number in the last OSPFv3 packet of the same 703 OSPFv3 type successfully received from the neighbor, the OSPFv3 704 packet MUST be dropped, and an error event SHOULD be logged. OSPFv3 705 packets of different types may arrive out of order if they are 706 prioritized as recommended in [RFC4222]. 708 Authentication-algorithm-dependent processing needs to be performed, 709 using the algorithm specified by the appropriate OSPFv3 SA for the 710 received packet. 712 Before an implementation performs any processing, it needs to save 713 the values of the Authentication Data field from the Authentication 714 Trailer appended to the OSPFv3 packet. 716 It should then set the Authentication Data field with Apad before the 717 authentication data is computed (as described in Section 4.5). The 718 calculated data is compared with the received authentication data in 719 the Authentication Trailer. If the two do not match, the packet MUST 720 be discarded and an error event SHOULD be logged. 722 After the OSPFv3 packet has been successfully authenticated, 723 implementations MUST store the 64-bit cryptographic sequence number 724 for each OSPFv3 packet type received from the neighbor. The saved 725 cryptographic sequence numbers will be used for replay checking for 726 subsequent packets received from the neighbor. 728 5. Migration and Backward Compatibility 730 All OSPFv3 routers participating on a link SHOULD be migrated to 731 OSPFv3 Authentication at the same time. As with OSPFv2 732 authentication, a mismatch in the SA ID, Authentication Type, or 733 message digest will result in failure to form an adjacency. For 734 multi-access links, communities of OSPFv3 routers could be migrated 735 using different Interface Instance IDs. However, at least one router 736 would need to form adjacencies between both the OSPFv3 routers 737 including and not including the Authentication Trailer. This would 738 result in sub-optimal routing as well as added complexity and is only 739 recommended in cases where authentication is desired on the link and 740 migrating all the routers on the link at the same time isn't 741 feasible. 743 In support of uninterrupted deployment, an OSPFv3 router implementing 744 this specification MAY implement a transition mode where it includes 745 the Authentication Trailer in transmitted packets but does not verify 746 this information in received packets. This is provided as a 747 transition aid for networks in the process of migrating to the 748 authentication mechanism described in this specification. More 749 specifically: 751 1. OSPFv3 routers in transition mode will include the OSPFv3 752 authentication trailer in transmitted packets and set the AT-Bit 753 in the options field of transmitted Hello and Database 754 Description packets. OSPFv3 routers receiving these packets and 755 not having authentication configured will ignore the 756 authentication trailer and AT-bit. 758 2. OSPFv3 routers in transition mode will also calculate and set the 759 OSPFv3 header checksum and the LLS block checksum in transmitted 760 packets so that they will not be dropped by OSPFv3 routers 761 without authentication configured. 763 3. OSPFv3 routers in transition mode will authenticate received 764 packets that either have the AT-Bit set in the options field for 765 Hello or Database Description packets or are from a neighbor that 766 previously set the AT-Bit in the options field of successfully 767 authenticated Hello and Database Description packets. 769 4. OSPFv3 routers in transition mode will also accept packets 770 without the options field AT-Bit set in Hello and Database 771 Description packets. These packets will be assumed to be from 772 OSPFv3 routers without authentication configured and they will 773 not be authenticated. Additionally, the OSPFv3 header checksum 774 and LLS block checksum will be validated. 776 6. Security Considerations 778 The document proposes extensions to OSPFv3 that would make it more 779 secure than [RFC5340]. It does not provide confidentiality as a 780 routing protocol contains information that does not need to be kept 781 secret. It does, however, provide means to authenticate the sender 782 of the packets that are of interest. It addresses all the security 783 issues that have been identified in [RFC6039] and [RFC6506]. 785 It should be noted that the authentication method described in this 786 document is not being used to authenticate the specific originator of 787 a packet but is rather being used to confirm that the packet has 788 indeed been issued by a router that has access to the Authentication 789 Key. 791 Deployments SHOULD use sufficiently long and random values for the 792 Authentication Key so that guessing and other cryptographic attacks 793 on the key are not feasible in their environments. Furthermore, it 794 is RECOMMENDED that Authentication Keys incorporate at least 128 795 pseudo-random bits to minimize the risk of such attacks. In support 796 of these recommendations, management systems SHOULD support 797 hexadecimal input of Authentication Keys. 799 Deployments supporting a transitionary state which interoperate with 800 routers that do not support this authentication method may be exposed 801 to unauthenticated data during the transition period. 803 The mechanism described herein is not perfect and does not need to be 804 perfect. Instead, this mechanism represents a significant increase 805 in the effort required for an adversary to successfully attack the 806 OSPFv3 protocol while not causing undue implementation, deployment, 807 or operational complexity. 809 Refer to [RFC4552] for additional considerations on manual keying. 811 7. IANA Considerations 813 This document obsoletes RFC 6506 and thus IANA is requested to update 814 the reference for the existing registries previously created by RFC 815 6506 to this document. This is the only IANA action requested by 816 this document. 818 IANA has allocated the AT-bit (0x000400) in the "OSPFv3 Options (24 819 bits)" registry as described in Section 2.1. 821 IANA has created the "OSPFv3 Authentication Trailer Options" 822 registry. This new registry initially includes the "OSPFv3 823 Authentication Types" registry, which defines valid values for the 824 Authentication Type field in the OSPFv3 Authentication Trailer. The 825 registration procedure is Standards Action. 827 +-------------+-----------------------------------+ 828 | Value/Range | Designation | 829 +-------------+-----------------------------------+ 830 | 0 | Reserved | 831 | | | 832 | 1 | HMAC Cryptographic Authentication | 833 | | | 834 | 2-65535 | Unassigned | 835 +-------------+-----------------------------------+ 837 OSPFv3 Authentication Types 839 Finally, IANA has created the "Keying and Authentication for Routing 840 Protocols (KARP) Parameters" category. This new category initially 841 includes the "Authentication Cryptographic Protocol ID" registry, 842 which provides unique protocol-specific values for cryptographic 843 applications, such as but not limited to, prevention of cross- 844 protocol replay attacks. Values can be assigned for both native 845 IPv4/IPv6 protocols and UDP/TCP protocols. The registration 846 procedure is Standards Action. 848 +-------------+----------------------+ 849 | Value/Range | Designation | 850 +-------------+----------------------+ 851 | 0 | Reserved | 852 | | | 853 | 1 | OSPFv3 | 854 | | | 855 | 2-65535 | Unassigned | 856 +-------------+----------------------+ 858 Cryptographic Protocol ID 860 8. References 862 8.1. Normative References 864 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 865 Requirement Levels", BCP 14, RFC 2119, March 1997. 867 [RFC2328] Moy, J., "OSPF Version 2", STD 54, RFC 2328, April 1998. 869 [RFC5340] Coltun, R., Ferguson, D., Moy, J., and A. Lindem, "OSPF 870 for IPv6", RFC 5340, July 2008. 872 [RFC5709] Bhatia, M., Manral, V., Fanto, M., White, R., Barnes, M., 873 Li, T., and R. Atkinson, "OSPFv2 HMAC-SHA Cryptographic 874 Authentication", RFC 5709, October 2009. 876 [RFC6506] Bhatia, M., Manral, V., and A. Lindem, "Supporting 877 Authentication Trailer for OSPFv3", RFC 6506, 878 February 2012. 880 8.2. Informative References 882 [FIPS-180-3] 883 US National Institute of Standards and Technology, "Secure 884 Hash Standard (SHS)", FIPS PUB 180-3, October 2008. 886 [FIPS-198-1] 887 US National Institute of Standards and Technology, "The 888 Keyed-Hash Message Authentication Code (HMAC)", FIPS 889 PUB 198, July 2008. 891 [MANUAL-KEY] 892 Bhatia, M., Hartman, S., Zhang, D., and A. Lindem, 893 "Security Extension for OSPFv2 when using Manual Key 894 Management", Work in Progress, October 2011. 896 [RFC2104] Krawczyk, H., Bellare, M., and R. Canetti, "HMAC: Keyed- 897 Hashing for Message Authentication", RFC 2104, 898 February 1997. 900 [RFC4222] Choudhury, G., "Prioritized Treatment of Specific OSPF 901 Version 2 Packets and Congestion Avoidance", BCP 112, 902 RFC 4222, October 2005. 904 [RFC4302] Kent, S., "IP Authentication Header", RFC 4302, 905 December 2005. 907 [RFC4303] Kent, S., "IP Encapsulating Security Payload (ESP)", 908 RFC 4303, December 2005. 910 [RFC4552] Gupta, M. and N. Melam, "Authentication/Confidentiality 911 for OSPFv3", RFC 4552, June 2006. 913 [RFC4822] Atkinson, R. and M. Fanto, "RIPv2 Cryptographic 914 Authentication", RFC 4822, February 2007. 916 [RFC5310] Bhatia, M., Manral, V., Li, T., Atkinson, R., White, R., 917 and M. Fanto, "IS-IS Generic Cryptographic 918 Authentication", RFC 5310, February 2009. 920 [RFC5613] Zinin, A., Roy, A., Nguyen, L., Friedman, B., and D. 921 Yeung, "OSPF Link-Local Signaling", RFC 5613, August 2009. 923 [RFC5879] Kivinen, T. and D. McDonald, "Heuristics for Detecting 924 ESP-NULL Packets", RFC 5879, May 2010. 926 [RFC5996] Kaufman, C., Hoffman, P., Nir, Y., and P. Eronen, 927 "Internet Key Exchange Protocol Version 2 (IKEv2)", 928 RFC 5996, September 2010. 930 [RFC6039] Manral, V., Bhatia, M., Jaeggli, J., and R. White, "Issues 931 with Existing Cryptographic Protection Methods for Routing 932 Protocols", RFC 6039, October 2010. 934 [RFC6234] Eastlake, D. and T. Hansen, "US Secure Hash Algorithms 935 (SHA and SHA-based HMAC and HKDF)", RFC 6234, May 2011. 937 Appendix A. Acknowledgments 939 First and foremost, thanks to the US National Institute of Standards 940 and Technology for their work on the SHA [FIPS-180-3] and HMAC 941 [FIPS-198-1]. 943 Thanks also need to go to the authors of the HMAC-SHA authentication 944 RFCs including [RFC4822], [RFC5310], and [RFC5709]. The basic HMAC- 945 SHA procedures were originally described by Ran Atkinson and Tony Li 946 in [RFC4822]. 948 Also, thanks to Ran Atkinson for help in the analysis of RFC 6506 949 errata. 951 Thanks to Srinivasan K L and Marek Karasek for their identification 952 and submission of RFC 6506 errata. 954 Thanks to Sam Hartman for discussions on replay mitigation and the 955 use of a 64-bit strictly increasing sequence number. Also, thanks to 956 Sam for comments during IETF last call with respect to the OSPFv3 SA 957 and sharing of key between protocols. 959 Thanks to Michael Barnes for numerous comments and strong input on 960 the coverage of LLS by the Authentication Trailer (AT). 962 Thanks to Marek Karasek for providing the specifics with respect to 963 backward compatible transition mode. 965 Thanks to Michael Dubrovskiy and Anton Smirnov for comments on draft 966 revisions. 968 Thanks to Rajesh Shetty for numerous comments, including the 969 suggestion to include an Authentication Type field in the 970 Authentication Trailer for extendibility. 972 Thanks to Uma Chunduri for suggesting that we may want to protect the 973 IPv6 source address even though OSPFv3 uses the Router ID for 974 neighbor identification. 976 Thanks to Srinivasan KL, Shraddha H, Alan Davey, Russ White, Stan 977 Ratliff, and Glen Kent for their support and review comments. 979 Thanks to Alia Atlas for comments made under the purview of the 980 Routing Directorate review. 982 Thanks to Stephen Farrell for comments during the IESG review. 983 Stephen was also involved in the discussion of cross-protocol 984 attacks. 986 Thanks to Brian Carpenter for comments made during Gen-ART review. 988 Thanks to Victor Kuarsingh for the OPS-DIR review. 990 Thanks to Brian Weis for the SEC-DIR review. 992 Authors' Addresses 994 Manav Bhatia 995 Alcatel-Lucent 996 Bangalore 997 India 999 Email: manav.bhatia@alcatel-lucent.com 1001 Vishwas Manral 1002 Hewlett Packard 1003 USA 1005 Email: vishwas.manral@hp.com 1007 Acee Lindem 1008 Ericsson 1009 301 Midenhall Way 1010 Cary, NC 27513 1011 USA 1013 Email: acee.lindem@ericsson.com