idnits 2.17.1 draft-acee-ospf-rfc6506bis-03.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 seems to contain a disclaimer for pre-RFC5378 work, but was first submitted on or after 10 November 2008. The disclaimer is usually necessary only for documents that revise or obsolete older RFCs, and that take significant amounts of text from those RFCs. If you can contact all authors of the source material and they are willing to grant the BCP78 rights to the IETF Trust, you can and should remove the disclaimer. Otherwise, the disclaimer is needed and you can ignore this comment. (See the Legal Provisions document at https://trustee.ietf.org/license-info for more information.) -- The document date (June 23, 2013) is 3960 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 (~~), 2 warnings (==), 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: December 25, 2013 A. Lindem 7 Ericsson 8 June 23, 2013 10 Supporting Authentication Trailer for OSPFv3 11 draft-acee-ospf-rfc6506bis-03.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 December 25, 2013. 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 This document may contain material from IETF Documents or IETF 59 Contributions published or made publicly available before November 60 10, 2008. The person(s) controlling the copyright in some of this 61 material may not have granted the IETF Trust the right to allow 62 modifications of such material outside the IETF Standards Process. 63 Without obtaining an adequate license from the person(s) controlling 64 the copyright in such materials, this document may not be modified 65 outside the IETF Standards Process, and derivative works of it may 66 not be created outside the IETF Standards Process, except to format 67 it for publication as an RFC or to translate it into languages other 68 than English. 70 Table of Contents 72 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 4 73 1.1. Requirements . . . . . . . . . . . . . . . . . . . . . . . 5 74 1.2. Summary of Changes from RFC 6506 . . . . . . . . . . . . . 5 75 2. Proposed Solution . . . . . . . . . . . . . . . . . . . . . . 6 76 2.1. AT-Bit in Options Field . . . . . . . . . . . . . . . . . 6 77 2.2. Basic Operation . . . . . . . . . . . . . . . . . . . . . 7 78 2.3. IPv6 Source Address Protection . . . . . . . . . . . . . . 7 79 3. OSPFv3 Security Association . . . . . . . . . . . . . . . . . 9 80 4. Authentication Procedure . . . . . . . . . . . . . . . . . . . 12 81 4.1. Authentication Trailer . . . . . . . . . . . . . . . . . . 12 82 4.1.1. Sequence Number Wrap . . . . . . . . . . . . . . . . . 13 83 4.2. OSPFv3 Header Checksum and LLS Data Block Checksum . . . . 14 84 4.3. Cryptographic Authentication Procedure . . . . . . . . . . 14 85 4.4. Cross-Protocol Attack Mitigation . . . . . . . . . . . . . 15 86 4.5. Cryptographic Aspects . . . . . . . . . . . . . . . . . . 15 87 4.6. Message Verification . . . . . . . . . . . . . . . . . . . 17 88 5. Migration and Backward Compatibility . . . . . . . . . . . . . 20 89 6. Security Considerations . . . . . . . . . . . . . . . . . . . 21 90 7. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 22 91 8. References . . . . . . . . . . . . . . . . . . . . . . . . . . 23 92 8.1. Normative References . . . . . . . . . . . . . . . . . . . 23 93 8.2. Informative References . . . . . . . . . . . . . . . . . . 23 94 Appendix A. Acknowledgments . . . . . . . . . . . . . . . . . . . 25 95 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . . 26 97 1. Introduction 99 Unlike Open Shortest Path First version 2 (OSPFv2) [RFC2328], OSPF 100 for IPv6 (OSPFv3) [RFC5340] does not include the AuType and 101 Authentication fields in its headers for authenticating protocol 102 packets. Instead, OSPFv3 relies on the IPsec protocols 103 Authentication Header (AH) [RFC4302] and Encapsulating Security 104 Payload (ESP) [RFC4303] to provide integrity, authentication, and/or 105 confidentiality. 107 [RFC4552] describes how IPv6 AH and ESP extension headers can be used 108 to provide authentication and/or confidentiality to OSPFv3. 110 However, there are some environments, e.g., Mobile Ad Hoc Networks 111 (MANETs), where IPsec is difficult to configure and maintain, and 112 this mechanism cannot be used. 114 [RFC4552] discusses, at length, the reasoning behind using manually 115 configured keys, rather than some automated key management protocol 116 such as Internet Key Exchange version 2 (IKEv2) [RFC5996]. The 117 primary problem is the lack of a suitable key management mechanism, 118 as OSPFv3 adjacencies are formed on a one-to-many basis and most key 119 management mechanisms are designed for a one-to-one communication 120 model. This forces the system administrator to use manually 121 configured security associations (SAs) and cryptographic keys to 122 provide the authentication and, if desired, confidentiality services. 124 Regarding replay protection, [RFC4552] states that: 126 Since it is not possible using the current standards to provide 127 complete replay protection while using manual keying, the proposed 128 solution will not provide protection against replay attacks. 130 Since there is no replay protection provided there are a number of 131 vulnerabilities in OSPFv3 that have been discussed in [RFC6039]. 133 Since there is no deterministic way to differentiate between 134 encrypted and unencrypted ESP packets by simply examining the packet, 135 it could be difficult for some implementations to prioritize certain 136 OSPFv3 packet types, e.g., Hello packets, over the other types. 138 This document defines a new mechanism that works similarly to OSPFv2 139 [RFC5709] to provide authentication to the OSPFv3 packets and 140 attempts to solve the problems related to replay protection and 141 deterministically disambiguating different OSPFv3 packets as 142 described above. 144 This document adds support for the Secure Hash Algorithms (SHAs) 145 defined in the US NIST Secure Hash Standard (SHS), which is specified 146 by NIST FIPS 180-3. [FIPS-180-3] includes SHA-1, SHA-224, SHA-256, 147 SHA-384, and SHA-512. The Hashed Message Authentication Code (HMAC) 148 authentication mode defined in NIST FIPS 198-1 [FIPS-198-1] is used. 150 It is believed that HMAC as defined in [RFC2104] is mathematically 151 identical to [FIPS-198-1]; it is also believed that algorithms in 152 [RFC6234] are mathematically identical to [FIPS-198-1]. 154 1.1. Requirements 156 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 157 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 158 document are to be interpreted as described in RFC 2119 [RFC2119]. 160 1.2. Summary of Changes from RFC 6506 162 This document includes the following changes from RFC 6506 [RFC6506]: 164 1. Sections 2.2 and 4.2 explicitly state the Link-Local Signaling 165 (LLS) block checksum calculation is omitted when an OSPFv3 166 authentication is used. The LLS block is included in the 167 authentication digest calculation and computation of a checksum 168 is unnecessary. Clarification of this issue was raised in an 169 errata. 171 2. Section 4.5 includes a correction to the key preparation to use 172 the protocol specific key (Ks) rather than the key (K) as the 173 initial key (Ko). This problem was also raised in an errata. 175 3. Section 4.5 also includes a discussion of the choice of key 176 length to be the hash length (L) rather than the block size (B). 177 The discussion of this choice was included to clarify an issue 178 raised in a rejected errata. 180 4. Section 4.1 and 4.6 indicate that sequence number checking is 181 dependent on OSPFv3 packet type in order to account for packet 182 prioritization as specified in [RFC4222]. This was an omission 183 from RFC 6506. 185 5. 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, it is unacceptable to revert to an 382 unauthenticated condition and not advisable to disrupt routing. 383 Therefore, the router SHOULD send a "last Authentication Key 384 expiration" notification to the network operator and treat the key as 385 having an infinite lifetime until the lifetime is extended, the key 386 is deleted by the network operator, or a new key is configured. 388 4. Authentication Procedure 390 4.1. Authentication Trailer 392 The Authentication Trailer that is appended to the OSPFv3 protocol 393 packet is described below: 395 0 1 2 3 396 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 397 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 398 | Authentication Type | Auth Data Len | 399 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 400 | Reserved | Security Association ID | 401 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 402 | Cryptographic Sequence Number (High-Order 32 Bits) | 403 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 404 | Cryptographic Sequence Number (Low-Order 32 Bits) | 405 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 406 | | 407 | Authentication Data (Variable) | 408 ~ ~ 409 | | 410 | | 411 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 413 Figure 3: Authentication Trailer Format 415 The various fields in the Authentication Trailer are: 417 o Authentication Type 419 16-bit field identifying the type of authentication. The 420 following values are defined in this specification: 422 0 - Reserved. 423 1 - HMAC Cryptographic Authentication as described herein. 425 o Auth Data Len 427 The length in octets of the Authentication Trailer (AT) including 428 both the 16-octet fixed header and the variable length message 429 digest. 431 o Reserved 433 This field is reserved. It SHOULD be set to 0 when sending 434 protocol packets and MUST be ignored when receiving protocol 435 packets. 437 o Security Association Identifier (SA ID) 439 16-bit field that maps to the authentication algorithm and the 440 secret key used to create the message digest appended to the 441 OSPFv3 protocol packet. 443 Though the SA ID implicitly implies the algorithm, the HMAC output 444 size should not be used by implementers as an implicit hint 445 because additional algorithms may be defined in the future that 446 have the same output size. 448 o Cryptographic Sequence Number 450 64-bit strictly increasing sequence number that is used to guard 451 against replay attacks. The 64-bit sequence number MUST be 452 incremented for every OSPFv3 packet sent by the OSPFv3 router. 453 Upon reception, the sequence number MUST be greater than the 454 sequence number in the last accepted OSPFv3 packet of the same 455 packet type from the sending OSPFv3 neighbor. Otherwise, the 456 OSPFv3 packet is considered a replayed packet and dropped. OSPFv3 457 packets of different types may arrive out of order if they are 458 prioritized as recommended in [RFC4222]. 460 OSPFv3 routers implementing this specification MUST use available 461 mechanisms to preserve the sequence number's strictly increasing 462 property for the deployed life of the OSPFv3 router (including 463 cold restarts). One mechanism for accomplishing this would be to 464 use the high-order 32 bits of the sequence number as a wrap/boot 465 count that is incremented anytime the OSPFv3 router loses its 466 sequence number state. Sequence number wrap is described in 467 Section 4.1.1. 469 o Authentication Data 471 Variable data that is carrying the digest for the protocol packet 472 and optional LLS data block. 474 4.1.1. Sequence Number Wrap 476 When incrementing the sequence number for each transmitted OSPFv3 477 packet, the sequence number should be treated as an unsigned 64-bit 478 value. If the lower-order 32-bit value wraps, the higher-order 479 32-bit value should be incremented and saved in non-volatile storage. 480 If by some chance the OSPFv3 router is deployed long enough that 481 there is a possibility that the 64-bit sequence number may wrap, all 482 keys, independent of their key distribution mechanism, MUST be reset 483 to avoid the possibility of replay attacks. Once the keys have been 484 changed, the higher-order sequence number can be reset to 0 and saved 485 to non-volatile storage. 487 4.2. OSPFv3 Header Checksum and LLS Data Block Checksum 489 Both the checksum calculation and verification are omitted for the 490 OSPFv3 header checksum and the LLS Data Block checksum [RFC5613] when 491 the OSPFv3 authentication mechanism described in this specification 492 is used. This implies: 494 o For OSPFv3 packets to be transmitted, the OSPFv3 header checksum 495 computation is omitted, and the OSPFv3 header checksum SHOULD be 496 set to 0 prior to computation of the OSPFv3 Authentication Trailer 497 message digest. 499 o For OSPFv3 packets including an LLS Data Block to be transmitted, 500 the OSPFv3 LLS Data Block checksum computation is omitted, and the 501 OSPFv3 LLS Data Block checksum SHOULD be set to 0 prior to 502 computation of the OSPFv3 Authentication Trailer message digest. 504 o For received OSPFv3 packets including an OSPFv3 Authentication 505 Trailer, OSPFv3 header checksum verification MUST be omitted. 506 However, if the OSPFv3 packet does include a non-zero OSPFv3 507 header checksum, it will not be modified by the receiver and will 508 simply be included in the OSPFv3 Authentication Trailer message 509 digest verification. 511 o For received OSPFv3 packets including an LLS Data Block and OSPFv3 512 Authentication Trailer, LLS Data Block checksum verification MUST 513 be omitted. However, if the OSPFv3 packet does include an LLS 514 Block with a non-zero checksum, it will not be modified by the 515 receiver and will simply be included in the OSPFv3 Authentication 516 Trailer message digest verification. 518 4.3. Cryptographic Authentication Procedure 520 As noted earlier, the SA ID maps to the authentication algorithm and 521 the secret key used to generate and verify the message digest. This 522 specification discusses the computation of OSPFv3 Cryptographic 523 Authentication data when any of the NIST SHS family of algorithms is 524 used in the Hashed Message Authentication Code (HMAC) mode. 526 The currently valid algorithms (including mode) for OSPFv3 527 Cryptographic Authentication include: 529 o HMAC-SHA-1, 531 o HMAC-SHA-256, 532 o HMAC-SHA-384, and 534 o HMAC-SHA-512. 536 Of the above, implementations of this specification MUST include 537 support for at least HMAC-SHA-256 and SHOULD include support for 538 HMAC-SHA-1 and MAY also include support for HMAC-SHA-384 and 539 HMAC-SHA-512. 541 Implementations of this specification MUST use HMAC-SHA-256 as the 542 default authentication algorithm. 544 4.4. Cross-Protocol Attack Mitigation 546 In order to prevent cross-protocol replay attacks for protocols 547 sharing common keys, the two-octet OSPFv3 Cryptographic Protocol ID 548 is appended to the Authentication Key prior to use. Other protocols 549 using Cryptographic Authentication as specified herein MUST similarly 550 append their respective Cryptographic Protocol IDs to their keys in 551 this step. Refer to the IANA Considerations (Section 7). 553 4.5. Cryptographic Aspects 555 In the algorithm description below, the following nomenclature, which 556 is consistent with [FIPS-198-1], is used: 558 H is the specific hashing algorithm (e.g., SHA-256). 560 K is the Authentication Key from the OSPFv3 Security Association. 562 Ks is a Protocol-Specific Authentication Key obtained by appending 563 Authentication Key (K) with the two-octet OSPFv3 Cryptographic 564 Protocol ID. 566 Ko is the cryptographic key used with the hash algorithm. 568 B is the block size of H, measured in octets rather than bits. Note 569 that B is the internal block size, not the hash size. 571 For SHA-1 and SHA-256: B == 64 573 For SHA-384 and SHA-512: B == 128 575 L is the length of the hash, measured in octets rather than bits. 577 XOR is the exclusive-or operation. 579 Opad is the hexadecimal value 0x5c repeated B times. 581 Ipad is the hexadecimal value 0x36 repeated B times. 583 Apad is a value that is the same length as the hash output or message 584 digest. The first 16 octets contain the IPv6 source address followed 585 by the hexadecimal value 0x878FE1F3 repeated (L-16)/4 times. This 586 implies that hash output is always a length of at least 16 octets. 588 1. Preparation of the Key 590 The OSPFv3 Cryptographic Protocol ID is appended to the 591 Authentication Key (K) yielding a Protocol-Specific 592 Authentication Key (Ks). In this application, Ko is always L 593 octets long. While [RFC2104] supports a key that is up to B 594 octets long, this application uses L as the Ks length consistent 595 with [RFC4822], [RFC5310], and [RFC5709]. According to 596 [FIPS-198-1], Section 3, keys greater than L octets do not 597 significantly increase the function strength. Ks is computed as 598 follows: 600 If the Protocol-Specific Authentication Key (Ks) is L octets 601 long, then Ko is equal to Ks. If the Protocol-Specific 602 Authentication Key (Ks) is more than L octets long, then Ko is 603 set to H(Ks). If the Protocol-Specific Authentication Key 604 (Ks) is less than L octets long, then Ko is set to the 605 Protocol-Specific Authentication Key (Ks) with zeros appended 606 to the end of the Protocol-Specific Authentication Key (Ks) 607 such that Ko is L octets long. 609 2. First-Hash 611 First, the OSPFv3 packet's Authentication Data field in the 612 Authentication Trailer is filled with the value Apad. This is 613 very similar to the appendage described in [RFC2328], Section 614 D.4.3, Items (6)(a) and (6)(d)). 616 Then, a First-Hash, also known as the inner hash, is computed as 617 follows: 619 First-Hash = H(Ko XOR Ipad || (OSPFv3 Packet)) 621 When XORing Ko and Ipad, Ko will be padded with zeros to the 622 length of Ipad. 624 Implementation Note: The First-Hash above includes the 625 Authentication Trailer, as well as the OSPFv3 packet, as per 626 [RFC2328], Section D.4.3, and, if present, the LLS data block 627 [RFC5613]. 629 The definition of Apad (above) ensures it is always the same 630 length as the hash output. This is consistent with RFC 2328. 631 Note that the "(OSPFv3 Packet)" referenced in the First-Hash 632 function above includes both the optional LLS data block and the 633 OSPFv3 Authentication Trailer. 635 The digest length for SHA-1 is 20 octets; for SHA-256, 32 octets; 636 for SHA-384, 48 octets; and for SHA-512, 64 octets. 638 3. Second-Hash 640 Then a Second-Hash, also known as the outer hash, is computed as 641 follows: 643 Second-Hash = H(Ko XOR Opad || First-Hash) 645 When XORing Ko and Opad, Ko will be padded with zeros to the 646 length of Ipad. 648 4. Result 650 The resulting Second-Hash becomes the authentication data that is 651 sent in the Authentication Trailer of the OSPFv3 packet. The 652 length of the authentication data is always identical to the 653 message digest size of the specific hash function H that is being 654 used. 656 This also means that the use of hash functions with larger output 657 sizes will also increase the size of the OSPFv3 packet as 658 transmitted on the wire. 660 Implementation Note: [RFC2328], Appendix D specifies that the 661 Authentication Trailer is not counted in the OSPF packet's own 662 Length field but is included in the packet's IP Length field. 663 Similar to this, the Authentication Trailer is not included in 664 the OSPFv3 header length but is included in the IPv6 header 665 payload length. 667 4.6. Message Verification 669 A router would determine that OSPFv3 is using an Authentication 670 trailer by examining the AT-bit in the Options field in the OSPFv3 671 header for Hello and Database Description packets. The specification 672 in the Hello and Database Description options indicates that other 673 OSPFv3 packets will include the Authentication Trailer. 675 The Authentication Trailer (AT) is accessed using the OSPFv3 packet 676 header length to access the data after the OSPFv3 packet and, if an 677 LLS data block [RFC5613] is present, using the LLS data block length 678 to access the data after the LLS data block. The L-bit in the OSPFv3 679 options in Hello and Database Description packets is examined to 680 determine if an LLS data block is present. If an LLS data block is 681 present (as specified by the L-bit), it is included along with the 682 OSPFv3 Hello or Database Description packet in the cryptographic 683 authentication computation. 685 Due to the placement of the AT following the LLS data block and the 686 fact that the LLS data block is included in the Cryptographic 687 Authentication computation, OSPFv3 routers supporting this 688 specification MUST minimally support examining the L-bit in the 689 OSPFv3 options and using the length in the LLS data block to access 690 the AT. It is RECOMMENDED that OSPFv3 routers supporting this 691 specification fully support OSPFv3 Link-Local Signaling [RFC5613]. 693 If usage of the Authentication Trailer (AT), as specified herein, is 694 configured for an OSPFv3 link, OSPFv3 Hello and Database Description 695 packets with the AT-bit clear in the options will be dropped. All 696 OSPFv3 packet types will be dropped if AT is configured for the link 697 and the IPv6 header length is less than the amount necessary to 698 include an Authentication Trailer. 700 If the cryptographic sequence number in the AT is less than or equal 701 to the last sequence number in the last OSPFv3 packet of the same 702 type successfully received from the neighbor, the OSPFv3 packet MUST 703 be dropped, and an error event SHOULD be logged. OSPFv3 packets of 704 different types may arrive out of order if they are prioritized as 705 recommended in [RFC4222]. 707 Authentication-algorithm-dependent processing needs to be performed, 708 using the algorithm specified by the appropriate OSPFv3 SA for the 709 received packet. 711 Before an implementation performs any processing, it needs to save 712 the values of the Authentication Data field from the Authentication 713 Trailer appended to the OSPFv3 packet. 715 It should then set the Authentication Data field with Apad before the 716 authentication data is computed (as described in Section 4.5). The 717 calculated data is compared with the received authentication data in 718 the Authentication Trailer. If the two do not match, the packet MUST 719 be discarded and an error event SHOULD be logged. 721 After the OSPFv3 packet has been successfully authenticated, 722 implementations MUST store the 64-bit cryptographic sequence number 723 for each packet type received from the neighbor. The saved 724 cryptographic sequence numbers will be used for replay checking for 725 subsequent packets received from the neighbor. 727 5. Migration and Backward Compatibility 729 All OSPFv3 routers participating on a link SHOULD be migrated to 730 OSPFv3 Authentication at the same time. As with OSPFv2 731 authentication, a mismatch in the SA ID, Authentication Type, or 732 message digest will result in failure to form an adjacency. For 733 multi-access links, communities of OSPFv3 routers could be migrated 734 using different Interface Instance IDs. However, at least one router 735 would need to form adjacencies between both the OSPFv3 routers 736 including and not including the Authentication Trailer. This would 737 result in sub-optimal routing as well as added complexity and is only 738 recommended in cases where authentication is desired on the link and 739 migrating all the routers on the link at the same time isn't 740 feasible. 742 In support of uninterrupted deployment, an OSPFv3 router implementing 743 this specification MAY implement a transition mode where it includes 744 the Authentication Trailer in transmitted packets but does not verify 745 this information in received packets. This is provided as a 746 transition aid for networks in the process of migrating to the 747 authentication mechanism described in this specification. More 748 specifically: 750 1. OSPFv3 routers in transition mode will include the OSPFv3 751 authentication trailer in transmitted packets and set the AT-Bit 752 in the options field of transmitted Hello and Database 753 Description packets. OSPFv3 routers receiving these packets and 754 not having authentication configured will ignore the 755 authentication trailer and AT-bit. 757 2. OSPFv3 routers in transition mode will also calculate and set the 758 OSPFv3 header checksum and the LLS block checksum in transmitted 759 packets so that they will not be dropped by OSPFv3 routers 760 without authentication configured. 762 3. OSPFv3 routers in transition mode will authenticate received 763 packets that have the AT-Bit set in the options field of Hello 764 and Database Description packets or are from a neighbor that 765 previously set the AT-Bit in the options field in Hello and 766 Database Description packets. 768 4. OSPFv3 routers in transition mode will also accept packets 769 without the options field AT-Bit set in Hello and Database 770 Description packets. These packets will be assumed to be from 771 OSPFv3 routers without authentication configured and they will 772 not be authenticated. Additionally, the OSPFv3 header checksum 773 and LLS block checksum will be validated. 775 6. Security Considerations 777 The document proposes extensions to OSPFv3 that would make it more 778 secure than [RFC5340]. It does not provide confidentiality as a 779 routing protocol contains information that does not need to be kept 780 secret. It does, however, provide means to authenticate the sender 781 of the packets that are of interest. It addresses all the security 782 issues that have been identified in [RFC6039]. 784 It should be noted that the authentication method described in this 785 document is not being used to authenticate the specific originator of 786 a packet but is rather being used to confirm that the packet has 787 indeed been issued by a router that has access to the Authentication 788 Key. 790 Deployments SHOULD use sufficiently long and random values for the 791 Authentication Key so that guessing and other cryptographic attacks 792 on the key are not feasible in their environments. Furthermore, it 793 is RECOMMENDED that Authentication Keys incorporate at least 128 794 pseudo-random bits to minimize the risk of such attacks. In support 795 of these recommendations, management systems SHOULD support 796 hexadecimal input of Authentication Keys. 798 The mechanism described herein is not perfect and does not need to be 799 perfect. Instead, this mechanism represents a significant increase 800 in the effort required for an adversary to successfully attack the 801 OSPFv3 protocol while not causing undue implementation, deployment, 802 or operational complexity. 804 Refer to [RFC4552] for additional considerations on manual keying. 806 7. IANA Considerations 808 IANA has allocated the AT-bit (0x000400) in the "OSPFv3 Options (24 809 bits)" registry as described in Section 2.1. 811 IANA has created the "OSPFv3 Authentication Trailer Options" 812 registry. This new registry initially includes the "OSPFv3 813 Authentication Types" registry, which defines valid values for the 814 Authentication Type field in the OSPFv3 Authentication Trailer. The 815 registration procedure is Standards Action. 817 +-------------+-----------------------------------+ 818 | Value/Range | Designation | 819 +-------------+-----------------------------------+ 820 | 0 | Reserved | 821 | | | 822 | 1 | HMAC Cryptographic Authentication | 823 | | | 824 | 2-65535 | Unassigned | 825 +-------------+-----------------------------------+ 827 OSPFv3 Authentication Types 829 Finally, IANA has created the "Keying and Authentication for Routing 830 Protocols (KARP) Parameters" category. This new category initially 831 includes the "Authentication Cryptographic Protocol ID" registry, 832 which provides unique protocol-specific values for cryptographic 833 applications, such as but not limited to, prevention of cross- 834 protocol replay attacks. Values can be assigned for both native 835 IPv4/IPv6 protocols and UDP/TCP protocols. The registration 836 procedure is Standards Action. 838 +-------------+----------------------+ 839 | Value/Range | Designation | 840 +-------------+----------------------+ 841 | 0 | Reserved | 842 | | | 843 | 1 | OSPFv3 | 844 | | | 845 | 2-65535 | Unassigned | 846 +-------------+----------------------+ 848 Cryptographic Protocol ID 850 8. References 852 8.1. Normative References 854 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 855 Requirement Levels", BCP 14, RFC 2119, March 1997. 857 [RFC2328] Moy, J., "OSPF Version 2", STD 54, RFC 2328, April 1998. 859 [RFC5340] Coltun, R., Ferguson, D., Moy, J., and A. Lindem, "OSPF 860 for IPv6", RFC 5340, July 2008. 862 [RFC5709] Bhatia, M., Manral, V., Fanto, M., White, R., Barnes, M., 863 Li, T., and R. Atkinson, "OSPFv2 HMAC-SHA Cryptographic 864 Authentication", RFC 5709, October 2009. 866 [RFC6506] Bhatia, M., Manral, V., and A. Lindem, "Supporting 867 Authentication Trailer for OSPFv3", RFC 6506, 868 February 2012. 870 8.2. Informative References 872 [FIPS-180-3] 873 US National Institute of Standards and Technology, "Secure 874 Hash Standard (SHS)", FIPS PUB 180-3, October 2008. 876 [FIPS-198-1] 877 US National Institute of Standards and Technology, "The 878 Keyed-Hash Message Authentication Code (HMAC)", FIPS 879 PUB 198, July 2008. 881 [MANUAL-KEY] 882 Bhatia, M., Hartman, S., Zhang, D., and A. Lindem, 883 "Security Extension for OSPFv2 when using Manual Key 884 Management", Work in Progress, October 2011. 886 [RFC2104] Krawczyk, H., Bellare, M., and R. Canetti, "HMAC: Keyed- 887 Hashing for Message Authentication", RFC 2104, 888 February 1997. 890 [RFC4222] Choudhury, G., "Prioritized Treatment of Specific OSPF 891 Version 2 Packets and Congestion Avoidance", BCP 112, 892 RFC 4222, October 2005. 894 [RFC4302] Kent, S., "IP Authentication Header", RFC 4302, 895 December 2005. 897 [RFC4303] Kent, S., "IP Encapsulating Security Payload (ESP)", 898 RFC 4303, December 2005. 900 [RFC4552] Gupta, M. and N. Melam, "Authentication/Confidentiality 901 for OSPFv3", RFC 4552, June 2006. 903 [RFC4822] Atkinson, R. and M. Fanto, "RIPv2 Cryptographic 904 Authentication", RFC 4822, February 2007. 906 [RFC5310] Bhatia, M., Manral, V., Li, T., Atkinson, R., White, R., 907 and M. Fanto, "IS-IS Generic Cryptographic 908 Authentication", RFC 5310, February 2009. 910 [RFC5613] Zinin, A., Roy, A., Nguyen, L., Friedman, B., and D. 911 Yeung, "OSPF Link-Local Signaling", RFC 5613, August 2009. 913 [RFC5996] Kaufman, C., Hoffman, P., Nir, Y., and P. Eronen, 914 "Internet Key Exchange Protocol Version 2 (IKEv2)", 915 RFC 5996, September 2010. 917 [RFC6039] Manral, V., Bhatia, M., Jaeggli, J., and R. White, "Issues 918 with Existing Cryptographic Protection Methods for Routing 919 Protocols", RFC 6039, October 2010. 921 [RFC6234] Eastlake, D. and T. Hansen, "US Secure Hash Algorithms 922 (SHA and SHA-based HMAC and HKDF)", RFC 6234, May 2011. 924 Appendix A. Acknowledgments 926 First and foremost, thanks to the US National Institute of Standards 927 and Technology for their work on the SHA [FIPS-180-3] and HMAC 928 [FIPS-198-1]. 930 Thanks also need to go to the authors of the HMAC-SHA authentication 931 RFCs including [RFC4822], [RFC5310], and [RFC5709]. The basic HMAC- 932 SHA procedures were originally described by Ran Atkinson and Tony Li 933 in [RFC4822]. 935 Also, thanks to Ran Atkinson for help in the analysis of RFC 6506 936 errata. 938 Thanks to Srinivasan K L and Marek Karasek for their identification 939 and submission of RFC 6506 errata. 941 Thanks to Sam Hartman for discussions on replay mitigation and the 942 use of a 64-bit strictly increasing sequence number. Also, thanks to 943 Sam for comments during IETF last call with respect to the OSPFv3 SA 944 and sharing of key between protocols. 946 Thanks to Michael Barnes for numerous comments and strong input on 947 the coverage of LLS by the Authentication Trailer (AT). 949 Thanks to Marek Karasek for providing the specifics with respect to 950 backward compatible transition mode. 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 Authors' Addresses 972 Manav Bhatia 973 Alcatel-Lucent 974 Bangalore 975 India 977 Email: manav.bhatia@alcatel-lucent.com 979 Vishwas Manral 980 Hewlett Packard 981 USA 983 Email: vishwas.manral@hp.com 985 Acee Lindem 986 Ericsson 987 102 Carric Bend Court 988 Cary, NC 27519 989 USA 991 Email: acee.lindem@ericsson.com