idnits 2.17.1 draft-ietf-ntp-network-time-security-11.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 : ---------------------------------------------------------------------------- ** The abstract seems to contain references ([RFC7384]), which it shouldn't. Please replace those with straight textual mentions of the documents in question. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year -- The document date (October 19, 2015) is 3110 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) ** Downref: Normative reference to an Informational RFC: RFC 2104 ** Downref: Normative reference to an Informational RFC: RFC 4082 ** Downref: Normative reference to an Informational RFC: RFC 7384 == Outdated reference: A later version (-06) exists of draft-ietf-ntp-cms-for-nts-message-04 == Outdated reference: A later version (-07) exists of draft-ietf-tictoc-multi-path-synchronization-02 Summary: 4 errors (**), 0 flaws (~~), 3 warnings (==), 1 comment (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 NTP Working Group D. Sibold 3 Internet-Draft PTB 4 Intended status: Standards Track S. Roettger 5 Expires: April 21, 2016 Google Inc. 6 K. Teichel 7 PTB 8 October 19, 2015 10 Network Time Security 11 draft-ietf-ntp-network-time-security-11 13 Abstract 15 This document describes Network Time Security (NTS), a collection of 16 measures that enable secure time synchronization with time servers 17 using protocols like the Network Time Protocol (NTP) or the Precision 18 Time Protocol (PTP). Its design considers the special requirements 19 of precise timekeeping which are described in Security Requirements 20 of Time Protocols in Packet Switched Networks [RFC7384]. 22 Requirements Language 24 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 25 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 26 document are to be interpreted as described in RFC 2119 [RFC2119]. 28 Status of This Memo 30 This Internet-Draft is submitted in full conformance with the 31 provisions of BCP 78 and BCP 79. 33 Internet-Drafts are working documents of the Internet Engineering 34 Task Force (IETF). Note that other groups may also distribute 35 working documents as Internet-Drafts. The list of current Internet- 36 Drafts is at http://datatracker.ietf.org/drafts/current/. 38 Internet-Drafts are draft documents valid for a maximum of six months 39 and may be updated, replaced, or obsoleted by other documents at any 40 time. It is inappropriate to use Internet-Drafts as reference 41 material or to cite them other than as "work in progress." 43 This Internet-Draft will expire on April 21, 2016. 45 Copyright Notice 47 Copyright (c) 2015 IETF Trust and the persons identified as the 48 document authors. All rights reserved. 50 This document is subject to BCP 78 and the IETF Trust's Legal 51 Provisions Relating to IETF Documents 52 (http://trustee.ietf.org/license-info) in effect on the date of 53 publication of this document. Please review these documents 54 carefully, as they describe your rights and restrictions with respect 55 to this document. Code Components extracted from this document must 56 include Simplified BSD License text as described in Section 4.e of 57 the Trust Legal Provisions and are provided without warranty as 58 described in the Simplified BSD License. 60 Table of Contents 62 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3 63 2. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 4 64 2.1. Terms and Abbreviations . . . . . . . . . . . . . . . . . 4 65 2.2. Common Terminology for PTP and NTP . . . . . . . . . . . 4 66 3. Security Threats . . . . . . . . . . . . . . . . . . . . . . 5 67 4. Objectives . . . . . . . . . . . . . . . . . . . . . . . . . 5 68 5. NTS Overview . . . . . . . . . . . . . . . . . . . . . . . . 6 69 6. Protocol Messages . . . . . . . . . . . . . . . . . . . . . . 7 70 6.1. Unicast Time Synchronisation Messages . . . . . . . . . . 7 71 6.1.1. Preconditions for the Unicast Time Synchronization 72 Exchange . . . . . . . . . . . . . . . . . . . . . . 7 73 6.1.2. Goals of the Unicast Time Synchronization Exchange . 8 74 6.1.3. Message Type: "time_request" . . . . . . . . . . . . 8 75 6.1.4. Message Type: "time_response" . . . . . . . . . . . . 8 76 6.1.5. Procedure Overview of the Unicast Time 77 Synchronization Exchange . . . . . . . . . . . . . . 9 78 6.2. Broadcast Time Synchronization Exchange . . . . . . . . . 10 79 6.2.1. Preconditions for the Broadcast Time Synchronization 80 Exchange . . . . . . . . . . . . . . . . . . . . . . 10 81 6.2.2. Goals of the Broadcast Time Synchronization Exchange 11 82 6.2.3. Message Type: "server_broad" . . . . . . . . . . . . 11 83 6.2.4. Procedure Overview of Broadcast Time Synchronization 84 Exchange . . . . . . . . . . . . . . . . . . . . . . 11 85 6.3. Broadcast Keycheck . . . . . . . . . . . . . . . . . . . 13 86 6.3.1. Preconditions for the Broadcast Keycheck Exchange . . 13 87 6.3.2. Goals of the Broadcast Keycheck Exchange . . . . . . 13 88 6.3.3. Message Type: "client_keycheck" . . . . . . . . . . . 14 89 6.3.4. Message Type: "server_keycheck" . . . . . . . . . . . 14 90 6.3.5. Procedure Overview of the Broadcast Keycheck Exchange 14 91 7. Server Seed Considerations . . . . . . . . . . . . . . . . . 16 92 8. Hash Algorithms and MAC Generation . . . . . . . . . . . . . 16 93 8.1. Hash Algorithms . . . . . . . . . . . . . . . . . . . . . 16 94 8.2. MAC Calculation . . . . . . . . . . . . . . . . . . . . . 16 95 9. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 16 96 10. Security Considerations . . . . . . . . . . . . . . . . . . . 17 97 10.1. Privacy . . . . . . . . . . . . . . . . . . . . . . . . 17 98 10.2. Initial Verification of the Server Certificates . . . . 17 99 10.3. Revocation of Server Certificates . . . . . . . . . . . 17 100 10.4. Mitigating Denial-of-Service for broadcast packets . . . 17 101 10.5. Delay Attack . . . . . . . . . . . . . . . . . . . . . . 18 102 10.6. Random Number Generation . . . . . . . . . . . . . . . . 19 103 11. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 19 104 12. References . . . . . . . . . . . . . . . . . . . . . . . . . 19 105 12.1. Normative References . . . . . . . . . . . . . . . . . . 20 106 12.2. Informative References . . . . . . . . . . . . . . . . . 20 107 Appendix A. (informative) TICTOC Security Requirements . . . . . 21 108 Appendix B. (normative) Inherent Association Protocol Messages . 23 109 B.1. Overview of NTS with Inherent Association Protocol . . . 23 110 B.2. Access Message Exchange . . . . . . . . . . . . . . . . . 23 111 B.2.1. Goals of the Access Message Exchange . . . . . . . . 23 112 B.2.2. Message Type: "client_access" . . . . . . . . . . . . 24 113 B.2.3. Message Type: "server_access" . . . . . . . . . . . . 24 114 B.2.4. Procedure Overview of the Access Exchange . . . . . . 24 115 B.3. Association Message Exchange . . . . . . . . . . . . . . 24 116 B.3.1. Goals of the Association Exchange . . . . . . . . . . 25 117 B.3.2. Message Type: "client_assoc" . . . . . . . . . . . . 25 118 B.3.3. Message Type: "server_assoc" . . . . . . . . . . . . 25 119 B.3.4. Procedure Overview of the Association Exchange . . . 26 120 B.4. Cookie Message Exchange . . . . . . . . . . . . . . . . . 27 121 B.4.1. Goals of the Cookie Exchange . . . . . . . . . . . . 27 122 B.4.2. Message Type: "client_cook" . . . . . . . . . . . . . 28 123 B.4.3. Message Type: "server_cook" . . . . . . . . . . . . . 28 124 B.4.4. Procedure Overview of the Cookie Exchange . . . . . . 29 125 B.4.5. Broadcast Parameter Messages . . . . . . . . . . . . 30 126 Appendix C. (normative) Using TESLA for Broadcast-Type Messages 32 127 C.1. Server Preparation . . . . . . . . . . . . . . . . . . . 32 128 C.2. Client Preparation . . . . . . . . . . . . . . . . . . . 34 129 C.3. Sending Authenticated Broadcast Packets . . . . . . . . . 35 130 C.4. Authentication of Received Packets . . . . . . . . . . . 35 131 Appendix D. (informative) Dependencies . . . . . . . . . . . . . 37 132 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 39 134 1. Introduction 136 Time synchronization protocols are increasingly utilized to 137 synchronize clocks in networked infrastructures. Successful attacks 138 against the time synchronization protocol can seriously degrade the 139 reliable performance of such infrastructures. Therefore, time 140 synchronization protocols have to be secured if they are applied in 141 environments that are prone to malicious attacks. This can be 142 accomplished either by utilization of external security protocols, 143 like IPsec or TLS, or by intrinsic security measures of the time 144 synchronization protocol. 146 The two most popular time synchronization protocols, the Network Time 147 Protocol (NTP) [RFC5905] and the Precision Time Protocol (PTP) 148 [IEEE1588], currently do not provide adequate intrinsic security 149 precautions. This document specifies security measures which enable 150 these and possibly other protocols to verify the authenticity of the 151 time server/master and the integrity of the time synchronization 152 protocol packets. The utilization of these measures for a given 153 specific time synchronization protocol has to be described in a 154 separate document. 156 [RFC7384] specifies that a security mechanism for timekeeping must be 157 designed in such a way that it does not degrade the quality of the 158 time transfer. This implies that for time keeping the increase in 159 bandwidth and message latency caused by the security measures should 160 be small. Also, NTP as well as PTP work via UDP and connections are 161 stateless on the server/master side. Therefore, all security 162 measures in this document are designed in such a way that they add 163 little demand for bandwidth, that the necessary calculations can be 164 executed in a fast manner, and that the measures do not require a 165 server/master to keep state of a connection. 167 2. Terminology 169 2.1. Terms and Abbreviations 171 MITM Man In The Middle 173 NTS Network Time Security 175 TESLA Timed Efficient Stream Loss-tolerant Authentication 177 MAC Message Authentication Code 179 HMAC Keyed-Hash Message Authentication Code 181 2.2. Common Terminology for PTP and NTP 183 This document refers to different time synchronization protocols, in 184 particular to both the PTP and the NTP. Throughout the document the 185 term "server" applies to both a PTP master and an NTP server. 186 Accordingly, the term "client" applies to both a PTP slave and an NTP 187 client. 189 3. Security Threats 191 The document "Security Requirements of Time Protocols in Packet 192 Switched Networks" [RFC7384] contains a profound analysis of security 193 threats and requirements for time synchronization protocols. 195 4. Objectives 197 The objectives of the NTS specification are as follows: 199 o Authenticity: NTS enables the client to authenticate its time 200 server(s). 202 o Integrity: NTS protects the integrity of time synchronization 203 protocol packets via a message authentication code (MAC). 205 o Confidentiality: NTS does not provide confidentiality protection 206 of the time synchronization packets. 208 o Authorization: NTS enables the client to verify its time server's 209 authorization. NTS optionally enables the server to verify the 210 client's authorization as well. 212 o Request-Response-Consistency: NTS enables a client to match an 213 incoming response to a request it has sent. NTS also enables the 214 client to deduce from the response whether its request to the 215 server has arrived without alteration. 217 o Applicability to Protocols: NTS can be used to secure different 218 time synchronization protocols, specifically at least NTP and PTP. 220 o Integration with Protocols: A client or server running an NTS- 221 secured version of a time protocol does not negatively affect 222 other participants who are running unsecured versions of that 223 protocol. 225 o Server-Side Statelessness: All security measures of NTS work 226 without creating the necessity for a server to keep state of a 227 connection. 229 o Prevention of Amplification Attacks: All communication introduced 230 by NTS offers protection against abuse for amplification denial- 231 of-service attacks. 233 5. NTS Overview 235 NTS initially verifies the authenticity of the time server and 236 exchanges a symmetric key, the so-called cookie, as well as a key 237 input value (KIV). The KIV can be opaque for the client. After the 238 cookie and the KIV are exchanged, the client then uses them to 239 protect the authenticity and the integrity of subsequent unicast-type 240 time synchronization packets. In order to do this, a Message 241 Authentication Code (MAC) is attached to each time synchronization 242 packet. The calculation of the MAC includes the whole time 243 synchronization packet and the cookie which is shared between client 244 and server. 246 The cookie is calculated according to: 248 cookie = MSB_ (HMAC(server seed, KIV)), 250 with the server seed as the key, where KIV is the client's key input 251 value, and where the application of the function MSB_ returns only 252 the b most significant bits. The server seed is a random value of 253 bit length b that the server possesses, which has to remain secret. 254 The cookie deterministically depends on KIV as long as the server 255 seed stays the same. The server seed has to be refreshed 256 periodically in order to provide key freshness as required in 257 [RFC7384]. See Section 7 for details on seed refreshing. 259 Since the server does not keep a state of the client, it has to 260 recalculate the cookie each time it receives a unicast time 261 synchronization request from the client. To this end, the client has 262 to attach its KIV to each request (see Section 6.1). 264 For broadcast-type messages, authenticity and integrity of the time 265 synchronization packets are also ensured by a MAC, which is attached 266 to the time synchronization packet by the sender. Verification of 267 the broadcast-type packets' authenticity is based on the TESLA 268 protocol, in particular on its "not re-using keys" scheme, see 269 Section 3.7.2 of [RFC4082]. TESLA uses a one-way chain of keys, 270 where each key is the output of a one-way function applied to the 271 previous key in the chain. The server securely shares the last 272 element of the chain with all clients. The server splits time into 273 intervals of uniform duration and assigns each key to an interval in 274 reverse order. At each time interval, the server sends a broadcast 275 packet appended by a MAC, calculated using the corresponding key, and 276 the key of the previous disclosure interval. The client verifies the 277 MAC by buffering the packet until disclosure of the key in its 278 associated disclosure interval occurs. In order to be able to verify 279 the timeliness of the packets, the client has to be loosely time 280 synchronized with the server. This has to be accomplished before 281 broadcast associations can be used. For checking timeliness of 282 packets, NTS uses another, more rigorous check in addition to just 283 the clock lookup used in the TESLA protocol. For a more detailed 284 description of how NTS employs and customizes TESLA, see Appendix C. 286 6. Protocol Messages 288 This section describes the types of messages needed for secure time 289 synchronization with NTS. 291 For some guidance on how these message types can be realized in 292 practice, and integrated into the communication flow of existing time 293 synchronization protocols, see [I-D.ietf-ntp-cms-for-nts-message], a 294 companion document for NTS. Said document describes ASN.1 encodings 295 for those message parts that have to be added to a time 296 synchronization protocol for security reasons. 298 6.1. Unicast Time Synchronisation Messages 300 In this message exchange, the usual time synchronization process is 301 executed, with the addition of integrity protection for all messages 302 that the server sends. This message exchange can be repeatedly 303 performed as often as the client desires and as long as the integrity 304 of the server's time responses is verified successfully. 306 6.1.1. Preconditions for the Unicast Time Synchronization Exchange 308 Before this message exchange is available, there are some 309 requirements that the client and server need to meet: 311 o They MUST negotiate the hash algorithm for the MAC used in the 312 time synchronization messages. Authenticity and integrity of the 313 communication MUST be ensured. 315 o The client MUST know a key input value KIV. Authenticity and 316 integrity of the communication MUST be ensured. 318 o Client and server MUST exchange the cookie (which depends on the 319 KIV as described in section Section 5). Authenticity, 320 confidentiality and integrity of the communication MUST be 321 ensured. 323 One way of realising these requirements is to use the Association and 324 Cookie Message Exchanges described in Appendix B. 326 6.1.2. Goals of the Unicast Time Synchronization Exchange 328 The unicast time synchronization exchange: 330 o exchanges (unicast) time synchronization data as specified by the 331 appropriate time synchronization protocol, 333 o guarantees authenticity and integrity of the response to the 334 client, 336 o guarantees request-response-consistency to the client. 338 6.1.3. Message Type: "time_request" 340 This message is sent by the client when it requests a time exchange. 341 It contains 343 o the NTS message ID "time_request", 345 o the negotiated version number, 347 o a nonce, 349 o the negotiated hash algorithm H, 351 o the client's key input value (for which the client knows the 352 associated cookie). 354 6.1.4. Message Type: "time_response" 356 This message is sent by the server after it has received a 357 time_request message. Prior to this the server MUST recalculate the 358 client's cookie by using the received key input value and the 359 transmitted hash algorithm. The message contains 361 o the NTS message ID "time_response", 363 o the version number as transmitted in time_request, 365 o the server's time synchronization response data, 367 o the nonce transmitted in time_request, 369 o a MAC (generated with the cookie as key) for verification of all 370 of the above data. 372 6.1.5. Procedure Overview of the Unicast Time Synchronization Exchange 374 For a unicast time synchronization exchange, the following steps are 375 performed: 377 1. The client sends a time_request message to the server. The 378 client MUST save the included nonce and the transmit_timestamp 379 (from the time synchronization data) as a correlated pair for 380 later verification steps. 382 2. Upon receipt of a time_request message, the server re-calculates 383 the cookie, then computes the necessary time synchronization data 384 and constructs a time_response message as given in Section 6.1.4. 386 3. The client awaits a reply in the form of a time_response message. 387 Upon receipt, it checks: 389 * that the transmitted version number matches the one negotiated 390 previously, 392 * that the transmitted nonce belongs to a previous time_request 393 message, 395 * that the transmit_timestamp in that time_request message 396 matches the corresponding time stamp from the synchronization 397 data received in the time_response, and 399 * that the appended MAC verifies the received synchronization 400 data, version number and nonce. 402 If at least one of the first three checks fails (i.e. if the 403 version number does not match, if the client has never used the 404 nonce transmitted in the time_response message, or if it has used 405 the nonce with initial time synchronization data different from 406 that in the response), then the client MUST ignore this 407 time_response message. If the MAC is invalid, the client MUST do 408 one of the following: abort the run or send another cookie 409 request (because the cookie might have changed due to a server 410 seed refresh). If both checks are successful, the client SHOULD 411 continue time synchronization. 413 +-----------------------+ 414 | o Re-generate cookie | 415 | o Assemble response | 416 | o Generate MAC | 417 +-----------+-----------+ 418 | 419 <-+-> 421 Server -----------------------------------------------> 422 /| \ 423 time_ / \ time_ 424 request / \ response 425 / \| 426 Client -----------------------------------------------> 428 <------ Unicast time ------> <- Client-side -> 429 synchronization validity 430 exchange checks 432 Procedure for unicast time synchronization exchange. 434 6.2. Broadcast Time Synchronization Exchange 436 6.2.1. Preconditions for the Broadcast Time Synchronization Exchange 438 Before this message exchange is available, there are some 439 requirements that the client and server need to meet: 441 o The client MUST receive all the information necessary to process 442 broadcast time synchronization messages from the server. This 443 includes 445 * the one-way functions used for building the key chain, 447 * the last key of the key chain, 449 * time interval duration, 451 * the disclosure delay (number of intervals between use and 452 disclosure of a key), 454 * the time at which the next time interval will start, and 456 * the next interval's associated index. 458 o The communication of the data listed above MUST guarantee 459 authenticity of the server, as well as integrity and freshness of 460 the broadcast parameters to the client. 462 6.2.2. Goals of the Broadcast Time Synchronization Exchange 464 The broadcast time synchronization exchange: 466 o transmits (broadcast) time synchronization data from the server to 467 the client as specified by the appropriate time synchronization 468 protocol, 470 o guarantees to the client that the received synchronization data 471 has arrived in a timely manner as required by the TESLA protocol 472 and is trustworthy enough to be stored for later checks, 474 o additionally guarantees authenticity of a certain broadcast 475 synchronization message in the client's storage. 477 6.2.3. Message Type: "server_broad" 479 This message is sent by the server over the course of its broadcast 480 schedule. It is part of any broadcast association. It contains 482 o the NTS message ID "server_broad", 484 o the version number that the server is working under, 486 o time broadcast data, 488 o the index that belongs to the current interval (and therefore 489 identifies the current, yet undisclosed, key), 491 o the disclosed key of the previous disclosure interval (current 492 time interval minus disclosure delay), 494 o a MAC, calculated with the key for the current time interval, 495 verifying 497 * the message ID, 499 * the version number, and 501 * the time data. 503 6.2.4. Procedure Overview of Broadcast Time Synchronization Exchange 505 A broadcast time synchronization message exchange consists of the 506 following steps: 508 1. The server follows the TESLA protocol by regularly sending 509 server_broad messages as described in Section 6.2.3, adhering to 510 its own disclosure schedule. 512 2. The client awaits time synchronization data in the form of a 513 server_broadcast message. Upon receipt, it performs the 514 following checks: 516 * Proof that the MAC is based on a key that is not yet disclosed 517 (packet timeliness). This is achieved via a combination of 518 checks. First, the disclosure schedule is used, which 519 requires loose time synchronization. If this is successful, 520 the client obtains a stronger guarantee via a key check 521 exchange (see below). If its timeliness is verified, the 522 packet will be buffered for later authentication. Otherwise, 523 the client MUST discard it. Note that the time information 524 included in the packet will not be used for synchronization 525 until its authenticity could also be verified. 527 * The client checks that it does not already know the disclosed 528 key. Otherwise, the client SHOULD discard the packet to avoid 529 a buffer overrun. If this check is successful, the client 530 ensures that the disclosed key belongs to the one-way key 531 chain by applying the one-way function until equality with a 532 previous disclosed key is shown. If it is falsified, the 533 client MUST discard the packet. 535 * If the disclosed key is legitimate, then the client verifies 536 the authenticity of any packet that it has received during the 537 corresponding time interval. If authenticity of a packet is 538 verified, then it is released from the buffer and its time 539 information can be utilized. If the verification fails, then 540 authenticity is not given. In this case, the client MUST 541 request authentic time from the server by means other than 542 broadcast messages. Also, the client MUST re-initialize the 543 broadcast sequence with a "client_bpar" message if the one-way 544 key chain expires, which it can check via the disclosure 545 schedule. 547 See RFC 4082[RFC4082] for a detailed description of the packet 548 verification process. 550 Server ----------------------------------> 551 \ 552 \ server_ 553 \ broad 554 \| 555 Client ----------------------------------> 557 < Broadcast > <- Client-side -> 558 time sync. validity and 559 exchange timeliness 560 checks 562 Procedure for broadcast time synchronization exchange. 564 6.3. Broadcast Keycheck 566 This message exchange is performed for an additional check of packet 567 timeliness in the course of the TESLA scheme, see Appendix C. 569 6.3.1. Preconditions for the Broadcast Keycheck Exchange 571 Before this message exchange is available, there are some 572 requirements that the client and server need to meet: 574 o They MUST negotiate the hash algorithm for the MAC used in the 575 time synchronization messages. Authenticity and integrity of the 576 communication MUST be ensured. 578 o The client MUST know a key input value KIV. Authenticity and 579 integrity of the communication MUST be ensured. 581 o Client and server MUST exchange the cookie (which depends on the 582 KIV as described in section Section 5). Authenticity, 583 confidentiality and integrity of the communication MUST be 584 ensured. 586 These requirements conform to those for the unicast time 587 synchronization exchange. Accordingly, they too can be realised via 588 the Association and Cookie Message Exchanges described in Appendix B 589 (Appendix B). 591 6.3.2. Goals of the Broadcast Keycheck Exchange 593 The keycheck exchange: 595 o guarantees to the client that the key belonging to the respective 596 TESLA interval communicated in the exchange had not been disclosed 597 before the client_keycheck message was sent. 599 o guarantees to the client the timeliness of any broadcast packet 600 secured with this key if it arrived before client_keycheck was 601 sent. 603 6.3.3. Message Type: "client_keycheck" 605 A message of this type is sent by the client in order to initiate an 606 additional check of packet timeliness for the TESLA scheme. It 607 contains 609 o the NTS message ID "client_keycheck", 611 o the NTS version number negotiated during association, 613 o a nonce, 615 o an interval number from the TESLA disclosure schedule, 617 o the hash algorithm H negotiated during association, and 619 o the client's key input value KIV. 621 6.3.4. Message Type: "server_keycheck" 623 A message of this type is sent by the server upon receipt of a 624 client_keycheck message during the broadcast loop of the server. 625 Prior to this, the server MUST recalculate the client's cookie by 626 using the received key input value and the transmitted hash 627 algorithm. It contains 629 o the NTS message ID "server_keycheck" 631 o the version number as transmitted in "client_keycheck, 633 o the nonce transmitted in the client_keycheck message, 635 o the interval number transmitted in the client_keycheck message, 636 and 638 o a MAC (generated with the cookie as key) for verification of all 639 of the above data. 641 6.3.5. Procedure Overview of the Broadcast Keycheck Exchange 643 A broadcast keycheck message exchange consists of the following 644 steps: 646 1. The client sends a client_keycheck message. It MUST memorize the 647 nonce and the time interval number that it sends as a correlated 648 pair. 650 2. Upon receipt of a client_keycheck message, the server looks up 651 whether it has already disclosed the key associated with the 652 interval number transmitted in that message. If it has not 653 disclosed it, it constructs and sends the appropriate 654 server_keycheck message as described in Section 6.3.4. For more 655 details, see also Appendix C. 657 3. The client awaits a reply in the form of a server_keycheck 658 message. On receipt, it performs the following checks: 660 * that the transmitted version number matches the one negotiated 661 previously, 663 * that the transmitted nonce belongs to a previous 664 client_keycheck message, 666 * that the TESLA interval number in that client_keycheck message 667 matches the corresponding interval number from the 668 server_keycheck, and 670 * that the appended MAC verifies the received data. 672 +----------------------+ 673 | o Assemble response | 674 | o Re-generate cookie | 675 | o Generate MAC | 676 +-----------+----------+ 677 | 678 <-+-> 679 Server ---------------------------------------------> 680 \ /| \ 681 \ server_ client_ / \ server_ 682 \ broad keycheck / \ keycheck 683 \| / \| 684 Client ---------------------------------------------> 685 <-------- Extended broadcast time -------> 686 synchronization exchange 688 <---- Keycheck exchange ---> 690 Procedure for extended broadcast time synchronization exchange. 692 7. Server Seed Considerations 694 The server has to calculate a random seed which has to be kept 695 secret. The server MUST generate a seed for each supported hash 696 algorithm, see Section 8.1. 698 According to the requirements in [RFC7384], the server MUST refresh 699 each server seed periodically. Consequently, the cookie memorized by 700 the client becomes obsolete. In this case, the client cannot verify 701 the MAC attached to subsequent time response messages and has to 702 respond accordingly by re-initiating the protocol with a cookie 703 request (Appendix B.4). 705 8. Hash Algorithms and MAC Generation 707 8.1. Hash Algorithms 709 Hash algorithms are used for calculation of the cookie and the MAC. 710 The client and the server negotiate a hash algorithm H during the 711 association phase at the beginning. The selected algorithm H is used 712 for all hashing processes in that run. 714 In the TESLA scheme, hash algorithms are used as pseudo-random 715 functions to construct the one-way key chain. Here, the utilized 716 hash algorithm is communicated by the server and is non-negotiable. 718 Note: 720 Any hash algorithm is prone to be compromised in the future. A 721 successful attack on a hash algorithm would enable any NTS client 722 to derive the server seed from its own cookie. Therefore, the 723 server MUST have separate seed values for its different supported 724 hash algorithms. This way, knowledge gained from an attack on a 725 hash algorithm H can at least only be used to compromise such 726 clients who use hash algorithm H as well. 728 8.2. MAC Calculation 730 For the calculation of the MAC, client and server use a Keyed-Hash 731 Message Authentication Code (HMAC) approach [RFC2104]. The HMAC is 732 generated with the hash algorithm specified by the client (see 733 Section 8.1). 735 9. IANA Considerations 736 10. Security Considerations 738 10.1. Privacy 740 The payload of time synchronization protocol packets of two-way time 741 transfer approaches like NTP and PTP consists basically of time 742 stamps, which are not considered secret [RFC7384]. Therefore, 743 encryption of the time synchronization protocol packet's payload is 744 not considered in this document. However, an attacker can exploit 745 the exchange of time synchronization protocol packets for topology 746 detection and inference attacks as described in [RFC7624]. To make 747 such attacks more difficult, that draft recommends the encryption of 748 the packet payload. Yet, in the case of time synchronization 749 protocols the confidentiality protection of time synchronization 750 packet's payload is of secondary importance since the packet's meta 751 data (IP addresses, port numbers, possibly packet size and regular 752 sending intervals) carry more information than the payload. To 753 enhance the privacy of the time synchronization partners, the usage 754 of tunnel protocols such as IPsec and MACsec, where applicable, is 755 therefore more suited than confidentiality protection of the payload. 757 10.2. Initial Verification of the Server Certificates 759 The client may wish to verify the validity of certificates during the 760 initial association phase. Since it generally has no reliable time 761 during this initial communication phase, it is impossible to verify 762 the period of validity of the certificates. To solve this chicken- 763 and-egg problem, the client has to rely on external means. 765 10.3. Revocation of Server Certificates 767 According to Section 7, it is the client's responsibility to initiate 768 a new association with the server after the server's certificate 769 expires. To this end, the client reads the expiration date of the 770 certificate during the certificate message exchange (Appendix B.3.3). 771 Furthermore, certificates may also be revoked prior to the normal 772 expiration date. To increase security the client MAY periodically 773 verify the state of the server's certificate via Online Certificate 774 Status Protocol (OCSP) Online Certificate Status Protocol (OCSP) 775 [RFC6960]. 777 10.4. Mitigating Denial-of-Service for broadcast packets 779 TESLA authentication buffers packets for delayed authentication. 780 This makes the protocol vulnerable to flooding attacks, causing the 781 client to buffer excessive numbers of packets. To add stronger DoS 782 protection to the protocol, the client and the server use the "not 783 re-using keys" scheme of TESLA as pointed out in Section 3.7.2 of RFC 784 4082 [RFC4082]. In this scheme the server never uses a key for the 785 MAC generation more than once. Therefore, the client can discard any 786 packet that contains a disclosed key it already knows, thus 787 preventing memory flooding attacks. 789 Discussion: Note that an alternative approach to enhance TESLA's 790 resistance against DoS attacks involves the addition of a group 791 MAC to each packet. This requires the exchange of an additional 792 shared key common to the whole group. This adds additional 793 complexity to the protocol and hence is currently not considered 794 in this document. 796 10.5. Delay Attack 798 In a packet delay attack, an adversary with the ability to act as a 799 MITM delays time synchronization packets between client and server 800 asymmetrically [RFC7384]. This prevents the client from accurately 801 measuring the network delay, and hence its time offset to the server 802 [Mizrahi]. The delay attack does not modify the content of the 803 exchanged synchronization packets. Therefore, cryptographic means do 804 not provide a feasible way to mitigate this attack. However, several 805 non-cryptographic precautions can be taken in order to detect this 806 attack. 808 1. Usage of multiple time servers: this enables the client to detect 809 the attack, provided that the adversary is unable to delay the 810 synchronization packets between the majority of servers. This 811 approach is commonly used in NTP to exclude incorrect time 812 servers [RFC5905]. 814 2. Multiple communication paths: The client and server utilize 815 different paths for packet exchange as described in the I-D 816 [I-D.ietf-tictoc-multi-path-synchronization]. The client can 817 detect the attack, provided that the adversary is unable to 818 manipulate the majority of the available paths [Shpiner]. Note 819 that this approach is not yet available, neither for NTP nor for 820 PTP. 822 3. Usage of an encrypted connection: the client exchanges all 823 packets with the time server over an encrypted connection (e.g. 824 IPsec). This measure does not mitigate the delay attack, but it 825 makes it more difficult for the adversary to identify the time 826 synchronization packets. 828 4. For unicast-type messages: Introduction of a threshold value for 829 the delay time of the synchronization packets. The client can 830 discard a time server if the packet delay time of this time 831 server is larger than the threshold value. 833 Additional provision against delay attacks has to be taken for 834 broadcast-type messages. This mode relies on the TESLA scheme which 835 is based on the requirement that a client and the broadcast server 836 are loosely time synchronized. Therefore, a broadcast client has to 837 establish time synchronization with its broadcast server before it 838 starts utilizing broadcast messages for time synchronization. 840 One possible way to achieve this initial synchronization is to 841 establish a unicast association with its broadcast server until time 842 synchronization and calibration of the packet delay time is achieved. 843 After that, the client can establish a broadcast association with the 844 broadcast server and utilizes TESLA to verify integrity and 845 authenticity of any received broadcast packets. 847 An adversary who is able to delay broadcast packets can cause a time 848 adjustment at the receiving broadcast clients. If the adversary 849 delays broadcast packets continuously, then the time adjustment will 850 accumulate until the loose time synchronization requirement is 851 violated, which breaks the TESLA scheme. To mitigate this 852 vulnerability the security condition in TESLA has to be supplemented 853 by an additional check in which the client, upon receipt of a 854 broadcast message, verifies the status of the corresponding key via a 855 unicast message exchange with the broadcast server (see Appendix C.4 856 for a detailed description of this check). Note that a broadcast 857 client should also apply the above-mentioned precautions as far as 858 possible. 860 10.6. Random Number Generation 862 At various points of the protocol, the generation of random numbers 863 is required. The employed methods of generation need to be 864 cryptographically secure. See [RFC4086] for guidelines concerning 865 this topic. 867 11. Acknowledgements 869 The authors would like to thank Tal Mizrahi, Russ Housley, Steven 870 Bellovin, David Mills, Kurt Roeckx, Rainer Bermbach, Martin Langer 871 and Florian Weimer for discussions and comments on the design of NTS. 872 Also, thanks go to Harlan Stenn for his technical review and specific 873 text contributions to this document. 875 12. References 876 12.1. Normative References 878 [RFC2104] Krawczyk, H., Bellare, M., and R. Canetti, "HMAC: Keyed- 879 Hashing for Message Authentication", RFC 2104, DOI 880 10.17487/RFC2104, February 1997, 881 . 883 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 884 Requirement Levels", BCP 14, RFC 2119, DOI 10.17487/ 885 RFC2119, March 1997, 886 . 888 [RFC4082] Perrig, A., Song, D., Canetti, R., Tygar, J., and B. 889 Briscoe, "Timed Efficient Stream Loss-Tolerant 890 Authentication (TESLA): Multicast Source Authentication 891 Transform Introduction", RFC 4082, DOI 10.17487/RFC4082, 892 June 2005, . 894 [RFC7384] Mizrahi, T., "Security Requirements of Time Protocols in 895 Packet Switched Networks", RFC 7384, DOI 10.17487/RFC7384, 896 October 2014, . 898 12.2. Informative References 900 [I-D.ietf-ntp-cms-for-nts-message] 901 Sibold, D., Teichel, K., Roettger, S., and R. Housley, 902 "Protecting Network Time Security Messages with the 903 Cryptographic Message Syntax (CMS)", draft-ietf-ntp-cms- 904 for-nts-message-04 (work in progress), July 2015. 906 [I-D.ietf-tictoc-multi-path-synchronization] 907 Shpiner, A., Tse, R., Schelp, C., and T. Mizrahi, "Multi- 908 Path Time Synchronization", draft-ietf-tictoc-multi-path- 909 synchronization-02 (work in progress), April 2015. 911 [IEEE1588] 912 IEEE Instrumentation and Measurement Society. TC-9 Sensor 913 Technology, "IEEE standard for a precision clock 914 synchronization protocol for networked measurement and 915 control systems", 2008. 917 [Mizrahi] Mizrahi, T., "A game theoretic analysis of delay attacks 918 against time synchronization protocols", in Proceedings of 919 Precision Clock Synchronization for Measurement Control 920 and Communication, ISPCS 2012, pp. 1-6, September 2012. 922 [RFC4086] Eastlake 3rd, D., Schiller, J., and S. Crocker, 923 "Randomness Requirements for Security", BCP 106, RFC 4086, 924 DOI 10.17487/RFC4086, June 2005, 925 . 927 [RFC5905] Mills, D., Martin, J., Ed., Burbank, J., and W. Kasch, 928 "Network Time Protocol Version 4: Protocol and Algorithms 929 Specification", RFC 5905, DOI 10.17487/RFC5905, June 2010, 930 . 932 [RFC6960] Santesson, S., Myers, M., Ankney, R., Malpani, A., 933 Galperin, S., and C. Adams, "X.509 Internet Public Key 934 Infrastructure Online Certificate Status Protocol - OCSP", 935 RFC 6960, DOI 10.17487/RFC6960, June 2013, 936 . 938 [RFC7624] Barnes, R., Schneier, B., Jennings, C., Hardie, T., 939 Trammell, B., Huitema, C., and D. Borkmann, 940 "Confidentiality in the Face of Pervasive Surveillance: A 941 Threat Model and Problem Statement", RFC 7624, DOI 942 10.17487/RFC7624, August 2015, 943 . 945 [Shpiner] Shpiner, A., Revah, Y., and T. Mizrahi, "Multi-path Time 946 Protocols", in Proceedings of Precision Clock 947 Synchronization for Measurement Control and Communication, 948 ISPCS 2013, pp. 1-6, September 2013. 950 Appendix A. (informative) TICTOC Security Requirements 952 The following table compares the NTS specifications against the 953 TICTOC security requirements [RFC7384]. 955 +---------+------------------------------+-------------+------------+ 956 | Section | Requirement from RFC 7384 | Requirement | NTS | 957 | | | level | | 958 +---------+------------------------------+-------------+------------+ 959 | 5.1.1 | Authentication of Servers | MUST | OK | 960 +---------+------------------------------+-------------+------------+ 961 | 5.1.1 | Authorization of Servers | MUST | OK | 962 +---------+------------------------------+-------------+------------+ 963 | 5.1.2 | Recursive Authentication of | MUST | OK | 964 | | Servers (Stratum 1) | | | 965 +---------+------------------------------+-------------+------------+ 966 | 5.1.2 | Recursive Authorization of | MUST | OK | 967 | | Servers (Stratum 1) | | | 968 +---------+------------------------------+-------------+------------+ 969 | 5.1.3 | Authentication and | MAY | Optional, | 970 | | Authorization of Clients | | Limited | 971 +---------+------------------------------+-------------+------------+ 972 | 5.2 | Integrity protection | MUST | OK | 973 +---------+------------------------------+-------------+------------+ 974 | 5.3 | Spoofing Prevention | MUST | OK | 975 +---------+------------------------------+-------------+------------+ 976 | 5.4 | Protection from DoS attacks | SHOULD | OK | 977 | | against the time protocol | | | 978 +---------+------------------------------+-------------+------------+ 979 | 5.5 | Replay protection | MUST | OK | 980 +---------+------------------------------+-------------+------------+ 981 | 5.6 | Key freshness | MUST | OK | 982 +---------+------------------------------+-------------+------------+ 983 | | Security association | SHOULD | OK | 984 +---------+------------------------------+-------------+------------+ 985 | | Unicast and multicast | SHOULD | OK | 986 | | associations | | | 987 +---------+------------------------------+-------------+------------+ 988 | 5.7 | Performance: no degradation | MUST | OK | 989 | | in quality of time transfer | | | 990 +---------+------------------------------+-------------+------------+ 991 | | Performance: lightweight | SHOULD | OK | 992 | | computation | | | 993 +---------+------------------------------+-------------+------------+ 994 | | Performance: storage | SHOULD | OK | 995 +---------+------------------------------+-------------+------------+ 996 | | Performance: bandwidth | SHOULD | OK | 997 +---------+------------------------------+-------------+------------+ 998 | 5.8 | Confidentiality protection | MAY | NO | 999 +---------+------------------------------+-------------+------------+ 1000 | 5.9 | Protection against Packet | MUST | Limited*) | 1001 | | Delay and Interception | | | 1002 | | Attacks | | | 1003 +---------+------------------------------+-------------+------------+ 1004 | 5.10 | Secure mode | MUST | OK | 1005 +---------+------------------------------+-------------+------------+ 1006 | | Hybrid mode | SHOULD | - | 1007 +---------+------------------------------+-------------+------------+ 1009 *) See discussion in Section 10.5. 1011 Comparison of NTS specification against Security Requirements of Time 1012 Protocols in Packet Switched Networks (RFC 7384) 1014 Appendix B. (normative) Inherent Association Protocol Messages 1016 This appendix presents a procedure that performs the association, the 1017 cookie, and also the broadcast parameter message exchanges between a 1018 client and a server. This procedure is one possible way to achieve 1019 the preconditions listed in Sections Section 6.1.1, Section 6.2.1, 1020 and Section 6.3.1 while taking into account the objectives given in 1021 Section Section 4. 1023 B.1. Overview of NTS with Inherent Association Protocol 1025 This inherent association protocol applies X.509 certificates to 1026 verify the authenticity of the time server and to exchange the 1027 cookie. This is done in two separate message exchanges, described 1028 below. An additional required exchange in advance serves to limit 1029 the amplification potential of the association message exchange. 1031 A client needs a public/private key pair for encryption, with the 1032 public key enclosed in a certificate. A server needs a public/ 1033 private key pair for signing, with the public key enclosed in a 1034 certificate. If a participant intends to act as both a client and a 1035 server, it MUST have two different key pairs for these purposes. 1037 If this protocol is employed, the hash value of the client's 1038 certificate is used as the client's key input value, i.e. the cookie 1039 is calculated according to: 1041 cookie = MSB_ (HMAC(server seed, H(certificate of client))). 1043 The client's certificate contains the client's public key and enables 1044 the server to identify the client, if client authorization is 1045 desired. 1047 B.2. Access Message Exchange 1049 This message exchange serves only to prevent the next (association) 1050 exchange from being abusable for amplification denial-of-service 1051 attacks. 1053 B.2.1. Goals of the Access Message Exchange 1055 The access message exchange: 1057 o transfers a secret value from the server to the client 1058 (initiator), 1060 o the secret value permits the client to initiate an association 1061 message exchange. 1063 B.2.2. Message Type: "client_access" 1065 This message is sent by a client who intends to perform an 1066 association exchange with the server in the future. It contains: 1068 o the NTS message ID "client_access". 1070 B.2.3. Message Type: "server_access" 1072 This message is sent by the server on receipt of a client_access 1073 message. It contains: 1075 o the NTS message ID "server_access", 1077 o an access key. 1079 B.2.4. Procedure Overview of the Access Exchange 1081 For an access exchange, the following steps are performed: 1083 1. The client sends a client_access message to the server. 1085 2. Upon receipt of a client_access, the server calculates the access 1086 key according to 1088 access_key = HMAC(server seed; address of client), 1090 then it constructs and sends a reply in the form of a 1091 server_access message. In general the address of the client will 1092 be represented by the IP address of the client. 1094 3. The client waits for a response in the form of a server_access 1095 message. Upon receipt of one, it MUST memorize the included 1096 access key. 1098 B.3. Association Message Exchange 1100 In this message exchange, the participants negotiate the hash and 1101 encryption algorithms that are used throughout the protocol. In 1102 addition, the client receives the certification chain up to a trusted 1103 anchor. With the established certification chain the client is able 1104 to verify the server's signatures and, hence, the authenticity of 1105 future NTS messages from the server is ensured. 1107 B.3.1. Goals of the Association Exchange 1109 The association exchange: 1111 o enables the client to verify any communication with the server as 1112 authentic, 1114 o lets the participants negotiate NTS version and algorithms, 1116 o guarantees authenticity and integrity of the negotiation result to 1117 the client, 1119 o guarantees to the client that the negotiation result is based on 1120 the client's original, unaltered request. 1122 B.3.2. Message Type: "client_assoc" 1124 This message is sent by the client if it wants to perform association 1125 with a server. It contains 1127 o the NTS message ID "client_assoc", 1129 o a nonce, 1131 o the access key obtained earlier via an access message exchange, 1133 o the version number of NTS that the client wants to use (this 1134 SHOULD be the highest version number that it supports), 1136 o a selection of accepted hash algorithms, and 1138 o a selection of accepted encryption algorithms. 1140 B.3.3. Message Type: "server_assoc" 1142 This message is sent by the server upon receipt of client_assoc. It 1143 contains 1145 o the NTS message ID "server_assoc", 1147 o the nonce transmitted in client_assoc, 1149 o the client's proposal for the version number, selection of 1150 accepted hash algorithms and selection of accepted encryption 1151 algorithms, as transmitted in client_assoc, 1153 o the version number used for the rest of the protocol (which SHOULD 1154 be determined as the minimum over the client's suggestion in the 1155 client_assoc message and the highest supported by the server), 1157 o the server's choice of algorithm for encryption and for 1158 cryptographic hashing, all of which MUST be chosen from the 1159 client's proposals, 1161 o a signature, calculated over the data listed above, with the 1162 server's private key and according to the signature algorithm 1163 which is also used for the certificates that are included (see 1164 below), and 1166 o a chain of certificates, which starts at the server and goes up to 1167 a trusted authority; each certificate MUST be certified by the one 1168 directly following it. 1170 B.3.4. Procedure Overview of the Association Exchange 1172 For an association exchange, the following steps are performed: 1174 1. The client sends a client_assoc message to the server. It MUST 1175 keep the transmitted values for the version number and algorithms 1176 available for later checks. 1178 2. Upon receipt of a client_assoc message, the server checks the 1179 validity of the included access key. If it is not valid, the 1180 server MUST abort communication. If it is valid, the server 1181 constructs and sends a reply in the form of a server_assoc 1182 message as described in Appendix B.3.3. Upon unsuccessful 1183 negotiation for version number or algorithms the server_assoc 1184 message MUST contain an error code. 1186 3. The client waits for a reply in the form of a server_assoc 1187 message. After receipt of the message it performs the following 1188 checks: 1190 * The client checks that the message contains a conforming 1191 version number. 1193 * It checks that the nonce sent back by the server matches the 1194 one transmitted in client_assoc, 1196 * It also verifies that the server has chosen the encryption and 1197 hash algorithms from its proposal sent in the client_assoc 1198 message and that this proposal was not altered. 1200 * Furthermore, it performs authenticity checks on the 1201 certificate chain and the signature. 1203 If one of the checks fails, the client MUST abort the run. 1205 +------------------------+ 1206 | o Choose version | 1207 | o Choose algorithms | 1208 | o Acquire certificates | 1209 | o Assemble response | 1210 | o Create signature | 1211 +-----------+------------+ 1212 | 1213 <-+-> 1215 Server ---------------------------> 1216 /| \ 1217 client_ / \ server_ 1218 assoc / \ assoc 1219 / \| 1220 Client ---------------------------> 1222 <------ Association -----> 1223 exchange 1225 Procedure for association and cookie exchange. 1227 B.4. Cookie Message Exchange 1229 During this message exchange, the server transmits a secret cookie to 1230 the client securely. The cookie will later be used for integrity 1231 protection during unicast time synchronization. 1233 B.4.1. Goals of the Cookie Exchange 1235 The cookie exchange: 1237 o enables the server to check the client's authorization via its 1238 certificate (optional), 1240 o supplies the client with the correct cookie and corresponding KIV 1241 for its association to the server, 1243 o guarantees to the client that the cookie originates from the 1244 server and that it is based on the client's original, unaltered 1245 request. 1247 o guarantees that the received cookie is unknown to anyone but the 1248 server and the client. 1250 B.4.2. Message Type: "client_cook" 1252 This message is sent by the client upon successful authentication of 1253 the server. In this message, the client requests a cookie from the 1254 server. The message contains 1256 o the NTS message ID "client_cook", 1258 o a nonce, 1260 o the negotiated version number, 1262 o the negotiated signature algorithm, 1264 o the negotiated encryption algorithm, 1266 o the negotiated hash algorithm H, 1268 o the client's certificate. 1270 B.4.3. Message Type: "server_cook" 1272 This message is sent by the server upon receipt of a client_cook 1273 message. The server generates the hash of the client's certificate, 1274 as conveyed during client_cook, in order to calculate the cookie 1275 according to Section 5. This message contains 1277 o the NTS message ID "server_cook" 1279 o the version number as transmitted in client_cook, 1281 o a concatenated datum which is encrypted with the client's public 1282 key, according to the encryption algorithm transmitted in the 1283 client_cook message. The concatenated datum contains 1285 * the nonce transmitted in client_cook, and 1287 * the cookie. 1289 o a signature, created with the server's private key, calculated 1290 over all of the data listed above. This signature MUST be 1291 calculated according to the transmitted signature algorithm from 1292 the client_cook message. 1294 B.4.4. Procedure Overview of the Cookie Exchange 1296 For a cookie exchange, the following steps are performed: 1298 1. The client sends a client_cook message to the server. The client 1299 MUST save the included nonce until the reply has been processed. 1301 2. Upon receipt of a client_cook message, the server checks whether 1302 it supports the given cryptographic algorithms. It then 1303 calculates the cookie according to the formula given in 1304 Section 5. The server MAY use the client's certificate to check 1305 that the client is authorized to use the secure time 1306 synchronization service. With this, it MUST construct a 1307 server_cook message as described in Appendix B.4.3. 1309 3. The client awaits a reply in the form of a server_cook message; 1310 upon receipt it executes the following actions: 1312 * It verifies that the received version number matches the one 1313 negotiated beforehand. 1315 * It verifies the signature using the server's public key. The 1316 signature has to authenticate the encrypted data. 1318 * It decrypts the encrypted data with its own private key. 1320 * It checks that the decrypted message is of the expected 1321 format: the concatenation of a nonce and a cookie of the 1322 expected bit lengths. 1324 * It verifies that the received nonce matches the nonce sent in 1325 the client_cook message. 1327 If one of those checks fails, the client MUST abort the run. 1329 +----------------------------+ 1330 | o OPTIONAL: Check client's | 1331 | authorization | 1332 | o Generate cookie | 1333 | o Encrypt inner message | 1334 | o Generate signature | 1335 +-------------+--------------+ 1336 | 1337 <-+-> 1339 Server ---------------------------> 1340 /| \ 1341 client_ / \ server_ 1342 cook / \ cook 1343 / \| 1344 Client ---------------------------> 1346 <--- Cookie exchange --> 1348 Procedure for association and cookie exchange. 1350 B.4.5. Broadcast Parameter Messages 1352 In this message exchange, the client receives the necessary 1353 information to execute the TESLA protocol in a secured broadcast 1354 association. The client can only initiate a secure broadcast 1355 association after successful association and cookie exchanges and 1356 only if it has made sure that its clock is roughly synchronized to 1357 the server's. 1359 See Appendix C for more details on TESLA. 1361 B.4.5.1. Goals of the Broadcast Parameter Exchange 1363 The broadcast parameter exchange 1365 o provides the client with all the information necessary to process 1366 broadcast time synchronization messages from the server, and 1368 o guarantees authenticity, integrity and freshness of the broadcast 1369 parameters to the client. 1371 B.4.5.2. Message Type: "client_bpar" 1373 This message is sent by the client in order to establish a secured 1374 time broadcast association with the server. It contains 1376 o the NTS message ID "client_bpar", 1377 o the NTS version number negotiated during association, 1379 o a nonce, and 1381 o the signature algorithm negotiated during association. 1383 B.4.5.3. Message Type: "server_bpar" 1385 This message is sent by the server upon receipt of a client_bpar 1386 message during the broadcast loop of the server. It contains 1388 o the NTS message ID "server_bpar", 1390 o the version number as transmitted in the client_bpar message, 1392 o the nonce transmitted in client_bpar, 1394 o the one-way functions used for building the key chain, and 1396 o the disclosure schedule of the keys. This contains: 1398 * the last key of the key chain, 1400 * time interval duration, 1402 * the disclosure delay (number of intervals between use and 1403 disclosure of a key), 1405 * the time at which the next time interval will start, and 1407 * the next interval's associated index. 1409 o The message also contains a signature signed by the server with 1410 its private key, verifying all the data listed above. 1412 B.4.5.4. Procedure Overview of the Broadcast Parameter Exchange 1414 A broadcast parameter exchange consists of the following steps: 1416 1. The client sends a client_bpar message to the server. It MUST 1417 remember the transmitted values for the nonce, the version number 1418 and the signature algorithm. 1420 2. Upon receipt of a client_bpar message, the server constructs and 1421 sends a server_bpar message as described in Appendix B.4.5.3. 1423 3. The client waits for a reply in the form of a server_bpar 1424 message, on which it performs the following checks: 1426 * The message must contain all the necessary information for the 1427 TESLA protocol, as listed in Appendix B.4.5.3. 1429 * The message must contain a nonce belonging to a client_bpar 1430 message that the client has previously sent. 1432 * Verification of the message's signature. 1434 If any information is missing or if the server's signature cannot 1435 be verified, the client MUST abort the broadcast run. If all 1436 checks are successful, the client MUST remember all the broadcast 1437 parameters received for later checks. 1439 +---------------------+ 1440 | o Assemble response | 1441 | o Create public-key | 1442 | signature | 1443 +----------+----------+ 1444 | 1445 <-+-> 1447 Server ---------------------------------------------> 1448 /| \ 1449 client_ / \ server_ 1450 bpar / \ bpar 1451 / \| 1452 Client ---------------------------------------------> 1454 <------- Broadcast ------> <- Client-side -> 1455 parameter validity 1456 exchange checks 1458 Procedure for unicast time synchronization exchange. 1460 Appendix C. (normative) Using TESLA for Broadcast-Type Messages 1462 For broadcast-type messages, NTS adopts the TESLA protocol with some 1463 customizations. This appendix provides details on the generation and 1464 usage of the one-way key chain collected and assembled from 1465 [RFC4082]. Note that NTS uses the "not re-using keys" scheme of 1466 TESLA as described in Section 3.7.2. of [RFC4082]. 1468 C.1. Server Preparation 1470 Server setup: 1472 1. The server determines a reasonable upper bound B on the network 1473 delay between itself and an arbitrary client, measured in 1474 milliseconds. 1476 2. It determines the number n+1 of keys in the one-way key chain. 1477 This yields the number n of keys that are usable to authenticate 1478 broadcast packets. This number n is therefore also the number of 1479 time intervals during which the server can send authenticated 1480 broadcast messages before it has to calculate a new key chain. 1482 3. It divides time into n uniform intervals I_1, I_2, ..., I_n. 1483 Each of these time intervals has length L, measured in 1484 milliseconds. In order to fulfill the requirement 3.7.2. of RFC 1485 4082, the time interval L has to be shorter than the time 1486 interval between the broadcast messages. 1488 4. The server generates a random key K_n. 1490 5. Using a one-way function F, the server generates a one-way chain 1491 of n+1 keys K_0, K_1, ..., K_{n} according to 1493 K_i = F(K_{i+1}). 1495 6. Using another one-way function F', it generates a sequence of n 1496 MAC keys K'_0, K'_1, ..., K'_{n-1} according to 1498 K'_i = F'(K_i). 1500 7. Each MAC key K'_i is assigned to the time interval I_i. 1502 8. The server determines the key disclosure delay d, which is the 1503 number of intervals between using a key and disclosing it. Note 1504 that although security is provided for all choices d>0, the 1505 choice still makes a difference: 1507 * If d is chosen too short, the client might discard packets 1508 because it fails to verify that the key used for its MAC has 1509 not yet been disclosed. 1511 * If d is chosen too long, the received packets have to be 1512 buffered for an unnecessarily long time before they can be 1513 verified by the client and be subsequently utilized for time 1514 synchronization. 1516 It is RECOMMENDED that the server calculate d according to 1518 d = ceil( 2*B / L) + 1, 1520 where ceil yields the smallest integer greater than or equal to 1521 its argument. 1523 < - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1524 Generation of Keys 1526 F F F F 1527 K_0 <-------- K_1 <-------- ... <-------- K_{n-1} <------- K_n 1528 | | | | 1529 | | | | 1530 | F' | F' | F' | F' 1531 | | | | 1532 v v v v 1533 K'_0 K'_1 ... K'_{n-1} K'_n 1534 [______________|____ ____|_________________|_______] 1535 I_1 ... I_{n-1} I_n 1537 Course of Time/Usage of Keys 1538 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -> 1540 A schematic explanation of the TESLA protocol's one-way key chain 1542 C.2. Client Preparation 1544 A client needs the following information in order to participate in a 1545 TESLA broadcast: 1547 o One key K_i from the one-way key chain, which has to be 1548 authenticated as belonging to the server. Typically, this will be 1549 K_0. 1551 o The disclosure schedule of the keys. This consists of: 1553 * the length n of the one-way key chain, 1555 * the length L of the time intervals I_1, I_2, ..., I_n, 1557 * the starting time T_i of an interval I_i. Typically this is 1558 the starting time T_1 of the first interval; 1560 * the disclosure delay d. 1562 o The one-way function F used to recursively derive the keys in the 1563 one-way key chain, 1565 o The second one-way function F' used to derive the MAC keys K'_0, 1566 K'_1, ... , K'_n from the keys in the one-way chain. 1568 o An upper bound D_t on how far its own clock is "behind" that of 1569 the server. 1571 Note that if D_t is greater than (d - 1) * L, then some authentic 1572 packets might be discarded. If D_t is greater than d * L, then all 1573 authentic packets will be discarded. In the latter case, the client 1574 SHOULD NOT participate in the broadcast, since there will be no 1575 benefit in doing so. 1577 C.3. Sending Authenticated Broadcast Packets 1579 During each time interval I_i, the server sends at most one 1580 authenticated broadcast packet P_i. Such a packet consists of: 1582 o a message M_i, 1584 o the index i (in case a packet arrives late), 1586 o a MAC authenticating the message M_i, with K'_i used as key, 1588 o the key K_{i-d}, which is included for disclosure. 1590 C.4. Authentication of Received Packets 1592 When a client receives a packet P_i as described above, it first 1593 checks that it has not already received a packet with the same 1594 disclosed key. This is done to avoid replay/flooding attacks. A 1595 packet that fails this test is discarded. 1597 Next, the client begins to check the packet's timeliness by ensuring 1598 that according to the disclosure schedule and with respect to the 1599 upper bound D_t determined above, the server cannot have disclosed 1600 the key K_i yet. Specifically, it needs to check that the server's 1601 clock cannot read a time that is in time interval I_{i+d} or later. 1602 Since it works under the assumption that the server's clock is not 1603 more than D_t "ahead" of the client's clock, the client can calculate 1604 an upper bound t_i for the server's clock at the time when P_i 1605 arrived. This upper bound t_i is calculated according to 1607 t_i = R + D_t, 1609 where R is the client's clock at the arrival of P_i. This implies 1610 that at the time of arrival of P_i, the server could have been in 1611 interval I_x at most, with 1613 x = floor((t_i - T_1) / L) + 1, 1615 where floor gives the greatest integer less than or equal to its 1616 argument. The client now needs to verify that 1618 x < i+d 1620 is valid (see also Section 3.5 of [RFC4082]). If it is falsified, it 1621 is discarded. 1623 If the check above is successful, the client performs another more 1624 rigorous check: it sends a key check request to the server (in the 1625 form of a client_keycheck message), asking explicitly if K_i has 1626 already been disclosed. It remembers the time stamp t_check of the 1627 sending time of that request as well as the nonce it used correlated 1628 with the interval number i. If it receives an answer from the server 1629 stating that K_i has not yet been disclosed and it is able to verify 1630 the HMAC on that response, then it deduces that K_i was undisclosed 1631 at t_check and therefore also at R. In this case, the client accepts 1632 P_i as timely. 1634 Next the client verifies that a newly disclosed key K_{i-d} belongs 1635 to the one-way key chain. To this end, it applies the one-way 1636 function F to K_{i-d} until it can verify the identity with an 1637 earlier disclosed key (see Clause 3.5 in RFC 4082, item 3). 1639 Next the client verifies that the transmitted time value s_i belongs 1640 to the time interval I_i, by checking 1642 T_i =< s_i, and 1644 s_i < T_{i+1}. 1646 If it is falsified, the packet MUST be discarded and the client MUST 1647 reinitialize its broadcast module by performing time synchronization 1648 by other means than broadcast messages, and it MUST perform a new 1649 broadcast parameter exchange (because a falsification of this check 1650 yields that the packet was not generated according to protocol, which 1651 suggests an attack). 1653 If a packet P_i passes all the tests listed above, it is stored for 1654 later authentication. Also, if at this time there is a package with 1655 index i-d already buffered, then the client uses the disclosed key 1656 K_{i-d} to derive K'_{i-d} and uses that to check the MAC included in 1657 package P_{i-d}. Upon success, it regards M_{i-d} as authenticated. 1659 Appendix D. (informative) Dependencies 1661 +---------+--------------+--------+-------------------------------+ 1662 | Issuer | Type | Owner | Description | 1663 +---------+--------------+--------+-------------------------------+ 1664 | Server | private key | server | Used for server_assoc, | 1665 | PKI | (signature) | | server_cook, server_bpar. | 1666 | +--------------+--------+ The server uses the private | 1667 | | public key | client | key to sign these messages. | 1668 | | (signature) | | The client uses the public | 1669 | +--------------+--------+ key to verify them. | 1670 | | certificate | server | The certificate is used in | 1671 | | | | server_assoc messages, for | 1672 | | | | verifying authentication and | 1673 | | | | (optionally) authorization. | 1674 +---------+--------------+--------+-------------------------------+ 1675 | Client | private key | client | The server uses the client's | 1676 | PKI | (encryption) | | public key to encrypt the | 1677 | +--------------+--------+ content of server_cook | 1678 | | public key | server | messages. The client uses | 1679 | | (encryption) | | the private key to decrypt | 1680 | +--------------+--------+ them. The certificate is | 1681 | | certificate | client | sent in client_cook messages, | 1682 | | | | where it is used for trans- | 1683 | | | | portation of the public key | 1684 | | | | as well as (optionally) for | 1685 | | | | verification of client | 1686 | | | | authorization. | 1687 +---------+--------------+--------+-------------------------------+ 1688 +------------<---------------+ 1689 | At least one | 1690 V successful | 1691 ++====[ ]===++ ++=====^=====++ 1692 || Cookie || ||Association|| 1693 || Exchange || || Exchange || 1694 ++====_ _===++ ++===========++ 1695 | 1696 | At least one 1697 | successful 1698 V 1699 ++=======[ ]=======++ 1700 || Unicast Time |>-----\ As long as further 1701 || Synchronization || | synchronization 1702 || Exchange(s) |<-----/ is desired 1703 ++=======_ _=======++ 1704 | 1705 \ Other (unspecified) 1706 Sufficient \ / methods which give 1707 accuracy \ either or / sufficient accuracy 1708 \----------\ /---------/ 1709 | 1710 | 1711 V 1712 ++========[ ]=========++ 1713 || Broadcast || 1714 || Parameter Exchange || 1715 ++========_ _=========++ 1716 | 1717 | One successful 1718 | per client 1719 V 1720 ++=======[ ]=======++ 1721 || Broadcast Time |>--------\ As long as further 1722 || Synchronization || | synchronization 1723 || Reception |<--------/ is desired 1724 ++=======_ _=======++ 1725 | 1726 / \ 1727 either / \ or 1728 /----------/ \-------------\ 1729 | | 1730 V V 1731 ++========[ ]========++ ++========[ ]========++ 1732 || Keycheck Exchange || || Keycheck Exchange || 1733 ++===================++ || with TimeSync || 1734 ++===================++ 1736 Authors' Addresses 1738 Dieter Sibold 1739 Physikalisch-Technische Bundesanstalt 1740 Bundesallee 100 1741 Braunschweig D-38116 1742 Germany 1744 Phone: +49-(0)531-592-8420 1745 Fax: +49-531-592-698420 1746 Email: dieter.sibold@ptb.de 1748 Stephen Roettger 1749 Google Inc. 1751 Email: stephen.roettger@googlemail.com 1753 Kristof Teichel 1754 Physikalisch-Technische Bundesanstalt 1755 Bundesallee 100 1756 Braunschweig D-38116 1757 Germany 1759 Phone: +49-(0)531-592-8421 1760 Email: kristof.teichel@ptb.de