idnits 2.17.1 draft-ietf-ntp-network-time-security-10.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 05, 2015) is 3119 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 7, 2016 Google Inc. 6 K. Teichel 7 PTB 8 October 05, 2015 10 Network Time Security 11 draft-ietf-ntp-network-time-security-10 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 7, 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 . . . . . . . . . . . . . . . . . . . . . . 4 67 4. Objectives . . . . . . . . . . . . . . . . . . . . . . . . . 5 68 5. NTS Overview . . . . . . . . . . . . . . . . . . . . . . . . 5 69 6. Protocol Messages . . . . . . . . . . . . . . . . . . . . . . 6 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 . 7 74 6.1.3. Message Type: "time_request" . . . . . . . . . . . . 7 75 6.1.4. Message Type: "time_response" . . . . . . . . . . . . 8 76 6.1.5. Procedure Overview of the Unicast Time 77 Synchronization Exchange . . . . . . . . . . . . . . 8 78 6.2. Broadcast Time Synchronization Exchange . . . . . . . . . 9 79 6.2.1. Preconditions for the Broadcast Time Synchronization 80 Exchange . . . . . . . . . . . . . . . . . . . . . . 9 81 6.2.2. Goals of the Broadcast Time Synchronization Exchange 10 82 6.2.3. Message Type: "server_broad" . . . . . . . . . . . . 10 83 6.2.4. Procedure Overview of Broadcast Time Synchronization 84 Exchange . . . . . . . . . . . . . . . . . . . . . . 11 85 6.3. Broadcast Keycheck . . . . . . . . . . . . . . . . . . . 12 86 6.3.1. Preconditions for the Broadcast Keycheck Exchange . . 12 87 6.3.2. Goals of the Broadcast Keycheck Exchange . . . . . . 13 88 6.3.3. Message Type: "client_keycheck" . . . . . . . . . . . 13 89 6.3.4. Message Type: "server_keycheck" . . . . . . . . . . . 13 90 6.3.5. Procedure Overview of the Broadcast Keycheck Exchange 14 91 7. Server Seed Considerations . . . . . . . . . . . . . . . . . 15 92 8. Hash Algorithms and MAC Generation . . . . . . . . . . . . . 15 93 8.1. Hash Algorithms . . . . . . . . . . . . . . . . . . . . . 15 94 8.2. MAC Calculation . . . . . . . . . . . . . . . . . . . . . 16 95 9. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 16 96 10. Security Considerations . . . . . . . . . . . . . . . . . . . 16 97 10.1. Privacy . . . . . . . . . . . . . . . . . . . . . . . . 16 98 10.2. Initial Verification of the Server Certificates . . . . 16 99 10.3. Revocation of Server Certificates . . . . . . . . . . . 17 100 10.4. Mitigating Denial-of-Service for broadcast packets . . . 17 101 10.5. Delay Attack . . . . . . . . . . . . . . . . . . . . . . 17 102 10.6. Random Number Generation . . . . . . . . . . . . . . . . 19 103 11. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 19 104 12. References . . . . . . . . . . . . . . . . . . . . . . . . . 19 105 12.1. Normative References . . . . . . . . . . . . . . . . . . 19 106 12.2. Informative References . . . . . . . . . . . . . . . . . 19 107 Appendix A. (informative) TICTOC Security Requirements . . . . . 21 108 Appendix B. (normative) Inherent Association Protocol Messages . 22 109 B.1. Overview of NTS with Inherent Association Protocol . . . 22 110 B.2. Association Message Exchange . . . . . . . . . . . . . . 22 111 B.2.1. Goals of the Association Exchange . . . . . . . . . . 23 112 B.2.2. Message Type: "client_assoc" . . . . . . . . . . . . 23 113 B.2.3. Message Type: "server_assoc" . . . . . . . . . . . . 23 114 B.2.4. Procedure Overview of the Association Exchange . . . 24 115 B.3. Cookie Messages . . . . . . . . . . . . . . . . . . . . . 25 116 B.3.1. Goals of the Cookie Exchange . . . . . . . . . . . . 25 117 B.3.2. Message Type: "client_cook" . . . . . . . . . . . . . 26 118 B.3.3. Message Type: "server_cook" . . . . . . . . . . . . . 26 119 B.3.4. Procedure Overview of the Cookie Exchange . . . . . . 27 120 B.3.5. Broadcast Parameter Messages . . . . . . . . . . . . 28 121 Appendix C. (normative) Using TESLA for Broadcast-Type Messages 30 122 C.1. Server Preparation . . . . . . . . . . . . . . . . . . . 30 123 C.2. Client Preparation . . . . . . . . . . . . . . . . . . . 32 124 C.3. Sending Authenticated Broadcast Packets . . . . . . . . . 33 125 C.4. Authentication of Received Packets . . . . . . . . . . . 33 126 Appendix D. (informative) Dependencies . . . . . . . . . . . . . 35 127 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 37 129 1. Introduction 131 Time synchronization protocols are increasingly utilized to 132 synchronize clocks in networked infrastructures. Successful attacks 133 against the time synchronization protocol can seriously degrade the 134 reliable performance of such infrastructures. Therefore, time 135 synchronization protocols have to be secured if they are applied in 136 environments that are prone to malicious attacks. This can be 137 accomplished either by utilization of external security protocols, 138 like IPsec or TLS, or by intrinsic security measures of the time 139 synchronization protocol. 141 The two most popular time synchronization protocols, the Network Time 142 Protocol (NTP) [RFC5905] and the Precision Time Protocol (PTP) 143 [IEEE1588], currently do not provide adequate intrinsic security 144 precautions. This document specifies security measures which enable 145 these and possibly other protocols to verify the authenticity of the 146 time server/master and the integrity of the time synchronization 147 protocol packets. The utilization of these measures for a given 148 specific time synchronization protocol has to be described in a 149 separate document. 151 [RFC7384] specifies that a security mechanism for timekeeping must be 152 designed in such a way that it does not degrade the quality of the 153 time transfer. This implies that for time keeping the increase in 154 bandwidth and message latency caused by the security measures should 155 be small. Also, NTP as well as PTP work via UDP and connections are 156 stateless on the server/master side. Therefore, all security 157 measures in this document are designed in such a way that they add 158 little demand for bandwidth, that the necessary calculations can be 159 executed in a fast manner, and that the measures do not require a 160 server/master to keep state of a connection. 162 2. Terminology 164 2.1. Terms and Abbreviations 166 MITM Man In The Middle 168 NTS Network Time Security 170 TESLA Timed Efficient Stream Loss-tolerant Authentication 172 MAC Message Authentication Code 174 HMAC Keyed-Hash Message Authentication Code 176 2.2. Common Terminology for PTP and NTP 178 This document refers to different time synchronization protocols, in 179 particular to both the PTP and the NTP. Throughout the document the 180 term "server" applies to both a PTP master and an NTP server. 181 Accordingly, the term "client" applies to both a PTP slave and an NTP 182 client. 184 3. Security Threats 186 The document "Security Requirements of Time Protocols in Packet 187 Switched Networks" [RFC7384] contains a profound analysis of security 188 threats and requirements for time synchronization protocols. 190 4. Objectives 192 The objectives of the NTS specification are as follows: 194 o Authenticity: NTS enables the client to authenticate its time 195 server(s). 197 o Integrity: NTS protects the integrity of time synchronization 198 protocol packets via a message authentication code (MAC). 200 o Confidentiality: NTS does not provide confidentiality protection 201 of the time synchronization packets. 203 o Authorization: NTS enables the client to verify its time server's 204 authorization. NTS optionally enables the server to verify the 205 client's authorization as well. 207 o Request-Response-Consistency: NTS enables a client to match an 208 incoming response to a request it has sent. NTS also enables the 209 client to deduce from the response whether its request to the 210 server has arrived without alteration. 212 o Integration with protocols: NTS can be used to secure different 213 time synchronization protocols, specifically at least NTP and PTP. 214 A client or server running an NTS-secured version of a time 215 protocol does not negatively affect other participants who are 216 running unsecured versions of that protocol. 218 5. NTS Overview 220 NTS initially verifies the authenticity of the time server and 221 exchanges a symmetric key, the so-called cookie, as well as a key 222 input value (KIV). After the cookie and the KIV are exchanged, the 223 client then uses them to protect the authenticity and the integrity 224 of subsequent unicast-type time synchronization packets. In order to 225 do this, a Message Authentication Code (MAC) is attached to each time 226 synchronization packet. The calculation of the MAC includes the 227 whole time synchronization packet and the cookie which is shared 228 between client and server. 230 The cookie is calculated according to: 232 cookie = MSB_ (HMAC(server seed, KIV)), 234 with the server seed as the key, where KIV is the client's key input 235 value, and where the application of the function MSB_ returns only 236 the b most significant bits. The server seed is a random value of 237 bit length b that the server possesses, which has to remain secret. 239 The cookie deterministically depends on KIV as long as the server 240 seed stays the same. The server seed has to be refreshed 241 periodically in order to provide key freshness as required in 242 [RFC7384]. See Section 7 for details on seed refreshing. 244 Since the server does not keep a state of the client, it has to 245 recalculate the cookie each time it receives a unicast time 246 synchronization request from the client. To this end, the client has 247 to attach its KIV to each request (see Section 6.1). 249 For broadcast-type messages, authenticity and integrity of the time 250 synchronization packets are also ensured by a MAC, which is attached 251 to the time synchronization packet by the sender. Verification of 252 the broadcast-type packets' authenticity is based on the TESLA 253 protocol, in particular on its "not re-using keys" scheme, see 254 Section 3.7.2 of [RFC4082]. TESLA uses a one-way chain of keys, 255 where each key is the output of a one-way function applied to the 256 previous key in the chain. The server securely shares the last 257 element of the chain with all clients. The server splits time into 258 intervals of uniform duration and assigns each key to an interval in 259 reverse order. At each time interval, the server sends a broadcast 260 packet appended by a MAC, calculated using the corresponding key, and 261 the key of the previous disclosure interval. The client verifies the 262 MAC by buffering the packet until disclosure of the key in its 263 associated disclosure interval occurs. In order to be able to verify 264 the timeliness of the packets, the client has to be loosely time 265 synchronized with the server. This has to be accomplished before 266 broadcast associations can be used. For checking timeliness of 267 packets, NTS uses another, more rigorous check in addition to just 268 the clock lookup used in the TESLA protocol. For a more detailed 269 description of how NTS employs and customizes TESLA, see Appendix C. 271 6. Protocol Messages 273 This section describes the types of messages needed for secure time 274 synchronization with NTS. 276 For some guidance on how these message types can be realized in 277 practice, and integrated into the communication flow of existing time 278 synchronization protocols, see [I-D.ietf-ntp-cms-for-nts-message], a 279 companion document for NTS. Said document describes ASN.1 encodings 280 for those message parts that have to be added to a time 281 synchronization protocol for security reasons. 283 6.1. Unicast Time Synchronisation Messages 285 In this message exchange, the usual time synchronization process is 286 executed, with the addition of integrity protection for all messages 287 that the server sends. This message exchange can be repeatedly 288 performed as often as the client desires and as long as the integrity 289 of the server's time responses is verified successfully. 291 6.1.1. Preconditions for the Unicast Time Synchronization Exchange 293 Before this message exchange is available, there are some 294 requirements that the client and server need to meet: 296 o They MUST negotiate the hash algorithm for the MAC used in the 297 time synchronization messages. Authenticity and integrity of the 298 communication MUST be ensured. 300 o The client MUST know a key input value KIV. Authenticity and 301 integrity of the communication MUST be ensured. 303 o Client and server MUST exchange the cookie (which depends on the 304 KIV as described in section Section 5). Authenticity, 305 confidentiality and integrity of the communication MUST be 306 ensured. 308 One way of realising these requirements is to use the Association and 309 Cookie Message Exchanges described in Appendix B. 311 6.1.2. Goals of the Unicast Time Synchronization Exchange 313 The unicast time synchronization exchange: 315 o exchanges (unicast) time synchronization data as specified by the 316 appropriate time synchronization protocol, 318 o guarantees authenticity and integrity of the response to the 319 client, 321 o guarantees request-response-consistency to the client. 323 6.1.3. Message Type: "time_request" 325 This message is sent by the client when it requests a time exchange. 326 It contains 328 o the NTS message ID "time_request", 330 o the negotiated version number, 331 o a nonce, 333 o the negotiated hash algorithm H, 335 o the client's key input value (for which the client knows the 336 associated cookie). 338 6.1.4. Message Type: "time_response" 340 This message is sent by the server after it has received a 341 time_request message. Prior to this the server MUST recalculate the 342 client's cookie by using the received key input value and the 343 transmitted hash algorithm. The message contains 345 o the NTS message ID "time_response", 347 o the version number as transmitted in time_request, 349 o the server's time synchronization response data, 351 o the nonce transmitted in time_request, 353 o a MAC (generated with the cookie as key) for verification of all 354 of the above data. 356 6.1.5. Procedure Overview of the Unicast Time Synchronization Exchange 358 For a unicast time synchronization exchange, the following steps are 359 performed: 361 1. The client sends a time_request message to the server. The 362 client MUST save the included nonce and the transmit_timestamp 363 (from the time synchronization data) as a correlated pair for 364 later verification steps. 366 2. Upon receipt of a time_request message, the server re-calculates 367 the cookie, then computes the necessary time synchronization data 368 and constructs a time_response message as given in Section 6.1.4. 370 3. The client awaits a reply in the form of a time_response message. 371 Upon receipt, it checks: 373 * that the transmitted version number matches the one negotiated 374 previously, 376 * that the transmitted nonce belongs to a previous time_request 377 message, 379 * that the transmit_timestamp in that time_request message 380 matches the corresponding time stamp from the synchronization 381 data received in the time_response, and 383 * that the appended MAC verifies the received synchronization 384 data, version number and nonce. 386 If at least one of the first three checks fails (i.e. if the 387 version number does not match, if the client has never used the 388 nonce transmitted in the time_response message, or if it has used 389 the nonce with initial time synchronization data different from 390 that in the response), then the client MUST ignore this 391 time_response message. If the MAC is invalid, the client MUST do 392 one of the following: abort the run or send another cookie 393 request (because the cookie might have changed due to a server 394 seed refresh). If both checks are successful, the client SHOULD 395 continue time synchronization. 397 +-----------------------+ 398 | o Re-generate cookie | 399 | o Assemble response | 400 | o Generate MAC | 401 +-----------+-----------+ 402 | 403 <-+-> 405 Server -----------------------------------------------> 406 /| \ 407 time_ / \ time_ 408 request / \ response 409 / \| 410 Client -----------------------------------------------> 412 <------ Unicast time ------> <- Client-side -> 413 synchronization validity 414 exchange checks 416 Procedure for unicast time synchronization exchange. 418 6.2. Broadcast Time Synchronization Exchange 420 6.2.1. Preconditions for the Broadcast Time Synchronization Exchange 422 Before this message exchange is available, there are some 423 requirements that the client and server need to meet: 425 o The client MUST receive all the information necessary to process 426 broadcast time synchronization messages from the server. This 427 includes 429 * the one-way functions used for building the key chain, 431 * the last key of the key chain, 433 * time interval duration, 435 * the disclosure delay (number of intervals between use and 436 disclosure of a key), 438 * the time at which the next time interval will start, and 440 * the next interval's associated index. 442 o The communication of the data listed above MUST guarantee 443 authenticity of the server, as well as integrity and freshness of 444 the broadcast parameters to the client. 446 6.2.2. Goals of the Broadcast Time Synchronization Exchange 448 The broadcast time synchronization exchange: 450 o transmits (broadcast) time synchronization data from the server to 451 the client as specified by the appropriate time synchronization 452 protocol, 454 o guarantees to the client that the received synchronization data 455 has arrived in a timely manner as required by the TESLA protocol 456 and is trustworthy enough to be stored for later checks, 458 o additionally guarantees authenticity of a certain broadcast 459 synchronization message in the client's storage. 461 6.2.3. Message Type: "server_broad" 463 This message is sent by the server over the course of its broadcast 464 schedule. It is part of any broadcast association. It contains 466 o the NTS message ID "server_broad", 468 o the version number that the server is working under, 470 o time broadcast data, 471 o the index that belongs to the current interval (and therefore 472 identifies the current, yet undisclosed, key), 474 o the disclosed key of the previous disclosure interval (current 475 time interval minus disclosure delay), 477 o a MAC, calculated with the key for the current time interval, 478 verifying 480 * the message ID, 482 * the version number, and 484 * the time data. 486 6.2.4. Procedure Overview of Broadcast Time Synchronization Exchange 488 A broadcast time synchronization message exchange consists of the 489 following steps: 491 1. The server follows the TESLA protocol by regularly sending 492 server_broad messages as described in Section 6.2.3, adhering to 493 its own disclosure schedule. 495 2. The client awaits time synchronization data in the form of a 496 server_broadcast message. Upon receipt, it performs the 497 following checks: 499 * Proof that the MAC is based on a key that is not yet disclosed 500 (packet timeliness). This is achieved via a combination of 501 checks. First, the disclosure schedule is used, which 502 requires loose time synchronization. If this is successful, 503 the client obtains a stronger guarantee via a key check 504 exchange (see below). If its timeliness is verified, the 505 packet will be buffered for later authentication. Otherwise, 506 the client MUST discard it. Note that the time information 507 included in the packet will not be used for synchronization 508 until its authenticity could also be verified. 510 * The client checks that it does not already know the disclosed 511 key. Otherwise, the client SHOULD discard the packet to avoid 512 a buffer overrun. If this check is successful, the client 513 ensures that the disclosed key belongs to the one-way key 514 chain by applying the one-way function until equality with a 515 previous disclosed key is shown. If it is falsified, the 516 client MUST discard the packet. 518 * If the disclosed key is legitimate, then the client verifies 519 the authenticity of any packet that it has received during the 520 corresponding time interval. If authenticity of a packet is 521 verified, then it is released from the buffer and its time 522 information can be utilized. If the verification fails, then 523 authenticity is not given. In this case, the client MUST 524 request authentic time from the server by means other than 525 broadcast messages. Also, the client MUST re-initialize the 526 broadcast sequence with a "client_bpar" message if the one-way 527 key chain expires, which it can check via the disclosure 528 schedule. 530 See RFC 4082[RFC4082] for a detailed description of the packet 531 verification process. 533 Server ----------------------------------> 534 \ 535 \ server_ 536 \ broad 537 \| 538 Client ----------------------------------> 540 < Broadcast > <- Client-side -> 541 time sync. validity and 542 exchange timeliness 543 checks 545 Procedure for broadcast time synchronization exchange. 547 6.3. Broadcast Keycheck 549 This message exchange is performed for an additional check of packet 550 timeliness in the course of the TESLA scheme, see Appendix C. 552 6.3.1. Preconditions for the Broadcast Keycheck Exchange 554 Before this message exchange is available, there are some 555 requirements that the client and server need to meet: 557 o They MUST negotiate the hash algorithm for the MAC used in the 558 time synchronization messages. Authenticity and integrity of the 559 communication MUST be ensured. 561 o The client MUST know a key input value KIV. Authenticity and 562 integrity of the communication MUST be ensured. 564 o Client and server MUST exchange the cookie (which depends on the 565 KIV as described in section Section 5). Authenticity, 566 confidentiality and integrity of the communication MUST be 567 ensured. 569 These requirements conform to those for the unicast time 570 synchronization exchange. Accordingly, they too can be realised via 571 the Association and Cookie Message Exchanges described in Appendix B 572 (Appendix B). 574 6.3.2. Goals of the Broadcast Keycheck Exchange 576 The keycheck exchange: 578 o guarantees to the client that the key belonging to the respective 579 TESLA interval communicated in the exchange had not been disclosed 580 before the client_keycheck message was sent. 582 o guarantees to the client the timeliness of any broadcast packet 583 secured with this key if it arrived before client_keycheck was 584 sent. 586 6.3.3. Message Type: "client_keycheck" 588 A message of this type is sent by the client in order to initiate an 589 additional check of packet timeliness for the TESLA scheme. It 590 contains 592 o the NTS message ID "client_keycheck", 594 o the NTS version number negotiated during association, 596 o a nonce, 598 o an interval number from the TESLA disclosure schedule, 600 o the hash algorithm H negotiated during association, and 602 o the client's key input value KIV. 604 6.3.4. Message Type: "server_keycheck" 606 A message of this type is sent by the server upon receipt of a 607 client_keycheck message during the broadcast loop of the server. 608 Prior to this, the server MUST recalculate the client's cookie by 609 using the received key input value and the transmitted hash 610 algorithm. It contains 612 o the NTS message ID "server_keycheck" 613 o the version number as transmitted in "client_keycheck, 615 o the nonce transmitted in the client_keycheck message, 617 o the interval number transmitted in the client_keycheck message, 618 and 620 o a MAC (generated with the cookie as key) for verification of all 621 of the above data. 623 6.3.5. Procedure Overview of the Broadcast Keycheck Exchange 625 A broadcast keycheck message exchange consists of the following 626 steps: 628 1. The client sends a client_keycheck message. It MUST memorize the 629 nonce and the time interval number that it sends as a correlated 630 pair. 632 2. Upon receipt of a client_keycheck message, the server looks up 633 whether it has already disclosed the key associated with the 634 interval number transmitted in that message. If it has not 635 disclosed it, it constructs and sends the appropriate 636 server_keycheck message as described in Section 6.3.4. For more 637 details, see also Appendix C. 639 3. The client awaits a reply in the form of a server_keycheck 640 message. On receipt, it performs the following checks: 642 * that the transmitted version number matches the one negotiated 643 previously, 645 * that the transmitted nonce belongs to a previous 646 client_keycheck message, 648 * that the TESLA interval number in that client_keycheck message 649 matches the corresponding interval number from the 650 server_keycheck, and 652 * that the appended MAC verifies the received data. 654 +----------------------+ 655 | o Assemble response | 656 | o Re-generate cookie | 657 | o Generate MAC | 658 +-----------+----------+ 659 | 660 <-+-> 661 Server ---------------------------------------------> 662 \ /| \ 663 \ server_ client_ / \ server_ 664 \ broad keycheck / \ keycheck 665 \| / \| 666 Client ---------------------------------------------> 667 <-------- Extended broadcast time -------> 668 synchronization exchange 670 <---- Keycheck exchange ---> 672 Procedure for extended broadcast time synchronization exchange. 674 7. Server Seed Considerations 676 The server has to calculate a random seed which has to be kept 677 secret. The server MUST generate a seed for each supported hash 678 algorithm, see Section 8.1. 680 According to the requirements in [RFC7384], the server MUST refresh 681 each server seed periodically. Consequently, the cookie memorized by 682 the client becomes obsolete. In this case, the client cannot verify 683 the MAC attached to subsequent time response messages and has to 684 respond accordingly by re-initiating the protocol with a cookie 685 request (Appendix B.3). 687 8. Hash Algorithms and MAC Generation 689 8.1. Hash Algorithms 691 Hash algorithms are used for calculation of the cookie and the MAC. 692 The client and the server negotiate a hash algorithm H during the 693 association phase at the beginning. The selected algorithm H is used 694 for all hashing processes in that run. 696 In the TESLA scheme, hash algorithms are used as pseudo-random 697 functions to construct the one-way key chain. Here, the utilized 698 hash algorithm is communicated by the server and is non-negotiable. 700 Note: 702 Any hash algorithm is prone to be compromised in the future. A 703 successful attack on a hash algorithm would enable any NTS client 704 to derive the server seed from its own cookie. Therefore, the 705 server MUST have separate seed values for its different supported 706 hash algorithms. This way, knowledge gained from an attack on a 707 hash algorithm H can at least only be used to compromise such 708 clients who use hash algorithm H as well. 710 8.2. MAC Calculation 712 For the calculation of the MAC, client and server use a Keyed-Hash 713 Message Authentication Code (HMAC) approach [RFC2104]. The HMAC is 714 generated with the hash algorithm specified by the client (see 715 Section 8.1). 717 9. IANA Considerations 719 10. Security Considerations 721 10.1. Privacy 723 The payload of time synchronization protocol packets of two-way time 724 transfer approaches like NTP and PTP consists basically of time 725 stamps, which are not considered secret [RFC7384]. Therefore, 726 encryption of the time synchronization protocol packet's payload is 727 not considered in this document. However, an attacker can exploit 728 the exchange of time synchronization protocol packets for topology 729 detection and inference attacks as described in [RFC7624]. To make 730 such attacks more difficult, that draft recommends the encryption of 731 the packet payload. Yet, in the case of time synchronization 732 protocols the confidentiality protection of time synchronization 733 packet's payload is of secondary importance since the packet's meta 734 data (IP addresses, port numbers, possibly packet size and regular 735 sending intervals) carry more information than the payload. To 736 enhance the privacy of the time synchronization partners, the usage 737 of tunnel protocols such as IPsec and MACsec, where applicable, is 738 therefore more suited than confidentiality protection of the payload. 740 10.2. Initial Verification of the Server Certificates 742 The client may wish to verify the validity of certificates during the 743 initial association phase. Since it generally has no reliable time 744 during this initial communication phase, it is impossible to verify 745 the period of validity of the certificates. To solve this chicken- 746 and-egg problem, the client has to rely on external means. 748 10.3. Revocation of Server Certificates 750 According to Section 7, it is the client's responsibility to initiate 751 a new association with the server after the server's certificate 752 expires. To this end, the client reads the expiration date of the 753 certificate during the certificate message exchange (Appendix B.2.3). 754 Furthermore, certificates may also be revoked prior to the normal 755 expiration date. To increase security the client MAY periodically 756 verify the state of the server's certificate via Online Certificate 757 Status Protocol (OCSP) Online Certificate Status Protocol (OCSP) 758 [RFC6960]. 760 10.4. Mitigating Denial-of-Service for broadcast packets 762 TESLA authentication buffers packets for delayed authentication. 763 This makes the protocol vulnerable to flooding attacks, causing the 764 client to buffer excessive numbers of packets. To add stronger DoS 765 protection to the protocol, the client and the server use the "not 766 re-using keys" scheme of TESLA as pointed out in Section 3.7.2 of RFC 767 4082 [RFC4082]. In this scheme the server never uses a key for the 768 MAC generation more than once. Therefore, the client can discard any 769 packet that contains a disclosed key it already knows, thus 770 preventing memory flooding attacks. 772 Discussion: Note that an alternative approach to enhance TESLA's 773 resistance against DoS attacks involves the addition of a group 774 MAC to each packet. This requires the exchange of an additional 775 shared key common to the whole group. This adds additional 776 complexity to the protocol and hence is currently not considered 777 in this document. 779 10.5. Delay Attack 781 In a packet delay attack, an adversary with the ability to act as a 782 MITM delays time synchronization packets between client and server 783 asymmetrically [RFC7384]. This prevents the client from accurately 784 measuring the network delay, and hence its time offset to the server 785 [Mizrahi]. The delay attack does not modify the content of the 786 exchanged synchronization packets. Therefore, cryptographic means do 787 not provide a feasible way to mitigate this attack. However, several 788 non-cryptographic precautions can be taken in order to detect this 789 attack. 791 1. Usage of multiple time servers: this enables the client to detect 792 the attack, provided that the adversary is unable to delay the 793 synchronization packets between the majority of servers. This 794 approach is commonly used in NTP to exclude incorrect time 795 servers [RFC5905]. 797 2. Multiple communication paths: The client and server utilize 798 different paths for packet exchange as described in the I-D 799 [I-D.ietf-tictoc-multi-path-synchronization]. The client can 800 detect the attack, provided that the adversary is unable to 801 manipulate the majority of the available paths [Shpiner]. Note 802 that this approach is not yet available, neither for NTP nor for 803 PTP. 805 3. Usage of an encrypted connection: the client exchanges all 806 packets with the time server over an encrypted connection (e.g. 807 IPsec). This measure does not mitigate the delay attack, but it 808 makes it more difficult for the adversary to identify the time 809 synchronization packets. 811 4. For unicast-type messages: Introduction of a threshold value for 812 the delay time of the synchronization packets. The client can 813 discard a time server if the packet delay time of this time 814 server is larger than the threshold value. 816 Additional provision against delay attacks has to be taken for 817 broadcast-type messages. This mode relies on the TESLA scheme which 818 is based on the requirement that a client and the broadcast server 819 are loosely time synchronized. Therefore, a broadcast client has to 820 establish time synchronization with its broadcast server before it 821 starts utilizing broadcast messages for time synchronization. 823 One possible way to achieve this initial synchronization is to 824 establish a unicast association with its broadcast server until time 825 synchronization and calibration of the packet delay time is achieved. 826 After that, the client can establish a broadcast association with the 827 broadcast server and utilizes TESLA to verify integrity and 828 authenticity of any received broadcast packets. 830 An adversary who is able to delay broadcast packets can cause a time 831 adjustment at the receiving broadcast clients. If the adversary 832 delays broadcast packets continuously, then the time adjustment will 833 accumulate until the loose time synchronization requirement is 834 violated, which breaks the TESLA scheme. To mitigate this 835 vulnerability the security condition in TESLA has to be supplemented 836 by an additional check in which the client, upon receipt of a 837 broadcast message, verifies the status of the corresponding key via a 838 unicast message exchange with the broadcast server (see Appendix C.4 839 for a detailed description of this check). Note that a broadcast 840 client should also apply the above-mentioned precautions as far as 841 possible. 843 10.6. Random Number Generation 845 At various points of the protocol, the generation of random numbers 846 is required. The employed methods of generation need to be 847 cryptographically secure. See [RFC4086] for guidelines concerning 848 this topic. 850 11. Acknowledgements 852 The authors would like to thank Tal Mizrahi, Russ Housley, Steven 853 Bellovin, David Mills, Kurt Roeckx, Rainer Bermbach, Martin Langer 854 and Florian Weimer for discussions and comments on the design of NTS. 855 Also, thanks go to Harlan Stenn for his technical review and specific 856 text contributions to this document. 858 12. References 860 12.1. Normative References 862 [RFC2104] Krawczyk, H., Bellare, M., and R. Canetti, "HMAC: Keyed- 863 Hashing for Message Authentication", RFC 2104, DOI 864 10.17487/RFC2104, February 1997, 865 . 867 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 868 Requirement Levels", BCP 14, RFC 2119, DOI 10.17487/ 869 RFC2119, March 1997, 870 . 872 [RFC4082] Perrig, A., Song, D., Canetti, R., Tygar, J., and B. 873 Briscoe, "Timed Efficient Stream Loss-Tolerant 874 Authentication (TESLA): Multicast Source Authentication 875 Transform Introduction", RFC 4082, DOI 10.17487/RFC4082, 876 June 2005, . 878 [RFC7384] Mizrahi, T., "Security Requirements of Time Protocols in 879 Packet Switched Networks", RFC 7384, DOI 10.17487/RFC7384, 880 October 2014, . 882 12.2. Informative References 884 [I-D.ietf-ntp-cms-for-nts-message] 885 Sibold, D., Teichel, K., Roettger, S., and R. Housley, 886 "Protecting Network Time Security Messages with the 887 Cryptographic Message Syntax (CMS)", draft-ietf-ntp-cms- 888 for-nts-message-04 (work in progress), July 2015. 890 [I-D.ietf-tictoc-multi-path-synchronization] 891 Shpiner, A., Tse, R., Schelp, C., and T. Mizrahi, "Multi- 892 Path Time Synchronization", draft-ietf-tictoc-multi-path- 893 synchronization-02 (work in progress), April 2015. 895 [IEEE1588] 896 IEEE Instrumentation and Measurement Society. TC-9 Sensor 897 Technology, "IEEE standard for a precision clock 898 synchronization protocol for networked measurement and 899 control systems", 2008. 901 [Mizrahi] Mizrahi, T., "A game theoretic analysis of delay attacks 902 against time synchronization protocols", in Proceedings of 903 Precision Clock Synchronization for Measurement Control 904 and Communication, ISPCS 2012, pp. 1-6, September 2012. 906 [RFC4086] Eastlake 3rd, D., Schiller, J., and S. Crocker, 907 "Randomness Requirements for Security", BCP 106, RFC 4086, 908 DOI 10.17487/RFC4086, June 2005, 909 . 911 [RFC5905] Mills, D., Martin, J., Ed., Burbank, J., and W. Kasch, 912 "Network Time Protocol Version 4: Protocol and Algorithms 913 Specification", RFC 5905, DOI 10.17487/RFC5905, June 2010, 914 . 916 [RFC6960] Santesson, S., Myers, M., Ankney, R., Malpani, A., 917 Galperin, S., and C. Adams, "X.509 Internet Public Key 918 Infrastructure Online Certificate Status Protocol - OCSP", 919 RFC 6960, DOI 10.17487/RFC6960, June 2013, 920 . 922 [RFC7624] Barnes, R., Schneier, B., Jennings, C., Hardie, T., 923 Trammell, B., Huitema, C., and D. Borkmann, 924 "Confidentiality in the Face of Pervasive Surveillance: A 925 Threat Model and Problem Statement", RFC 7624, DOI 926 10.17487/RFC7624, August 2015, 927 . 929 [Shpiner] Shpiner, A., Revah, Y., and T. Mizrahi, "Multi-path Time 930 Protocols", in Proceedings of Precision Clock 931 Synchronization for Measurement Control and Communication, 932 ISPCS 2013, pp. 1-6, September 2013. 934 Appendix A. (informative) TICTOC Security Requirements 936 The following table compares the NTS specifications against the 937 TICTOC security requirements [RFC7384]. 939 +---------+------------------------------+-------------+------------+ 940 | Section | Requirement from RFC 7384 | Requirement | NTS | 941 | | | level | | 942 +---------+------------------------------+-------------+------------+ 943 | 5.1.1 | Authentication of Servers | MUST | OK | 944 +---------+------------------------------+-------------+------------+ 945 | 5.1.1 | Authorization of Servers | MUST | OK | 946 +---------+------------------------------+-------------+------------+ 947 | 5.1.2 | Recursive Authentication of | MUST | OK | 948 | | Servers (Stratum 1) | | | 949 +---------+------------------------------+-------------+------------+ 950 | 5.1.2 | Recursive Authorization of | MUST | OK | 951 | | Servers (Stratum 1) | | | 952 +---------+------------------------------+-------------+------------+ 953 | 5.1.3 | Authentication and | MAY | Optional, | 954 | | Authorization of Clients | | Limited | 955 +---------+------------------------------+-------------+------------+ 956 | 5.2 | Integrity protection | MUST | OK | 957 +---------+------------------------------+-------------+------------+ 958 | 5.3 | Spoofing Prevention | MUST | OK | 959 +---------+------------------------------+-------------+------------+ 960 | 5.4 | Protection from DoS attacks | SHOULD | OK | 961 | | against the time protocol | | | 962 +---------+------------------------------+-------------+------------+ 963 | 5.5 | Replay protection | MUST | OK | 964 +---------+------------------------------+-------------+------------+ 965 | 5.6 | Key freshness | MUST | OK | 966 +---------+------------------------------+-------------+------------+ 967 | | Security association | SHOULD | OK | 968 +---------+------------------------------+-------------+------------+ 969 | | Unicast and multicast | SHOULD | OK | 970 | | associations | | | 971 +---------+------------------------------+-------------+------------+ 972 | 5.7 | Performance: no degradation | MUST | OK | 973 | | in quality of time transfer | | | 974 +---------+------------------------------+-------------+------------+ 975 | | Performance: lightweight | SHOULD | OK | 976 | | computation | | | 977 +---------+------------------------------+-------------+------------+ 978 | | Performance: storage | SHOULD | OK | 979 +---------+------------------------------+-------------+------------+ 980 | | Performance: bandwidth | SHOULD | OK | 981 +---------+------------------------------+-------------+------------+ 982 | 5.8 | Confidentiality protection | MAY | NO | 983 +---------+------------------------------+-------------+------------+ 984 | 5.9 | Protection against Packet | MUST | Limited*) | 985 | | Delay and Interception | | | 986 | | Attacks | | | 987 +---------+------------------------------+-------------+------------+ 988 | 5.10 | Secure mode | MUST | OK | 989 +---------+------------------------------+-------------+------------+ 990 | | Hybrid mode | SHOULD | - | 991 +---------+------------------------------+-------------+------------+ 993 *) See discussion in Section 10.5. 995 Comparison of NTS specification against Security Requirements of Time 996 Protocols in Packet Switched Networks (RFC 7384) 998 Appendix B. (normative) Inherent Association Protocol Messages 1000 One option for completing association, cookie exchange, and also 1001 broadcast parameter exchange between a client and server is to use 1002 the message exchanges listed below. 1004 B.1. Overview of NTS with Inherent Association Protocol 1006 This inherent association protocol applies X.509 certificates to 1007 verify the authenticity of the time server and to exchange the 1008 cookie. This is done in two separate message exchanges, described 1009 below. A client needs a public/private key pair for encryption, with 1010 the public key enclosed in a certificate. A server needs a public/ 1011 private key pair for signing, with the public key enclosed in a 1012 certificate. If a participant intends to act as both a client and a 1013 server, it MUST have two different key pairs for these purposes. 1015 If this protocol is employed, the hash value of the client's 1016 certificate is used as the client's key input value, i.e. the cookie 1017 is calculated according to: 1019 cookie = MSB_ (HMAC(server seed, H(certificate of client))). 1021 The client's certificate contains the client's public key and enables 1022 the server to identify the client, if client authorization is 1023 desired. 1025 B.2. Association Message Exchange 1027 In this message exchange, the participants negotiate the hash and 1028 encryption algorithms that are used throughout the protocol. In 1029 addition, the client receives the certification chain up to a trusted 1030 anchor. With the established certification chain the client is able 1031 to verify the server's signatures and, hence, the authenticity of 1032 future NTS messages from the server is ensured. 1034 B.2.1. Goals of the Association Exchange 1036 The association exchange: 1038 o enables the client to verify any communication with the server as 1039 authentic, 1041 o lets the participants negotiate NTS version and algorithms, 1043 o guarantees authenticity and integrity of the negotiation result to 1044 the client, 1046 o guarantees to the client that the negotiation result is based on 1047 the client's original, unaltered request. 1049 B.2.2. Message Type: "client_assoc" 1051 The protocol sequence starts with the client sending an association 1052 message, called client_assoc. This message contains 1054 o the NTS message ID "client_assoc", 1056 o a nonce, 1058 o the version number of NTS that the client wants to use (this 1059 SHOULD be the highest version number that it supports), 1061 o a selection of accepted hash algorithms, and 1063 o a selection of accepted encryption algorithms. 1065 B.2.3. Message Type: "server_assoc" 1067 This message is sent by the server upon receipt of client_assoc. It 1068 contains 1070 o the NTS message ID "server_assoc", 1072 o the nonce transmitted in client_assoc, 1074 o the client's proposal for the version number, selection of 1075 accepted hash algorithms and selection of accepted encryption 1076 algorithms, as transmitted in client_assoc, 1078 o the version number used for the rest of the protocol (which SHOULD 1079 be determined as the minimum over the client's suggestion in the 1080 client_assoc message and the highest supported by the server), 1082 o the server's choice of algorithm for encryption and for 1083 cryptographic hashing, all of which MUST be chosen from the 1084 client's proposals, 1086 o a signature, calculated over the data listed above, with the 1087 server's private key and according to the signature algorithm 1088 which is also used for the certificates that are included (see 1089 below), and 1091 o a chain of certificates, which starts at the server and goes up to 1092 a trusted authority; each certificate MUST be certified by the one 1093 directly following it. 1095 B.2.4. Procedure Overview of the Association Exchange 1097 For an association exchange, the following steps are performed: 1099 1. The client sends a client_assoc message to the server. It MUST 1100 keep the transmitted values for the version number and algorithms 1101 available for later checks. 1103 2. Upon receipt of a client_assoc message, the server constructs and 1104 sends a reply in the form of a server_assoc message as described 1105 in Appendix B.2.3. Upon unsuccessful negotiation for version 1106 number or algorithms the server_assoc message MUST contain an 1107 error code. 1109 3. The client waits for a reply in the form of a server_assoc 1110 message. After receipt of the message it performs the following 1111 checks: 1113 * The client checks that the message contains a conforming 1114 version number. 1116 * It checks that the nonce sent back by the server matches the 1117 one transmitted in client_assoc, 1119 * It also verifies that the server has chosen the encryption and 1120 hash algorithms from its proposal sent in the client_assoc 1121 message and that this proposal was not altered. 1123 * Furthermore, it performs authenticity checks on the 1124 certificate chain and the signature. 1126 If one of the checks fails, the client MUST abort the run. 1128 +------------------------+ 1129 | o Choose version | 1130 | o Choose algorithms | 1131 | o Acquire certificates | 1132 | o Assemble response | 1133 | o Create signature | 1134 +-----------+------------+ 1135 | 1136 <-+-> 1138 Server ---------------------------> 1139 /| \ 1140 client_ / \ server_ 1141 assoc / \ assoc 1142 / \| 1143 Client ---------------------------> 1145 <------ Association -----> 1146 exchange 1148 Procedure for association and cookie exchange. 1150 B.3. Cookie Messages 1152 During this message exchange, the server transmits a secret cookie to 1153 the client securely. The cookie will later be used for integrity 1154 protection during unicast time synchronization. 1156 B.3.1. Goals of the Cookie Exchange 1158 The cookie exchange: 1160 o enables the server to check the client's authorization via its 1161 certificate (optional), 1163 o supplies the client with the correct cookie and corresponding KIV 1164 for its association to the server, 1166 o guarantees to the client that the cookie originates from the 1167 server and that it is based on the client's original, unaltered 1168 request. 1170 o guarantees that the received cookie is unknown to anyone but the 1171 server and the client. 1173 B.3.2. Message Type: "client_cook" 1175 This message is sent by the client upon successful authentication of 1176 the server. In this message, the client requests a cookie from the 1177 server. The message contains 1179 o the NTS message ID "client_cook", 1181 o a nonce, 1183 o the negotiated version number, 1185 o the negotiated signature algorithm, 1187 o the negotiated encryption algorithm, 1189 o the negotiated hash algorithm H, 1191 o the client's certificate. 1193 B.3.3. Message Type: "server_cook" 1195 This message is sent by the server upon receipt of a client_cook 1196 message. The server generates the hash of the client's certificate, 1197 as conveyed during client_cook, in order to calculate the cookie 1198 according to Section 5. This message contains 1200 o the NTS message ID "server_cook" 1202 o the version number as transmitted in client_cook, 1204 o a concatenated datum which is encrypted with the client's public 1205 key, according to the encryption algorithm transmitted in the 1206 client_cook message. The concatenated datum contains 1208 * the nonce transmitted in client_cook, and 1210 * the cookie. 1212 o a signature, created with the server's private key, calculated 1213 over all of the data listed above. This signature MUST be 1214 calculated according to the transmitted signature algorithm from 1215 the client_cook message. 1217 B.3.4. Procedure Overview of the Cookie Exchange 1219 For a cookie exchange, the following steps are performed: 1221 1. The client sends a client_cook message to the server. The client 1222 MUST save the included nonce until the reply has been processed. 1224 2. Upon receipt of a client_cook message, the server checks whether 1225 it supports the given cryptographic algorithms. It then 1226 calculates the cookie according to the formula given in 1227 Section 5. The server MAY use the client's certificate to check 1228 that the client is authorized to use the secure time 1229 synchronization service. With this, it MUST construct a 1230 server_cook message as described in Appendix B.3.3. 1232 3. The client awaits a reply in the form of a server_cook message; 1233 upon receipt it executes the following actions: 1235 * It verifies that the received version number matches the one 1236 negotiated beforehand. 1238 * It verifies the signature using the server's public key. The 1239 signature has to authenticate the encrypted data. 1241 * It decrypts the encrypted data with its own private key. 1243 * It checks that the decrypted message is of the expected 1244 format: the concatenation of a nonce and a cookie of the 1245 expected bit lengths. 1247 * It verifies that the received nonce matches the nonce sent in 1248 the client_cook message. 1250 If one of those checks fails, the client MUST abort the run. 1252 +----------------------------+ 1253 | o OPTIONAL: Check client's | 1254 | authorization | 1255 | o Generate cookie | 1256 | o Encrypt inner message | 1257 | o Generate signature | 1258 +-------------+--------------+ 1259 | 1260 <-+-> 1262 Server ---------------------------> 1263 /| \ 1264 client_ / \ server_ 1265 cook / \ cook 1266 / \| 1267 Client ---------------------------> 1269 <--- Cookie exchange --> 1271 Procedure for association and cookie exchange. 1273 B.3.5. Broadcast Parameter Messages 1275 In this message exchange, the client receives the necessary 1276 information to execute the TESLA protocol in a secured broadcast 1277 association. The client can only initiate a secure broadcast 1278 association after successful association and cookie exchanges and 1279 only if it has made sure that its clock is roughly synchronized to 1280 the server's. 1282 See Appendix C for more details on TESLA. 1284 B.3.5.1. Goals of the Broadcast Parameter Exchange 1286 The broadcast parameter exchange 1288 o provides the client with all the information necessary to process 1289 broadcast time synchronization messages from the server, and 1291 o guarantees authenticity, integrity and freshness of the broadcast 1292 parameters to the client. 1294 B.3.5.2. Message Type: "client_bpar" 1296 This message is sent by the client in order to establish a secured 1297 time broadcast association with the server. It contains 1299 o the NTS message ID "client_bpar", 1300 o the NTS version number negotiated during association, 1302 o a nonce, and 1304 o the signature algorithm negotiated during association. 1306 B.3.5.3. Message Type: "server_bpar" 1308 This message is sent by the server upon receipt of a client_bpar 1309 message during the broadcast loop of the server. It contains 1311 o the NTS message ID "server_bpar", 1313 o the version number as transmitted in the client_bpar message, 1315 o the nonce transmitted in client_bpar, 1317 o the one-way functions used for building the key chain, and 1319 o the disclosure schedule of the keys. This contains: 1321 * the last key of the key chain, 1323 * time interval duration, 1325 * the disclosure delay (number of intervals between use and 1326 disclosure of a key), 1328 * the time at which the next time interval will start, and 1330 * the next interval's associated index. 1332 o The message also contains a signature signed by the server with 1333 its private key, verifying all the data listed above. 1335 B.3.5.4. Procedure Overview of the Broadcast Parameter Exchange 1337 A broadcast parameter exchange consists of the following steps: 1339 1. The client sends a client_bpar message to the server. It MUST 1340 remember the transmitted values for the nonce, the version number 1341 and the signature algorithm. 1343 2. Upon receipt of a client_bpar message, the server constructs and 1344 sends a server_bpar message as described in Appendix B.3.5.3. 1346 3. The client waits for a reply in the form of a server_bpar 1347 message, on which it performs the following checks: 1349 * The message must contain all the necessary information for the 1350 TESLA protocol, as listed in Appendix B.3.5.3. 1352 * The message must contain a nonce belonging to a client_bpar 1353 message that the client has previously sent. 1355 * Verification of the message's signature. 1357 If any information is missing or if the server's signature cannot 1358 be verified, the client MUST abort the broadcast run. If all 1359 checks are successful, the client MUST remember all the broadcast 1360 parameters received for later checks. 1362 +---------------------+ 1363 | o Assemble response | 1364 | o Create public-key | 1365 | signature | 1366 +----------+----------+ 1367 | 1368 <-+-> 1370 Server ---------------------------------------------> 1371 /| \ 1372 client_ / \ server_ 1373 bpar / \ bpar 1374 / \| 1375 Client ---------------------------------------------> 1377 <------- Broadcast ------> <- Client-side -> 1378 parameter validity 1379 exchange checks 1381 Procedure for unicast time synchronization exchange. 1383 Appendix C. (normative) Using TESLA for Broadcast-Type Messages 1385 For broadcast-type messages, NTS adopts the TESLA protocol with some 1386 customizations. This appendix provides details on the generation and 1387 usage of the one-way key chain collected and assembled from 1388 [RFC4082]. Note that NTS uses the "not re-using keys" scheme of 1389 TESLA as described in Section 3.7.2. of [RFC4082]. 1391 C.1. Server Preparation 1393 Server setup: 1395 1. The server determines a reasonable upper bound B on the network 1396 delay between itself and an arbitrary client, measured in 1397 milliseconds. 1399 2. It determines the number n+1 of keys in the one-way key chain. 1400 This yields the number n of keys that are usable to authenticate 1401 broadcast packets. This number n is therefore also the number of 1402 time intervals during which the server can send authenticated 1403 broadcast messages before it has to calculate a new key chain. 1405 3. It divides time into n uniform intervals I_1, I_2, ..., I_n. 1406 Each of these time intervals has length L, measured in 1407 milliseconds. In order to fulfill the requirement 3.7.2. of RFC 1408 4082, the time interval L has to be shorter than the time 1409 interval between the broadcast messages. 1411 4. The server generates a random key K_n. 1413 5. Using a one-way function F, the server generates a one-way chain 1414 of n+1 keys K_0, K_1, ..., K_{n} according to 1416 K_i = F(K_{i+1}). 1418 6. Using another one-way function F', it generates a sequence of n 1419 MAC keys K'_0, K'_1, ..., K'_{n-1} according to 1421 K'_i = F'(K_i). 1423 7. Each MAC key K'_i is assigned to the time interval I_i. 1425 8. The server determines the key disclosure delay d, which is the 1426 number of intervals between using a key and disclosing it. Note 1427 that although security is provided for all choices d>0, the 1428 choice still makes a difference: 1430 * If d is chosen too short, the client might discard packets 1431 because it fails to verify that the key used for its MAC has 1432 not yet been disclosed. 1434 * If d is chosen too long, the received packets have to be 1435 buffered for an unnecessarily long time before they can be 1436 verified by the client and be subsequently utilized for time 1437 synchronization. 1439 It is RECOMMENDED that the server calculate d according to 1441 d = ceil( 2*B / L) + 1, 1443 where ceil yields the smallest integer greater than or equal to 1444 its argument. 1446 < - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1447 Generation of Keys 1449 F F F F 1450 K_0 <-------- K_1 <-------- ... <-------- K_{n-1} <------- K_n 1451 | | | | 1452 | | | | 1453 | F' | F' | F' | F' 1454 | | | | 1455 v v v v 1456 K'_0 K'_1 ... K'_{n-1} K'_n 1457 [______________|____ ____|_________________|_______] 1458 I_1 ... I_{n-1} I_n 1460 Course of Time/Usage of Keys 1461 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -> 1463 A schematic explanation of the TESLA protocol's one-way key chain 1465 C.2. Client Preparation 1467 A client needs the following information in order to participate in a 1468 TESLA broadcast: 1470 o One key K_i from the one-way key chain, which has to be 1471 authenticated as belonging to the server. Typically, this will be 1472 K_0. 1474 o The disclosure schedule of the keys. This consists of: 1476 * the length n of the one-way key chain, 1478 * the length L of the time intervals I_1, I_2, ..., I_n, 1480 * the starting time T_i of an interval I_i. Typically this is 1481 the starting time T_1 of the first interval; 1483 * the disclosure delay d. 1485 o The one-way function F used to recursively derive the keys in the 1486 one-way key chain, 1488 o The second one-way function F' used to derive the MAC keys K'_0, 1489 K'_1, ... , K'_n from the keys in the one-way chain. 1491 o An upper bound D_t on how far its own clock is "behind" that of 1492 the server. 1494 Note that if D_t is greater than (d - 1) * L, then some authentic 1495 packets might be discarded. If D_t is greater than d * L, then all 1496 authentic packets will be discarded. In the latter case, the client 1497 SHOULD NOT participate in the broadcast, since there will be no 1498 benefit in doing so. 1500 C.3. Sending Authenticated Broadcast Packets 1502 During each time interval I_i, the server sends at most one 1503 authenticated broadcast packet P_i. Such a packet consists of: 1505 o a message M_i, 1507 o the index i (in case a packet arrives late), 1509 o a MAC authenticating the message M_i, with K'_i used as key, 1511 o the key K_{i-d}, which is included for disclosure. 1513 C.4. Authentication of Received Packets 1515 When a client receives a packet P_i as described above, it first 1516 checks that it has not already received a packet with the same 1517 disclosed key. This is done to avoid replay/flooding attacks. A 1518 packet that fails this test is discarded. 1520 Next, the client begins to check the packet's timeliness by ensuring 1521 that according to the disclosure schedule and with respect to the 1522 upper bound D_t determined above, the server cannot have disclosed 1523 the key K_i yet. Specifically, it needs to check that the server's 1524 clock cannot read a time that is in time interval I_{i+d} or later. 1525 Since it works under the assumption that the server's clock is not 1526 more than D_t "ahead" of the client's clock, the client can calculate 1527 an upper bound t_i for the server's clock at the time when P_i 1528 arrived. This upper bound t_i is calculated according to 1530 t_i = R + D_t, 1532 where R is the client's clock at the arrival of P_i. This implies 1533 that at the time of arrival of P_i, the server could have been in 1534 interval I_x at most, with 1536 x = floor((t_i - T_1) / L) + 1, 1538 where floor gives the greatest integer less than or equal to its 1539 argument. The client now needs to verify that 1541 x < i+d 1543 is valid (see also Section 3.5 of [RFC4082]). If it is falsified, it 1544 is discarded. 1546 If the check above is successful, the client performs another more 1547 rigorous check: it sends a key check request to the server (in the 1548 form of a client_keycheck message), asking explicitly if K_i has 1549 already been disclosed. It remembers the time stamp t_check of the 1550 sending time of that request as well as the nonce it used correlated 1551 with the interval number i. If it receives an answer from the server 1552 stating that K_i has not yet been disclosed and it is able to verify 1553 the HMAC on that response, then it deduces that K_i was undisclosed 1554 at t_check and therefore also at R. In this case, the client accepts 1555 P_i as timely. 1557 Next the client verifies that a newly disclosed key K_{i-d} belongs 1558 to the one-way key chain. To this end, it applies the one-way 1559 function F to K_{i-d} until it can verify the identity with an 1560 earlier disclosed key (see Clause 3.5 in RFC 4082, item 3). 1562 Next the client verifies that the transmitted time value s_i belongs 1563 to the time interval I_i, by checking 1565 T_i =< s_i, and 1567 s_i < T_{i+1}. 1569 If it is falsified, the packet MUST be discarded and the client MUST 1570 reinitialize its broadcast module by performing time synchronization 1571 by other means than broadcast messages, and it MUST perform a new 1572 broadcast parameter exchange (because a falsification of this check 1573 yields that the packet was not generated according to protocol, which 1574 suggests an attack). 1576 If a packet P_i passes all the tests listed above, it is stored for 1577 later authentication. Also, if at this time there is a package with 1578 index i-d already buffered, then the client uses the disclosed key 1579 K_{i-d} to derive K'_{i-d} and uses that to check the MAC included in 1580 package P_{i-d}. Upon success, it regards M_{i-d} as authenticated. 1582 Appendix D. (informative) Dependencies 1584 +---------+--------------+--------+-------------------------------+ 1585 | Issuer | Type | Owner | Description | 1586 +---------+--------------+--------+-------------------------------+ 1587 | Server | private key | server | Used for server_assoc, | 1588 | PKI | (signature) | | server_cook, server_bpar. | 1589 | +--------------+--------+ The server uses the private | 1590 | | public key | client | key to sign these messages. | 1591 | | (signature) | | The client uses the public | 1592 | +--------------+--------+ key to verify them. | 1593 | | certificate | server | The certificate is used in | 1594 | | | | server_assoc messages, for | 1595 | | | | verifying authentication and | 1596 | | | | (optionally) authorization. | 1597 +---------+--------------+--------+-------------------------------+ 1598 | Client | private key | client | The server uses the client's | 1599 | PKI | (encryption) | | public key to encrypt the | 1600 | +--------------+--------+ content of server_cook | 1601 | | public key | server | messages. The client uses | 1602 | | (encryption) | | the private key to decrypt | 1603 | +--------------+--------+ them. The certificate is | 1604 | | certificate | client | sent in client_cook messages, | 1605 | | | | where it is used for trans- | 1606 | | | | portation of the public key | 1607 | | | | as well as (optionally) for | 1608 | | | | verification of client | 1609 | | | | authorization. | 1610 +---------+--------------+--------+-------------------------------+ 1611 +------------<---------------+ 1612 | At least one | 1613 V successful | 1614 ++====[ ]===++ ++=====^=====++ 1615 || Cookie || ||Association|| 1616 || Exchange || || Exchange || 1617 ++====_ _===++ ++===========++ 1618 | 1619 | At least one 1620 | successful 1621 V 1622 ++=======[ ]=======++ 1623 || Unicast Time |>-----\ As long as further 1624 || Synchronization || | synchronization 1625 || Exchange(s) |<-----/ is desired 1626 ++=======_ _=======++ 1627 | 1628 \ Other (unspecified) 1629 Sufficient \ / methods which give 1630 accuracy \ either or / sufficient accuracy 1631 \----------\ /---------/ 1632 | 1633 | 1634 V 1635 ++========[ ]=========++ 1636 || Broadcast || 1637 || Parameter Exchange || 1638 ++========_ _=========++ 1639 | 1640 | One successful 1641 | per client 1642 V 1643 ++=======[ ]=======++ 1644 || Broadcast Time |>--------\ As long as further 1645 || Synchronization || | synchronization 1646 || Reception |<--------/ is desired 1647 ++=======_ _=======++ 1648 | 1649 / \ 1650 either / \ or 1651 /----------/ \-------------\ 1652 | | 1653 V V 1654 ++========[ ]========++ ++========[ ]========++ 1655 || Keycheck Exchange || || Keycheck Exchange || 1656 ++===================++ || with TimeSync || 1657 ++===================++ 1659 Authors' Addresses 1661 Dieter Sibold 1662 Physikalisch-Technische Bundesanstalt 1663 Bundesallee 100 1664 Braunschweig D-38116 1665 Germany 1667 Phone: +49-(0)531-592-8420 1668 Fax: +49-531-592-698420 1669 Email: dieter.sibold@ptb.de 1671 Stephen Roettger 1672 Google Inc. 1674 Email: stephen.roettger@googlemail.com 1676 Kristof Teichel 1677 Physikalisch-Technische Bundesanstalt 1678 Bundesallee 100 1679 Braunschweig D-38116 1680 Germany 1682 Phone: +49-(0)531-592-8421 1683 Email: kristof.teichel@ptb.de