idnits 2.17.00 (12 Aug 2021) /tmp/idnits52971/draft-ietf-ntp-network-time-security-07.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 (March 3, 2015) is 2635 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: draft-iab-privsec-confidentiality-threat has been published as RFC 7624 == Outdated reference: A later version (-06) exists of draft-ietf-ntp-cms-for-nts-message-00 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: September 4, 2015 Google Inc. 6 K. Teichel 7 PTB 8 March 3, 2015 10 Network Time Security 11 draft-ietf-ntp-network-time-security-07.txt 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 September 4, 2015. 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. Association Message Exchange . . . . . . . . . . . . . . 7 71 6.1.1. Goals of the Association Exchange . . . . . . . . . . 7 72 6.1.2. Message Type: "client_assoc" . . . . . . . . . . . . 7 73 6.1.3. Message Type: "server_assoc" . . . . . . . . . . . . 7 74 6.1.4. Procedure Overview of the Association Exchange . . . 8 75 6.2. Cookie Messages . . . . . . . . . . . . . . . . . . . . . 9 76 6.2.1. Goals of the Cookie Exchange . . . . . . . . . . . . 9 77 6.2.2. Message Type: "client_cook" . . . . . . . . . . . . . 10 78 6.2.3. Message Type: "server_cook" . . . . . . . . . . . . . 10 79 6.2.4. Procedure Overview of the Cookie Exchange . . . . . . 11 80 6.3. Unicast Time Synchronisation Messages . . . . . . . . . . 12 81 6.3.1. Goals of the Unicast Time Synchronization Exchange . 12 82 6.3.2. Message Type: "time_request" . . . . . . . . . . . . 12 83 6.3.3. Message Type: "time_response" . . . . . . . . . . . . 13 84 6.3.4. Procedure Overview of the Unicast Time 85 Synchronization Exchange . . . . . . . . . . . . . . 13 86 6.4. Broadcast Parameter Messages . . . . . . . . . . . . . . 14 87 6.4.1. Goals of the Broadcast Parameter Exchange . . . . . . 15 88 6.4.2. Message Type: "client_bpar" . . . . . . . . . . . . . 15 89 6.4.3. Message Type: "server_bpar" . . . . . . . . . . . . . 15 90 6.4.4. Procedure Overview of the Broadcast Parameter 91 Exchange . . . . . . . . . . . . . . . . . . . . . . 16 92 6.5. Broadcast Time Synchronization Exchange . . . . . . . . . 17 93 6.5.1. Goals of the Broadcast Time Synchronization Exchange 17 94 6.5.2. Message Type: "server_broad" . . . . . . . . . . . . 17 95 6.5.3. Procedure Overview of Broadcast Time Synchronization 96 Exchange . . . . . . . . . . . . . . . . . . . . . . 18 97 6.6. Broadcast Keycheck . . . . . . . . . . . . . . . . . . . 19 98 6.6.1. Goals of the Broadcast Keycheck Exchange . . . . . . 19 99 6.6.2. Message Type: "client_keycheck" . . . . . . . . . . . 20 100 6.6.3. Message Type: "server_keycheck" . . . . . . . . . . . 20 101 6.6.4. Procedure Overview of the Broadcast Keycheck Exchange 20 102 7. Server Seed Considerations . . . . . . . . . . . . . . . . . 21 103 8. Hash Algorithms and MAC Generation . . . . . . . . . . . . . 22 104 8.1. Hash Algorithms . . . . . . . . . . . . . . . . . . . . . 22 105 8.2. MAC Calculation . . . . . . . . . . . . . . . . . . . . . 22 106 9. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 22 107 10. Security Considerations . . . . . . . . . . . . . . . . . . . 22 108 10.1. Privacy . . . . . . . . . . . . . . . . . . . . . . . . 22 109 10.2. Initial Verification of the Server Certificates . . . . 23 110 10.3. Revocation of Server Certificates . . . . . . . . . . . 23 111 10.4. Mitigating Denial-of-Service for broadcast packets . . . 23 112 10.5. Delay Attack . . . . . . . . . . . . . . . . . . . . . . 24 113 10.6. Random Number Generation . . . . . . . . . . . . . . . . 25 114 11. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 25 115 12. References . . . . . . . . . . . . . . . . . . . . . . . . . 25 116 12.1. Normative References . . . . . . . . . . . . . . . . . . 25 117 12.2. Informative References . . . . . . . . . . . . . . . . . 26 118 Appendix A. (informative) TICTOC Security Requirements . . . . . 27 119 Appendix B. (normative) Using TESLA for Broadcast-Type Messages 28 120 B.1. Server Preparation . . . . . . . . . . . . . . . . . . . 28 121 B.2. Client Preparation . . . . . . . . . . . . . . . . . . . 30 122 B.3. Sending Authenticated Broadcast Packets . . . . . . . . . 31 123 B.4. Authentication of Received Packets . . . . . . . . . . . 31 124 Appendix C. (informative) Dependencies . . . . . . . . . . . . . 32 125 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 35 127 1. Introduction 129 Time synchronization protocols are increasingly utilized to 130 synchronize clocks in networked infrastructures. Successful attacks 131 against the time synchronization protocol can seriously degrade the 132 reliable performance of such infrastructures. Therefore, time 133 synchronization protocols have to be secured if they are applied in 134 environments that are prone to malicious attacks. This can be 135 accomplished either by utilization of external security protocols, 136 like IPsec or TLS, or by intrinsic security measures of the time 137 synchronization protocol. 139 The two most popular time synchronization protocols, the Network Time 140 Protocol (NTP) [RFC5905] and the Precision Time Protocol (PTP) 142 [IEEE1588], currently do not provide adequate intrinsic security 143 precautions. This document specifies security measures which enable 144 these and possibly other protocols to verify the authenticity of the 145 time server/master and the integrity of the time synchronization 146 protocol packets. The utilization of these measures for a given 147 specific time synchronisation protocol has to be described in a 148 separate document. 150 [RFC7384] specifies that a security mechanism for timekeeping must be 151 designed in such a way that it does not degrade the quality of the 152 time transfer. This implies that for time keeping the increase in 153 bandwidth and message latency caused by the security measures should 154 be small. Also, NTP as well as PTP work via UDP and connections are 155 stateless on the server/master side. Therefore, all security 156 measures in this document are designed in such a way that they add 157 little demand for bandwidth, that the necessary calculations can be 158 executed in a fast manner, and that the measures do not require a 159 server/master to keep state of a connection. 161 2. Terminology 163 2.1. Terms and Abbreviations 165 MITM Man In The Middle 167 NTS Network Time Security 169 TESLA Timed Efficient Stream Loss-tolerant Authentication 171 MAC Message Authentication Code 173 HMAC Keyed-Hash Message Authentication Code 175 2.2. Common Terminology for PTP and NTP 177 This document refers to different time synchronization protocols, in 178 particular to both the PTP and the NTP. Throughout the document the 179 term "server" applies to both a PTP master and an NTP server. 180 Accordingly, the term "client" applies to both a PTP slave and an NTP 181 client. 183 3. Security Threats 185 The document "Security Requirements of Time Protocols in Packet 186 Switched Networks" [RFC7384] contains a profound analysis of security 187 threats and requirements for time synchronization protocols. 189 4. Objectives 191 The objectives of the NTS specification are as follows: 193 o Authenticity: NTS enables a client to authenticate its time 194 server(s). 196 o Integrity: NTS protects the integrity of time synchronization 197 protocol packets via a message authentication code (MAC). 199 o Confidentiality: NTS does not provide confidentiality protection 200 of the time synchronization packets. 202 o Authorization: NTS optionally enables the server to verify the 203 client's authorization. 205 o Request-Response-Consistency: NTS enables a client to match an 206 incoming response to a request it has sent. NTS also enables the 207 client to deduce from the response whether its request to the 208 server has arrived without alteration. 210 o Integration with protocols: NTS can be used to secure different 211 time synchronization protocols, specifically at least NTP and PTP. 212 A client or server running an NTS-secured version of a time 213 protocol does not negatively affect other participants who are 214 running unsecured versions of that protocol. 216 5. NTS Overview 218 NTS applies X.509 certificates to verify the authenticity of the time 219 server and to exchange a symmetric key, the so-called cookie. It 220 then uses the cookie to protect the authenticity and the integrity of 221 subsequent unicast-type time synchronization packets. In order to do 222 this, a Message Authentication Code (MAC) is attached to each time 223 synchronization packet. The calculation of the MAC includes the 224 whole time synchronization packet and the cookie which is shared 225 between client and server. The cookie is calculated according to: 227 cookie = MSB_ (HMAC(server seed, H(certificate of client))), 229 with the server seed as the key, where H is a hash function, and 230 where the function MSB_ cuts off the b most significant bits of 231 the result of the HMAC function. The client's certificate contains 232 the client's public key and enables the server to identify the 233 client, if client authorization is desired. The server seed is a 234 random value of bit length b that the server possesses, which has to 235 remain secret. The cookie never changes as long as the server seed 236 stays the same, but the server seed has to be refreshed periodically 237 in order to provide key freshness as required in [RFC7384]. See 238 Section 7 for details on seed refreshing. 240 Since the server does not keep a state of the client, it has to 241 recalculate the cookie each time it receives a unicast time 242 synchronization request from the client. To this end, the client has 243 to attach the hash value of its certificate to each request (see 244 Section 6.3). 246 For broadcast-type messages, authenticity and integrity of the time 247 synchronization packets are also ensured by a MAC, which is attached 248 to the time synchronization packet by the sender. Verification of 249 the broadcast-type packets' authenticity is based on the TESLA 250 protocol, in particular on its "not re-using keys" scheme, see 251 Section 3.7.2 of [RFC4082]. TESLA uses a one-way chain of keys, 252 where each key is the output of a one-way function applied to the 253 previous key in the chain. The server securely shares the last 254 element of the chain with all clients. The server splits time into 255 intervals of uniform duration and assigns each key to an interval in 256 reverse order, starting with the penultimate. At each time interval, 257 the server sends a broadcast packet appended by a MAC, calculated 258 using the corresponding key, and the key of the previous disclosure 259 interval. The client verifies the MAC by buffering the packet until 260 disclosure of the key in its associated disclosure interval occurs. 261 In order to be able to verify the timeliness of the packets, the 262 client has to be loosely time synchronized with the server. This has 263 to be accomplished before broadcast associations can be used. For 264 checking timeliness of packets, NTS uses another, more rigorous check 265 in addition to just the clock lookup used in the TESLA protocol. For 266 a more detailed description of how NTS employs and customizes TESLA, 267 see Appendix B. 269 6. Protocol Messages 271 This section describes the types of messages needed for secure time 272 synchronization with NTS. 274 For some guidance on how these message types can be realized in 275 practice, and integrated into the communication flow of existing time 276 synchronization protocols, see [I-D.ietf-ntp-cms-for-nts-message], a 277 companion document for NTS. Said document describes ASN.1 encodings 278 for those message parts that have to be added to a time 279 synchronization protocol for security reasons as well as CMS 280 (Cryptographic Message Syntax, see [RFC5652]) conventions that can be 281 used to get the cryptographic aspects right. 283 6.1. Association Message Exchange 285 In this message exchange, the participants negotiate the hash and 286 encryption algorithms that are used throughout the protocol. In 287 addition, the client receives the certification chain up to a trusted 288 anchor. With the established certification chain the client is able 289 to verify the server's signatures and, hence, the authenticity of 290 future NTS messages from the server is ensured. 292 6.1.1. Goals of the Association Exchange 294 The association exchange: 296 o enables the client to verify any communication with the server as 297 authentic, 299 o lets the participants negotiate NTS version and algorithms, 301 o guarantees authenticity of the negotiation result to the client. 303 6.1.2. Message Type: "client_assoc" 305 The protocol sequence starts with the client sending an association 306 message, called client_assoc. This message contains 308 o the NTS message ID "client_assoc", 310 o a nonce, 312 o the version number of NTS that the client wants to use (this 313 SHOULD be the highest version number that it supports), 315 o the hostname of the client, 317 o a selection of accepted hash algorithms, and 319 o a selection of accepted encryption algorithms. 321 6.1.3. Message Type: "server_assoc" 323 This message is sent by the server upon receipt of client_assoc. It 324 contains 326 o the NTS message ID "server_assoc", 328 o the nonce transmitted in client_assoc, 329 o the client's proposal for the version number, selection of 330 accepted hash algorithms and selection of accepted encryption 331 algorithms, as transmitted in client_assoc, 333 o the version number used for the rest of the protocol (which SHOULD 334 be determined as the minimum over the client's suggestion in the 335 client_assoc message and the highest supported by the server), 337 o the hostname of the server, 339 o the server's choice of algorithm for encryption and for 340 cryptographic hashing, all of which MUST be chosen from the 341 client's proposals, 343 o a signature, calculated over the data listed above, with the 344 server's private key and according to the signature algorithm 345 which is also used for the certificates that are included (see 346 below), and 348 o a chain of certificates, which starts at the server and goes up to 349 a trusted authority; each certificate MUST be certified by the one 350 directly following it. 352 6.1.4. Procedure Overview of the Association Exchange 354 For an association exchange, the following steps are performed: 356 1. The client sends a client_assoc message to the server. It MUST 357 keep the transmitted values for the version number and algorithms 358 available for later checks. 360 2. Upon receipt of a client_assoc message, the server constructs and 361 sends a reply in the form of a server_assoc message as described 362 in Section 6.1.3. Upon unsuccessful negotiation for version 363 number or algorithms the server_assoc message MUST contain an 364 error code. 366 3. The client waits for a reply in the form of a server_assoc 367 message. After receipt of the message it performs the following 368 checks: 370 * The client checks that the message contains a conforming 371 version number. 373 * It also verifies that the server has chosen the encryption and 374 hash algorithms from its proposal sent in the client_assoc 375 message. 377 * Furthermore, it performs authenticity checks on the 378 certificate chain and the signature for the version number. 380 If one of the checks fails, the client MUST abort the run. 382 +------------------------+ 383 | o Choose version | 384 | o Choose algorithms | 385 | o Acquire certificates | 386 | o Assemble response | 387 | o Create signature | 388 +-----------+------------+ 389 | 390 <-+-> 392 Server ---------------------------> 393 /| \ 394 client_ / \ server_ 395 assoc / \ assoc 396 / \| 397 Client ---------------------------> 399 <------ Association -----> 400 exchange 402 Procedure for association and cookie exchange. 404 6.2. Cookie Messages 406 During this message exchange, the server transmits a secret cookie to 407 the client securely. The cookie will later be used for integrity 408 protection during unicast time synchronization. 410 6.2.1. Goals of the Cookie Exchange 412 The cookie exchange: 414 o enables the server to check the client's authorization via its 415 certificate (optional), 417 o supplies the client with the correct cookie for its association to 418 the server, 420 o guarantees to the client that the cookie originates from the 421 server and that it is based on the client's original, unaltered 422 request. 424 o guarantees that the received cookie is unknown to anyone but the 425 server and the client. 427 6.2.2. Message Type: "client_cook" 429 This message is sent by the client upon successful authentication of 430 the server. In this message, the client requests a cookie from the 431 server. The message contains 433 o the NTS message ID "client_cook", 435 o a nonce, 437 o the negotiated version number, 439 o the negotiated signature algorithm, 441 o the negotiated encryption algorithm, 443 o the negotiated hash algorithm H, 445 o the client's certificate. 447 6.2.3. Message Type: "server_cook" 449 This message is sent by the server upon receipt of a client_cook 450 message. The server generates the hash of the client's certificate, 451 as conveyed during client_cook, in order to calculate the cookie 452 according to Section 5. This message contains 454 o the NTS message ID "server_cook" 456 o the version number as transmitted in client_cook, 458 o a concatenated datum which is encrypted with the client's public 459 key, according to the encryption algorithm transmitted in the 460 client_cook message. The concatenated datum contains 462 * the nonce transmitted in client_cook, and 464 * the cookie. 466 o a signature, created with the server's private key, calculated 467 over all of the data listed above. This signature MUST be 468 calculated according to the transmitted signature algorithm from 469 the client_cook message. 471 6.2.4. Procedure Overview of the Cookie Exchange 473 For a cookie exchange, the following steps are performed: 475 1. The client sends a client_cook message to the server. The client 476 MUST save the included nonce until the reply has been processed. 478 2. Upon receipt of a client_cook message, the server checks whether 479 it supports the given cryptographic algorithms. It then 480 calculates the cookie according to the formula given in 481 Section 5. The server MAY use the client's certificate to check 482 that the client is authorized to use the secure time 483 synchronization service. With this, it MUST construct a 484 server_cook message as described in Section 6.2.3. 486 3. The client awaits a reply in the form of a server_cook message; 487 upon receipt it executes the following actions: 489 * It verifies that the received version number matches the one 490 negotiated beforehand. 492 * It verifies the signature using the server's public key. The 493 signature has to authenticate the encrypted data. 495 * It decrypts the encrypted data with its own private key. 497 * It checks that the decrypted message is of the expected 498 format: the concatenation of a 128 bit nonce and a 128 bit 499 cookie. 501 * It verifies that the received nonce matches the nonce sent in 502 the client_cook message. 504 If one of those checks fails, the client MUST abort the run. 506 +----------------------------+ 507 | o OPTIONAL: Check client's | 508 | authorization | 509 | o Generate cookie | 510 | o Encrypt inner message | 511 | o Generate signature | 512 +-------------+--------------+ 513 | 514 <-+-> 516 Server ---------------------------> 517 /| \ 518 client_ / \ server_ 519 cook / \ cook 520 / \| 521 Client ---------------------------> 523 <--- Cookie exchange --> 525 Procedure for association and cookie exchange. 527 6.3. Unicast Time Synchronisation Messages 529 In this message exchange, the usual time synchronization process is 530 executed, with the addition of integrity protection for all messages 531 that the server sends. This message can be repeatedly exchanged as 532 often as the client desires and as long as the integrity of the 533 server's time responses is verified successfully. 535 6.3.1. Goals of the Unicast Time Synchronization Exchange 537 The unicast time synchronization exchange: 539 o exchanges (unicast) time synchronization data as specified by the 540 appropriate time synchronization protocol, 542 o guarantees to the client that the response originates from the 543 server and is based on the client's original, unaltered request. 545 6.3.2. Message Type: "time_request" 547 This message is sent by the client when it requests a time exchange. 548 It contains 550 o the NTS message ID "time_request", 552 o the negotiated version number, 553 o a nonce, 555 o the negotiated hash algorithm H, 557 o the hash of the client's certificate under H. 559 6.3.3. Message Type: "time_response" 561 This message is sent by the server after it has received a 562 time_request message. Prior to this the server MUST recalculate the 563 client's cookie by using the hash of the client's certificate and the 564 transmitted hash algorithm. The message contains 566 o the NTS message ID "time_response", 568 o the version number as transmitted in time_request, 570 o the server's time synchronization response data, 572 o the nonce transmitted in time_request, 574 o a MAC (generated with the cookie as key) for verification of all 575 of the above data. 577 6.3.4. Procedure Overview of the Unicast Time Synchronization Exchange 579 For a unicast time synchronization exchange, the following steps are 580 performed: 582 1. The client sends a time_request message to the server. The 583 client MUST save the included nonce and the transmit_timestamp 584 (from the time synchronization data) as a correlated pair for 585 later verification steps. 587 2. Upon receipt of a time_request message, the server re-calculates 588 the cookie, then computes the necessary time synchronization data 589 and constructs a time_response message as given in Section 6.3.3. 591 3. It awaits a reply in the form of a time_response message. Upon 592 receipt, it checks: 594 * that the transmitted version number matches the one negotiated 595 previously, 597 * that the transmitted nonce belongs to a previous time_request 598 message, 600 * that the transmit_timestamp in that time_request message 601 matches the corresponding time stamp from the synchronization 602 data received in the time_response, and 604 * that the appended MAC verifies the received synchronization 605 data, version number and nonce. 607 If at least one of the first three checks fails (i.e. if the 608 version number does not match, if the client has never used the 609 nonce transmitted in the time_response message, or if it has used 610 the nonce with initial time synchronization data different from 611 that in the response), then the client MUST ignore this 612 time_response message. If the MAC is invalid, the client MUST do 613 one of the following: abort the run or go back to step 5 (because 614 the cookie might have changed due to a server seed refresh). If 615 both checks are successful, the client SHOULD continue time 616 synchronization by going back to step 7. 618 +-----------------------+ 619 | o Re-generate cookie | 620 | o Assemble response | 621 | o Generate MAC | 622 +-----------+-----------+ 623 | 624 <-+-> 626 Server -----------------------------------------------> 627 /| \ 628 time_ / \ time_ 629 request / \ response 630 / \| 631 Client -----------------------------------------------> 633 <------ Unicast time ------> <- Client-side -> 634 synchronization validity 635 exchange checks 637 Procedure for unicast time synchronization exchange. 639 6.4. Broadcast Parameter Messages 641 In this message exchange, the client receives the necessary 642 information to execute the TESLA protocol in a secured broadcast 643 association. The client can only initiate a secure broadcast 644 association after successful association and cookie exchanges and 645 only if it has made sure that its clock is roughly synchronized to 646 the server's. 648 See Appendix B for more details on TESLA. 650 6.4.1. Goals of the Broadcast Parameter Exchange 652 The broadcast parameter exchange 654 o provides the client with all the information necessary to process 655 broadcast time synchronization messages from the server, and 657 o guarantees authenticity, integrity and freshness of the broadcast 658 parameters to the client. 660 6.4.2. Message Type: "client_bpar" 662 This message is sent by the client in order to establish a secured 663 time broadcast association with the server. It contains 665 o the NTS message ID "client_bpar", 667 o the NTS version number negotiated during association, 669 o a nonce, 671 o the client's hostname, and 673 o the signature algorithm negotiated during association. 675 6.4.3. Message Type: "server_bpar" 677 This message is sent by the server upon receipt of a client_bpar 678 message during the broadcast loop of the server. It contains 680 o the NTS message ID "server_bpar", 682 o the version number as transmitted in the client_bpar message, 684 o the nonce transmitted in client_bpar, 686 o the one-way functions used for building the key chain, and 688 o the disclosure schedule of the keys. This contains: 690 * the last key of the key chain, 692 * time interval duration, 694 * the disclosure delay (number of intervals between use and 695 disclosure of a key), 697 * the time at which the next time interval will start, and 699 * the next interval's associated index. 701 o The message also contains a signature signed by the server with 702 its private key, verifying all the data listed above. 704 6.4.4. Procedure Overview of the Broadcast Parameter Exchange 706 A broadcast parameter exchange consists of the following steps: 708 1. The client sends a client_bpar message to the server. It MUST 709 remember the transmitted values for the nonce, the version number 710 and the signature algorithm. 712 2. Upon receipt of a client_bpar message, the server constructs and 713 sends a server_bpar message as described in Section 6.4.3. 715 3. The client waits for a reply in the form of a server_bpar 716 message, on which it performs the following checks: 718 * The message must contain all the necessary information for the 719 TESLA protocol, as listed in Section 6.4.3. 721 * The message must contain a nonce belonging to a client_bpar 722 message that the client has previously sent. 724 * Verification of the message's signature. 726 If any information is missing or if the server's signature cannot 727 be verified, the client MUST abort the broadcast run. If all 728 checks are successful, the client MUST remember all the broadcast 729 parameters received for later checks. 731 +---------------------+ 732 | o Assemble response | 733 | o Create public-key | 734 | signature | 735 +----------+----------+ 736 | 737 <-+-> 739 Server ---------------------------------------------> 740 /| \ 741 client_ / \ server_ 742 bpar / \ bpar 743 / \| 744 Client ---------------------------------------------> 746 <------- Broadcast ------> <- Client-side -> 747 parameter validity 748 exchange checks 750 Procedure for unicast time synchronization exchange. 752 6.5. Broadcast Time Synchronization Exchange 754 Via a stream of messages of the following message type, the server 755 keeps sending broadcast time synchronization messages to all 756 participating clients. 758 6.5.1. Goals of the Broadcast Time Synchronization Exchange 760 The broadcast time synchronization exchange: 762 o transmits (broadcast) time synchronization data from the server to 763 the client as specified by the appropriate time synchronization 764 protocol, 766 o guarantees to the client that the received synchronization data 767 has arrived in a timely manner as required by the TESLA protocol 768 and is trustworthy enough to be stored for later checks, 770 o additionally guarantees authenticity of a certain broadcast 771 synchronization message in the client's storage. 773 6.5.2. Message Type: "server_broad" 775 This message is sent by the server over the course of its broadcast 776 schedule. It is part of any broadcast association. It contains 778 o the NTS message ID "server_broad", 779 o the version number that the server is working under, 781 o time broadcast data, 783 o the index that belongs to the current interval (and therefore 784 identifies the current, yet undisclosed, key), 786 o the disclosed key of the previous disclosure interval (current 787 time interval minus disclosure delay), 789 o a MAC, calculated with the key for the current time interval, 790 verifying 792 * the message ID, 794 * the version number, and 796 * the time data. 798 6.5.3. Procedure Overview of Broadcast Time Synchronization Exchange 800 A broadcast time synchronization message exchange consists of the 801 following steps: 803 1. The server follows the TESLA protocol by regularly sending 804 server_broad messages as described in Section 6.5.2, adhering to 805 its own disclosure schedule. 807 2. The client awaits time synchronization data in the form of a 808 server_broadcast message. Upon receipt, it performs the 809 following checks: 811 * Proof that the MAC is based on a key that is not yet disclosed 812 (packet timeliness). This is achieved via a combination of 813 checks. First, the disclosure schedule is used, which 814 requires loose time synchronization. If this is successful, 815 the client obtains a stronger guarantee via a key check 816 exchange (see below). If its timeliness is verified, the 817 packet will be buffered for later authentication. Otherwise, 818 the client MUST discard it. Note that the time information 819 included in the packet will not be used for synchronization 820 until its authenticity could also be verified. 822 * The client checks that it does not already know the disclosed 823 key. Otherwise, the client SHOULD discard the packet to avoid 824 a buffer overrun. If this check is successful, the client 825 ensures that the disclosed key belongs to the one-way key 826 chain by applying the one-way function until equality with a 827 previous disclosed key is shown. If it is falsified, the 828 client MUST discard the packet. 830 * If the disclosed key is legitimate, then the client verifies 831 the authenticity of any packet that it has received during the 832 corresponding time interval. If authenticity of a packet is 833 verified, then it is released from the buffer and its time 834 information can be utilized. If the verification fails, then 835 authenticity is not given. In this case, the client MUST 836 request authentic time from the server by means other than 837 broadcast messages. Also, the client MUST re-initialize the 838 broadcast sequence with a "client_bpar" message if the one-way 839 key chain expires, which it can check via the disclosure 840 schedule. 842 See RFC 4082[RFC4082] for a detailed description of the packet 843 verification process. 845 Server ----------------------------------> 846 \ 847 \ server_ 848 \ broad 849 \| 850 Client ----------------------------------> 852 < Broadcast > <- Client-side -> 853 time sync. validity and 854 exchange timeliness 855 checks 857 Procedure for broadcast time synchronization exchange. 859 6.6. Broadcast Keycheck 861 This message exchange is performed for an additional check of packet 862 timeliness in the course of the TESLA scheme, see Appendix B. 864 6.6.1. Goals of the Broadcast Keycheck Exchange 866 The keycheck exchange: 868 o guarantees to the client that the key belonging to the respective 869 TESLA interval communicated in the exchange had not been disclosed 870 before the client_keycheck message was sent. 872 o guarantees to the client the timeliness of any broadcast packet 873 secured with this key if it arrived before client_keycheck was 874 sent. 876 6.6.2. Message Type: "client_keycheck" 878 A message of this type is sent by the client in order to initiate an 879 additional check of packet timeliness for the TESLA scheme. It 880 contains 882 o the NTS message ID "client_keycheck", 884 o the NTS version number negotiated during association, 886 o a nonce, 888 o an interval number from the TESLA disclosure schedule, 890 o the hash algorithm H negotiated during association, and 892 o the hash of the client's certificate under H. 894 6.6.3. Message Type: "server_keycheck" 896 A message of this type is sent by the server upon receipt of a 897 client_keycheck message during the broadcast loop of the server. 898 Prior to this, the server MUST recalculate the client's cookie by 899 using the hash of the client's certificate and the transmitted hash 900 algorithm. It contains 902 o the NTS message ID "server_keycheck" 904 o the version number as transmitted in "client_keycheck, 906 o the nonce transmitted in the client_keycheck message, 908 o the interval number transmitted in the client_keycheck message, 909 and 911 o a MAC (generated with the cookie as key) for verification of all 912 of the above data. 914 6.6.4. Procedure Overview of the Broadcast Keycheck Exchange 916 A broadcast keycheck message exchange consists of the following 917 steps: 919 1. The client sends a client_keycheck message. It MUST memorize the 920 nonce and the time interval number that it sends as a correlated 921 pair. 923 2. Upon receipt of a client_keycheck message, the server looks up 924 whether it has already disclosed the key associated with the 925 interval number transmitted in that message. If it has not 926 disclosed it, it constructs and sends the appropriate 927 server_keycheck message as described in Section 6.6.3. For more 928 details, see also Appendix B. 930 3. The client awaits a reply in the form of a server_keycheck 931 message. On receipt, it performs the following checks: 933 * that the transmitted version number matches the one negotiated 934 previously, 936 * that the transmitted nonce belongs to a previous 937 client_keycheck message, 939 * that the TESLA interval number in that client_keycheck message 940 matches the corresponding interval number from the 941 server_keycheck, and 943 * that the appended MAC verifies the received data. 945 +----------------------+ 946 | o Assemble response | 947 | o Re-generate cookie | 948 | o Generate MAC | 949 +-----------+----------+ 950 | 951 <-+-> 952 Server ---------------------------------------------> 953 \ /| \ 954 \ server_ client_ / \ server_ 955 \ broad keycheck / \ keycheck 956 \| / \| 957 Client ---------------------------------------------> 958 <-------- Extended broadcast time -------> 959 synchronization. exchange 961 <---- Keycheck exchange ---> 963 Procedure for extended broadcast time synchronization exchange. 965 7. Server Seed Considerations 967 The server has to calculate a random seed which has to be kept 968 secret. The server MUST generate a seed for each supported hash 969 algorithm, see Section 8.1. 971 According to the requirements in [RFC7384], the server MUST refresh 972 each server seed periodically. Consequently, the cookie memorized by 973 the client becomes obsolete. In this case, the client cannot verify 974 the MAC attached to subsequent time response messages and has to 975 respond accordingly by re-initiating the protocol with a cookie 976 request (Section 6.2). 978 8. Hash Algorithms and MAC Generation 980 8.1. Hash Algorithms 982 Hash algorithms are used at different points: calculation of the 983 cookie and the MAC, and hashing of the client's certificate. The 984 client and the server negotiate a hash algorithm H during the 985 association message exchange (Section 6.1) at the beginning. The 986 selected algorithm H is used for all hashing processes in that run. 988 In the TESLA scheme, hash algorithms are used as pseudo-random 989 functions to construct the one-way key chain. Here, the utilized 990 hash algorithm is communicated by the server and is non-negotiable. 992 Note: 994 Any hash algorithm is prone to be compromised in the future. A 995 successful attack on a hash algorithm would enable any NTS client 996 to derive the server seed from its own cookie. Therefore, the 997 server MUST have separate seed values for its different supported 998 hash algorithms. This way, knowledge gained from an attack on a 999 hash algorithm H can at least only be used to compromise such 1000 clients who use hash algorithm H as well. 1002 8.2. MAC Calculation 1004 For the calculation of the MAC, client and server use a Keyed-Hash 1005 Message Authentication Code (HMAC) approach [RFC2104]. The HMAC is 1006 generated with the hash algorithm specified by the client (see 1007 Section 8.1). 1009 9. IANA Considerations 1011 10. Security Considerations 1013 10.1. Privacy 1015 The payload of time synchronization protocol packets of two-way time 1016 transfer approaches like NTP and PTP consists basically of time 1017 stamps, which are not considered secret [RFC7384]. Therefore, 1018 encryption of the time synchronization protocol packet's payload is 1019 not considered in this document. However, an attacker can exploit 1020 the exchange of time synchronization protocol packets for topology 1021 detection and inference attacks as described in 1022 [I-D.iab-privsec-confidentiality-threat]. To make such attacks more 1023 difficult, that draft recommends the encryption of the packet 1024 payload. Yet, in the case of time synchronization protocols the 1025 confidentiality protection of time synchronization packet's payload 1026 is of secondary role since the packets meta data (IP addresses, port 1027 numbers, possibly packet size and regular sending intervals) carry 1028 more information than the payload. To enhance the privacy of the 1029 time synchronization partners, the usage of tunnel protocols such as 1030 IPsec and MACsec, where applicable, is therefore more suited than 1031 confidentiality protection of the payload. 1033 10.2. Initial Verification of the Server Certificates 1035 The client has to verify the validity of the certificates during the 1036 certification message exchange (Section 6.1.3). Since it generally 1037 has no reliable time during this initial communication phase, it is 1038 impossible to verify the period of validity of the certificates. To 1039 solve this chicken-and-egg problem, the client as to rely on external 1040 means. 1042 10.3. Revocation of Server Certificates 1044 According to Section 7, it is the client's responsibility to initiate 1045 a new association with the server after the server's certificate 1046 expires. To this end, the client reads the expiration date of the 1047 certificate during the certificate message exchange (Section 6.1.3). 1048 Furthermore, certificates may also be revoked prior to the normal 1049 expiration date. To increase security the client MAY periodically 1050 verify the state of the server's certificate via OCSP. 1052 10.4. Mitigating Denial-of-Service for broadcast packets 1054 TESLA authentication buffers packets for delayed authentication. 1055 This makes the protocol vulnerable to flooding attacks, causing the 1056 client to buffer excessive numbers of packets. To add stronger DoS 1057 protection to the protocol, the client and the server use the "not 1058 re-using keys" scheme of TESLA as pointed out in Section 3.7.2 of RFC 1059 4082 [RFC4082]. In this scheme the server never uses a key for the 1060 MAC generation more than once. Therefore, the client can discard any 1061 packet that contains a disclosed key it already knows, thus 1062 preventing memory flooding attacks. 1064 Note that an alternative approach to enhance TESLA's resistance 1065 against DoS attacks involves the addition of a group MAC to each 1066 packet. This requires the exchange of an additional shared key 1067 common to the whole group. This adds additional complexity to the 1068 protocol and hence is currently not considered in this document. 1070 10.5. Delay Attack 1072 In a packet delay attack, an adversary with the ability to act as a 1073 MITM delays time synchronization packets between client and server 1074 asymmetrically [RFC7384]. This prevents the client from accurately 1075 measuring the network delay, and hence its time offset to the server 1076 [Mizrahi]. The delay attack does not modify the content of the 1077 exchanged synchronization packets. Therefore, cryptographic means do 1078 not provide a feasible way to mitigate this attack. However, several 1079 non-cryptographic precautions can be taken in order to detect this 1080 attack. 1082 1. Usage of multiple time servers: this enables the client to detect 1083 the attack, provided that the adversary is unable to delay the 1084 synchronization packets between the majority of servers. This 1085 approach is commonly used in NTP to exclude incorrect time 1086 servers [RFC5905]. 1088 2. Multiple communication paths: The client and server utilize 1089 different paths for packet exchange as described in the I-D 1090 [I-D.shpiner-multi-path-synchronization]. The client can detect 1091 the attack, provided that the adversary is unable to manipulate 1092 the majority of the available paths [Shpiner]. Note that this 1093 approach is not yet available, neither for NTP nor for PTP. 1095 3. Usage of an encrypted connection: the client exchanges all 1096 packets with the time server over an encrypted connection (e.g. 1097 IPsec). This measure does not mitigate the delay attack, but it 1098 makes it more difficult for the adversary to identify the time 1099 synchronization packets. 1101 4. For unicast-type messages: Introduction of a threshold value for 1102 the delay time of the synchronization packets. The client can 1103 discard a time server if the packet delay time of this time 1104 server is larger than the threshold value. 1106 Additional provision against delay attacks has to be taken for 1107 broadcast-type messages. This mode relies on the TESLA scheme which 1108 is based on the requirement that a client and the broadcast server 1109 are loosely time synchronized. Therefore, a broadcast client has to 1110 establish time synchronization with its broadcast server before it 1111 starts utilizing broadcast messages for time synchronization. 1113 One possible way to achieve this initial synchronization is to 1114 establish a unicast association with its broadcast server until time 1115 synchronization and calibration of the packet delay time is achieved. 1116 After that, the client can establish a broadcast association with the 1117 broadcast server and utilizes TESLA to verify integrity and 1118 authenticity of any received broadcast packets. 1120 An adversary who is able to delay broadcast packets can cause a time 1121 adjustment at the receiving broadcast clients. If the adversary 1122 delays broadcast packets continuously, then the time adjustment will 1123 accumulate until the loose time synchronization requirement is 1124 violated, which breaks the TESLA scheme. To mitigate this 1125 vulnerability the security condition in TESLA has to be supplemented 1126 by an additional check in which the client, upon receipt of a 1127 broadcast message, verifies the status of the corresponding key via a 1128 unicast message exchange with the broadcast server (see Appendix B.4 1129 for a detailed description of this check). Note that a broadcast 1130 client should also apply the above-mentioned precautions as far as 1131 possible. 1133 10.6. Random Number Generation 1135 At various points of the protocol, the generation of random numbers 1136 is required. The employed methods of generation need to be 1137 cryptographically secure. See [RFC4086] for guidelines concerning 1138 this topic. 1140 11. Acknowledgements 1142 The authors would like to thank Tal Mizrahi, Russ Housley, Steven 1143 Bellovin, David Mills and Kurt Roeckx for discussions and comments on 1144 the design of NTS. Also, thanks go to Harlan Stenn for his technical 1145 review and specific text contributions to this document. 1147 12. References 1149 12.1. Normative References 1151 [RFC2104] Krawczyk, H., Bellare, M., and R. Canetti, "HMAC: Keyed- 1152 Hashing for Message Authentication", RFC 2104, February 1153 1997. 1155 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 1156 Requirement Levels", BCP 14, RFC 2119, March 1997. 1158 [RFC4082] Perrig, A., Song, D., Canetti, R., Tygar, J., and B. 1159 Briscoe, "Timed Efficient Stream Loss-Tolerant 1160 Authentication (TESLA): Multicast Source Authentication 1161 Transform Introduction", RFC 4082, June 2005. 1163 [RFC5652] Housley, R., "Cryptographic Message Syntax (CMS)", STD 70, 1164 RFC 5652, September 2009. 1166 [RFC7384] Mizrahi, T., "Security Requirements of Time Protocols in 1167 Packet Switched Networks", RFC 7384, October 2014. 1169 12.2. Informative References 1171 [I-D.iab-privsec-confidentiality-threat] 1172 Barnes, R., Schneier, B., Jennings, C., Hardie, T., 1173 Trammell, B., Huitema, C., and D. Borkmann, 1174 "Confidentiality in the Face of Pervasive Surveillance: A 1175 Threat Model and Problem Statement", draft-iab-privsec- 1176 confidentiality-threat-03 (work in progress), February 1177 2015. 1179 [I-D.ietf-ntp-cms-for-nts-message] 1180 Sibold, D., Roettger, S., Teichel, K., and R. Housley, 1181 "Protecting Network Time Security Messages with the 1182 Cryptographic Message Syntax (CMS)", draft-ietf-ntp-cms- 1183 for-nts-message-00 (work in progress), October 2014. 1185 [I-D.shpiner-multi-path-synchronization] 1186 Shpiner, A., Tse, R., Schelp, C., and T. Mizrahi, "Multi- 1187 Path Time Synchronization", draft-shpiner-multi-path- 1188 synchronization-03 (work in progress), February 2014. 1190 [IEEE1588] 1191 IEEE Instrumentation and Measurement Society. TC-9 Sensor 1192 Technology, "IEEE standard for a precision clock 1193 synchronization protocol for networked measurement and 1194 control systems", 2008. 1196 [Mizrahi] Mizrahi, T., "A game theoretic analysis of delay attacks 1197 against time synchronization protocols", in Proceedings of 1198 Precision Clock Synchronization for Measurement Control 1199 and Communication, ISPCS 2012, pp. 1-6, September 2012. 1201 [RFC4086] Eastlake, D., Schiller, J., and S. Crocker, "Randomness 1202 Requirements for Security", BCP 106, RFC 4086, June 2005. 1204 [RFC5905] Mills, D., Martin, J., Burbank, J., and W. Kasch, "Network 1205 Time Protocol Version 4: Protocol and Algorithms 1206 Specification", RFC 5905, June 2010. 1208 [Shpiner] Shpiner, A., Revah, Y., and T. Mizrahi, "Multi-path Time 1209 Protocols", in Proceedings of Precision Clock 1210 Synchronization for Measurement Control and Communication, 1211 ISPCS 2013, pp. 1-6, September 2013. 1213 Appendix A. (informative) TICTOC Security Requirements 1215 The following table compares the NTS specifications against the 1216 TICTOC security requirements [RFC7384]. 1218 +---------+------------------------------+-------------+------------+ 1219 | Section | Requirement from RFC 7384 | Requirement | NTS | 1220 | | | level | | 1221 +---------+------------------------------+-------------+------------+ 1222 | 5.1.1 | Authentication of Servers | MUST | OK | 1223 +---------+------------------------------+-------------+------------+ 1224 | 5.1.1 | Authorization of Servers | MUST | OK | 1225 +---------+------------------------------+-------------+------------+ 1226 | 5.1.2 | Recursive Authentication of | MUST | OK | 1227 | | Servers (Stratum 1) | | | 1228 +---------+------------------------------+-------------+------------+ 1229 | 5.1.2 | Recursive Authorization of | MUST | OK | 1230 | | Servers (Stratum 1) | | | 1231 +---------+------------------------------+-------------+------------+ 1232 | 5.1.3 | Authentication and | MAY | Optional, | 1233 | | Authorization of Clients | | Limited | 1234 +---------+------------------------------+-------------+------------+ 1235 | 5.2 | Integrity protection | MUST | OK | 1236 +---------+------------------------------+-------------+------------+ 1237 | 5.3 | Spoofing Prevention | MUST | OK | 1238 +---------+------------------------------+-------------+------------+ 1239 | 5.4 | Protection from DoS attacks | SHOULD | OK | 1240 | | against the time protocol | | | 1241 +---------+------------------------------+-------------+------------+ 1242 | 5.5 | Replay protection | MUST | OK | 1243 +---------+------------------------------+-------------+------------+ 1244 | 5.6 | Key freshness | MUST | OK | 1245 +---------+------------------------------+-------------+------------+ 1246 | | Security association | SHOULD | OK | 1247 +---------+------------------------------+-------------+------------+ 1248 | | Unicast and multicast | SHOULD | OK | 1249 | | associations | | | 1250 +---------+------------------------------+-------------+------------+ 1251 | 5.7 | Performance: no degradation | MUST | OK | 1252 | | in quality of time transfer | | | 1253 +---------+------------------------------+-------------+------------+ 1254 | | Performance: lightweight | SHOULD | OK | 1255 | | computation | | | 1256 +---------+------------------------------+-------------+------------+ 1257 | | Performance: storage | SHOULD | OK | 1258 +---------+------------------------------+-------------+------------+ 1259 | | Performance: bandwidth | SHOULD | OK | 1260 +---------+------------------------------+-------------+------------+ 1261 | 5.8 | Confidentiality protection | MAY | NO | 1262 +---------+------------------------------+-------------+------------+ 1263 | 5.9 | Protection against Packet | MUST | Limited*) | 1264 | | Delay and Interception | | | 1265 | | Attacks | | | 1266 +---------+------------------------------+-------------+------------+ 1267 | 5.10 | Secure mode | MUST | OK | 1268 +---------+------------------------------+-------------+------------+ 1269 | | Hybrid mode | SHOULD | - | 1270 +---------+------------------------------+-------------+------------+ 1272 *) See discussion in Section 10.5. 1274 Comparison of NTS specification against Security Requirements of Time 1275 Protocols in Packet Switched Networks (RFC 7384) 1277 Appendix B. (normative) Using TESLA for Broadcast-Type Messages 1279 For broadcast-type messages , NTS adopts the TESLA protocol with some 1280 customizations. This appendix provides details on the generation and 1281 usage of the one-way key chain collected and assembled from 1282 [RFC4082]. Note that NTS uses the "not re-using keys" scheme of 1283 TESLA as described in Section 3.7.2. of [RFC4082]. 1285 B.1. Server Preparation 1287 server setup: 1289 1. The server determines a reasonable upper bound B on the network 1290 delay between itself and an arbitrary client, measured in 1291 milliseconds. 1293 2. It determines the number n+1 of keys in the one-way key chain. 1294 This yields the number n of keys that are usable to authenticate 1295 broadcast packets. This number n is therefore also the number of 1296 time intervals during which the server can send authenticated 1297 broadcast messages before it has to calculate a new key chain. 1299 3. It divides time into n uniform intervals I_1, I_2, ..., I_n. 1300 Each of these time intervals has length L, measured in 1301 milliseconds. In order to fulfill the requirement 3.7.2. of RFC 1302 4082, the time interval L has to be shorter than the time 1303 interval between the broadcast messages. 1305 4. The server generates a random key K_n. 1307 5. Using a one-way function F, the server generates a one-way chain 1308 of n+1 keys K_0, K_1, ..., K_{n} according to 1310 K_i = F(K_{i+1}). 1312 6. Using another one-way function F', it generates a sequence of n 1313 MAC keys K'_0, K'_1, ..., K'_{n-1} according to 1315 K'_i = F'(K_i). 1317 7. Each MAC key K'_i is assigned to the time interval I_i. 1319 8. The server determines the key disclosure delay d, which is the 1320 number of intervals between using a key and disclosing it. Note 1321 that although security is provided for all choices d>0, the 1322 choice still makes a difference: 1324 * If d is chosen too short, the client might discard packets 1325 because it fails to verify that the key used for its MAC has 1326 not yet been disclosed. 1328 * If d is chosen too long, the received packets have to be 1329 buffered for an unnecessarily long time before they can be 1330 verified by the client and be subsequently utilized for time 1331 synchronization. 1333 The server SHOULD calculate d according to 1335 d = ceil( 2*B / L) + 1, 1337 where ceil yields the smallest integer greater than or equal to 1338 its argument. 1340 < - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1341 Generation of Keys 1343 F F F F 1344 K_0 <-------- K_1 <-------- ... <-------- K_{n-1} <------- K_n 1345 | | | | 1346 | | | | 1347 | F' | F' | F' | F' 1348 | | | | 1349 v v v v 1350 K'_0 K'_1 ... K'_{n-1} K'_n 1351 [______________|____ ____|_________________|_______] 1352 I_1 ... I_{n-1} I_n 1354 Course of Time/Usage of Keys 1355 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -> 1357 A schematic explanation of the TESLA protocol's one-way key chain 1359 B.2. Client Preparation 1361 A client needs the following information in order to participate in a 1362 TESLA broadcast: 1364 o One key K_i from the one-way key chain, which has to be 1365 authenticated as belonging to the server. Typically, this will be 1366 K_0. 1368 o The disclosure schedule of the keys. This consists of: 1370 * the length n of the one-way key chain, 1372 * the length L of the time intervals I_1, I_2, ..., I_n, 1374 * the starting time T_i of an interval I_i. Typically this is 1375 the starting time T_1 of the first interval; 1377 * the disclosure delay d. 1379 o The one-way function F used to recursively derive the keys in the 1380 one-way key chain, 1382 o The second one-way function F' used to derive the MAC keys K'_0, 1383 K'_1, ... , K'_n from the keys in the one-way chain. 1385 o An upper bound D_t on how far its own clock is "behind" that of 1386 the server. 1388 Note that if D_t is greater than (d - 1) * L, then some authentic 1389 packets might be discarded. If D_t is greater than d * L, then all 1390 authentic packets will be discarded. In the latter case, the client 1391 should not participate in the broadcast, since there will be no 1392 benefit in doing so. 1394 B.3. Sending Authenticated Broadcast Packets 1396 During each time interval I_i, the server sends at most one 1397 authenticated broadcast packet P_i. Such a packet consists of: 1399 o a message M_i, 1401 o the index i (in case a packet arrives late), 1403 o a MAC authenticating the message M_i, with K'_i used as key, 1405 o the key K_{i-d}, which is included for disclosure. 1407 B.4. Authentication of Received Packets 1409 When a client receives a packet P_i as described above, it first 1410 checks that it has not already received a packet with the same 1411 disclosed key. This is done to avoid replay/flooding attacks. A 1412 packet that fails this test is discarded. 1414 Next, the client begins to check the packet's timeliness by ensuring 1415 that according to the disclosure schedule and with respect to the 1416 upper bound D_t determined above, the server cannot have disclosed 1417 the key K_i yet. Specifically, it needs to check that the server's 1418 clock cannot read a time that is in time interval I_{i+d} or later. 1419 Since it works under the assumption that the server's clock is not 1420 more than D_t "ahead" of the client's clock, the client can calculate 1421 an upper bound t_i for the server's clock at the time when P_i 1422 arrived. This upper bound t_i is calculated according to 1424 t_i = R + D_t, 1426 where R is the client's clock at the arrival of P_i. This implies 1427 that at the time of arrival of P_i, the server could have been in 1428 interval I_x at most, with 1430 x = floor((t_i - T_1) / L) + 1, 1432 where floor gives the greatest integer less than or equal to its 1433 argument. The client now needs to verify that 1435 x < i+d 1437 is valid (see also Section 3.5 of [RFC4082]). If it is falsified, it 1438 is discarded. 1440 If the check above is successful, the client performs another more 1441 rigorous check: it sends a key check request to the server (in the 1442 form of a client_keycheck message), asking explicitly if K_i has 1443 already been disclosed. It remembers the time stamp t_check of the 1444 sending time of that request as well as the nonce it used correlated 1445 with the interval number i. If it receives an answer from the server 1446 stating that K_i has not yet been disclosed and it is able to verify 1447 the HMAC on that response, then it deduces that K_i was undisclosed 1448 at t_check and therefore also at R. In this case, the client accepts 1449 P_i as timely. 1451 Next the client verifies that a newly disclosed key K_{i-d} belongs 1452 to the one-way key chain. To this end, it applies the one-way 1453 function F to K_{i-d} until it can verify the identity with an 1454 earlier disclosed key (see Clause 3.5 in RFC 4082, item 3). 1456 Next the client verifies that the transmitted time value s_i belongs 1457 to the time interval I_i, by checking 1459 T_i =< s_i, and 1461 s_i < T_{i+1}. 1463 If it is falsified, the packet MUST be discarded and the client MUST 1464 reinitialize its broadcast module by performing time synchronization 1465 by other means than broadcast messages, and it MUST perform a new 1466 broadcast parameter exchange (because a falsification of this check 1467 yields that the packet was not generated according to protocol, which 1468 suggests an attack). 1470 If a packet P_i passes all the tests listed above, it is stored for 1471 later authentication. Also, if at this time there is a package with 1472 index i-d already buffered, then the client uses the disclosed key 1473 K_{i-d} to derive K'_{i-d} and uses that to check the MAC included in 1474 package P_{i-d}. Upon success, it regards M_{i-d} as authenticated. 1476 Appendix C. (informative) Dependencies 1477 +---------+--------------+--------+-------------------------------+ 1478 | Issuer | Type | Owner | Description | 1479 +---------+--------------+--------+-------------------------------+ 1480 | Server | private key | server | Used for server_assoc, | 1481 | PKI | (signature) | | server_cook, server_bpar. | 1482 | +--------------+--------+ The server uses the private | 1483 | | public key | client | key to sign these messages. | 1484 | | (signature) | | The client uses the public | 1485 | +--------------+--------+ key to verify them. | 1486 | | certificate | server | The certificate is used in | 1487 | | | | server_assoc messages, for | 1488 | | | | verifying authentication and | 1489 | | | | (optionally) authorization. | 1490 +---------+--------------+--------+-------------------------------+ 1491 | Client | private key | client | The server uses the client's | 1492 | PKI | (encryption) | | public key to encrypt the | 1493 | +--------------+--------+ content of server_cook | 1494 | | public key | server | messages. The client uses | 1495 | | (encryption) | | the private key to decrypt | 1496 | +--------------+--------+ them. The certificate is | 1497 | | certificate | client | sent in client_cook messages, | 1498 | | | | where it is used for trans- | 1499 | | | | portation of the public key | 1500 | | | | as well as (optionally) for | 1501 | | | | verification of client | 1502 | | | | authorization. | 1503 +---------+--------------+--------+-------------------------------+ 1504 +------------<---------------+ 1505 | At least one | 1506 V successful | 1507 ++====[ ]===++ ++=====^=====++ 1508 || Cookie || ||Association|| 1509 || Exchange || || Exchange || 1510 ++====_ _===++ ++===========++ 1511 | 1512 | At least one 1513 | successful 1514 V 1515 ++=======[ ]=======++ 1516 || Unicast Time |>-----\ As long as further 1517 || Synchronization || | synchronization 1518 || Exchange(s) |<-----/ is desired 1519 ++=======_ _=======++ 1520 | 1521 \ Other (unspecified) 1522 Sufficient \ / methods which give 1523 accuracy \ either or / sufficient accuracy 1524 \----------\ /---------/ 1525 | 1526 | 1527 V 1528 ++========[ ]=========++ 1529 || Broadcast || 1530 || Parameter Exchange || 1531 ++========_ _=========++ 1532 | 1533 | One successful 1534 | per client 1535 V 1536 ++=======[ ]=======++ 1537 || Broadcast Time |>--------\ As long as further 1538 || Synchronization || | synchronization 1539 || Reception |<--------/ is desired 1540 ++=======_ _=======++ 1541 | 1542 / \ 1543 either / \ or 1544 /----------/ \-------------\ 1545 | | 1546 V V 1547 ++========[ ]========++ ++========[ ]========++ 1548 || Keycheck Exchange || || Keycheck Exchange || 1549 ++===================++ || with TimeSync || 1550 ++===================++ 1552 Authors' Addresses 1554 Dieter Sibold 1555 Physikalisch-Technische Bundesanstalt 1556 Bundesallee 100 1557 Braunschweig D-38116 1558 Germany 1560 Phone: +49-(0)531-592-8420 1561 Fax: +49-531-592-698420 1562 Email: dieter.sibold@ptb.de 1564 Stephen Roettger 1565 Google Inc. 1567 Email: stephen.roettger@googlemail.com 1569 Kristof Teichel 1570 Physikalisch-Technische Bundesanstalt 1571 Bundesallee 100 1572 Braunschweig D-38116 1573 Germany 1575 Phone: +49-(0)531-592-8421 1576 Email: kristof.teichel@ptb.de