idnits 2.17.1 draft-ietf-ntp-network-time-security-08.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 5, 2015) is 3341 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 (-07) exists of draft-iab-privsec-confidentiality-threat-03 == 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 6, 2015 Google Inc. 6 K. Teichel 7 PTB 8 March 5, 2015 10 Network Time Security 11 draft-ietf-ntp-network-time-security-08.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 6, 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" . . . . . . . . . . . . 8 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 . . . . . . . . . . . . 10 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 synchronization 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. A 220 client needs a public/private key pair for encryption, with the 221 public key enclosed in a certificate. A server needs a public/ 222 private key pair for signing, with the public key enclosed in a 223 certificate. If a participant intends to act as both a client and a 224 server, it MUST have two different key pairs for these purposes. 226 After the cookie is exchanged, the client then uses it to protect the 227 authenticity and the integrity of subsequent unicast-type time 228 synchronization packets. In order to do this, a Message 229 Authentication Code (MAC) is attached to each time synchronization 230 packet. The calculation of the MAC includes the whole time 231 synchronization packet and the cookie which is shared between client 232 and server. The cookie is calculated according to: 234 cookie = MSB_ (HMAC(server seed, H(certificate of client))), 236 with the server seed as the key, where H is a hash function, and 237 where the function MSB_ cuts off the b most significant bits of 238 the result of the HMAC function. The client's certificate contains 239 the client's public key and enables the server to identify the 240 client, if client authorization is desired. The server seed is a 241 random value of bit length b that the server possesses, which has to 242 remain secret. The cookie never changes as long as the server seed 243 stays the same, but the server seed has to be refreshed periodically 244 in order to provide key freshness as required in [RFC7384]. See 245 Section 7 for details on seed refreshing. 247 Since the server does not keep a state of the client, it has to 248 recalculate the cookie each time it receives a unicast time 249 synchronization request from the client. To this end, the client has 250 to attach the hash value of its certificate to each request (see 251 Section 6.3). 253 For broadcast-type messages, authenticity and integrity of the time 254 synchronization packets are also ensured by a MAC, which is attached 255 to the time synchronization packet by the sender. Verification of 256 the broadcast-type packets' authenticity is based on the TESLA 257 protocol, in particular on its "not re-using keys" scheme, see 258 Section 3.7.2 of [RFC4082]. TESLA uses a one-way chain of keys, 259 where each key is the output of a one-way function applied to the 260 previous key in the chain. The server securely shares the last 261 element of the chain with all clients. The server splits time into 262 intervals of uniform duration and assigns each key to an interval in 263 reverse order, starting with the penultimate. At each time interval, 264 the server sends a broadcast packet appended by a MAC, calculated 265 using the corresponding key, and the key of the previous disclosure 266 interval. The client verifies the MAC by buffering the packet until 267 disclosure of the key in its associated disclosure interval occurs. 268 In order to be able to verify the timeliness of the packets, the 269 client has to be loosely time synchronized with the server. This has 270 to be accomplished before broadcast associations can be used. For 271 checking timeliness of packets, NTS uses another, more rigorous check 272 in addition to just the clock lookup used in the TESLA protocol. For 273 a more detailed description of how NTS employs and customizes TESLA, 274 see Appendix B. 276 6. Protocol Messages 278 This section describes the types of messages needed for secure time 279 synchronization with NTS. 281 For some guidance on how these message types can be realized in 282 practice, and integrated into the communication flow of existing time 283 synchronization protocols, see [I-D.ietf-ntp-cms-for-nts-message], a 284 companion document for NTS. Said document describes ASN.1 encodings 285 for those message parts that have to be added to a time 286 synchronization protocol for security reasons as well as CMS 287 (Cryptographic Message Syntax, see [RFC5652]) conventions that can be 288 used to get the cryptographic aspects right. 290 6.1. Association Message Exchange 292 In this message exchange, the participants negotiate the hash and 293 encryption algorithms that are used throughout the protocol. In 294 addition, the client receives the certification chain up to a trusted 295 anchor. With the established certification chain the client is able 296 to verify the server's signatures and, hence, the authenticity of 297 future NTS messages from the server is ensured. 299 6.1.1. Goals of the Association Exchange 301 The association exchange: 303 o enables the client to verify any communication with the server as 304 authentic, 306 o lets the participants negotiate NTS version and algorithms, 308 o guarantees authenticity of the negotiation result to the client, 310 o guarantees to the client that the negotiation result is based on 311 the client's original, unaltered request. 313 6.1.2. Message Type: "client_assoc" 315 The protocol sequence starts with the client sending an association 316 message, called client_assoc. This message contains 318 o the NTS message ID "client_assoc", 320 o a nonce, 322 o the version number of NTS that the client wants to use (this 323 SHOULD be the highest version number that it supports), 325 o the hostname of the client, 327 o a selection of accepted hash algorithms, and 329 o a selection of accepted encryption algorithms. 331 6.1.3. Message Type: "server_assoc" 333 This message is sent by the server upon receipt of client_assoc. It 334 contains 336 o the NTS message ID "server_assoc", 338 o the nonce transmitted in client_assoc, 340 o the client's proposal for the version number, selection of 341 accepted hash algorithms and selection of accepted encryption 342 algorithms, as transmitted in client_assoc, 344 o the version number used for the rest of the protocol (which SHOULD 345 be determined as the minimum over the client's suggestion in the 346 client_assoc message and the highest supported by the server), 348 o the hostname of the server, 350 o the server's choice of algorithm for encryption and for 351 cryptographic hashing, all of which MUST be chosen from the 352 client's proposals, 354 o a signature, calculated over the data listed above, with the 355 server's private key and according to the signature algorithm 356 which is also used for the certificates that are included (see 357 below), and 359 o a chain of certificates, which starts at the server and goes up to 360 a trusted authority; each certificate MUST be certified by the one 361 directly following it. 363 6.1.4. Procedure Overview of the Association Exchange 365 For an association exchange, the following steps are performed: 367 1. The client sends a client_assoc message to the server. It MUST 368 keep the transmitted values for the version number and algorithms 369 available for later checks. 371 2. Upon receipt of a client_assoc message, the server constructs and 372 sends a reply in the form of a server_assoc message as described 373 in Section 6.1.3. Upon unsuccessful negotiation for version 374 number or algorithms the server_assoc message MUST contain an 375 error code. 377 3. The client waits for a reply in the form of a server_assoc 378 message. After receipt of the message it performs the following 379 checks: 381 * The client checks that the message contains a conforming 382 version number. 384 * It checks that the nonce sent back by the server matches the 385 one transmitted in client_assoc, 387 * It also verifies that the server has chosen the encryption and 388 hash algorithms from its proposal sent in the client_assoc 389 message and that this proposal was not altered. 391 * Furthermore, it performs authenticity checks on the 392 certificate chain and the signature. 394 If one of the checks fails, the client MUST abort the run. 396 +------------------------+ 397 | o Choose version | 398 | o Choose algorithms | 399 | o Acquire certificates | 400 | o Assemble response | 401 | o Create signature | 402 +-----------+------------+ 403 | 404 <-+-> 406 Server ---------------------------> 407 /| \ 408 client_ / \ server_ 409 assoc / \ assoc 410 / \| 411 Client ---------------------------> 413 <------ Association -----> 414 exchange 416 Procedure for association and cookie exchange. 418 6.2. Cookie Messages 420 During this message exchange, the server transmits a secret cookie to 421 the client securely. The cookie will later be used for integrity 422 protection during unicast time synchronization. 424 6.2.1. Goals of the Cookie Exchange 426 The cookie exchange: 428 o enables the server to check the client's authorization via its 429 certificate (optional), 431 o supplies the client with the correct cookie for its association to 432 the server, 434 o guarantees to the client that the cookie originates from the 435 server and that it is based on the client's original, unaltered 436 request. 438 o guarantees that the received cookie is unknown to anyone but the 439 server and the client. 441 6.2.2. Message Type: "client_cook" 443 This message is sent by the client upon successful authentication of 444 the server. In this message, the client requests a cookie from the 445 server. The message contains 447 o the NTS message ID "client_cook", 449 o a nonce, 451 o the negotiated version number, 453 o the negotiated signature algorithm, 455 o the negotiated encryption algorithm, 457 o the negotiated hash algorithm H, 459 o the client's certificate. 461 6.2.3. Message Type: "server_cook" 463 This message is sent by the server upon receipt of a client_cook 464 message. The server generates the hash of the client's certificate, 465 as conveyed during client_cook, in order to calculate the cookie 466 according to Section 5. This message contains 468 o the NTS message ID "server_cook" 470 o the version number as transmitted in client_cook, 471 o a concatenated datum which is encrypted with the client's public 472 key, according to the encryption algorithm transmitted in the 473 client_cook message. The concatenated datum contains 475 * the nonce transmitted in client_cook, and 477 * the cookie. 479 o a signature, created with the server's private key, calculated 480 over all of the data listed above. This signature MUST be 481 calculated according to the transmitted signature algorithm from 482 the client_cook message. 484 6.2.4. Procedure Overview of the Cookie Exchange 486 For a cookie exchange, the following steps are performed: 488 1. The client sends a client_cook message to the server. The client 489 MUST save the included nonce until the reply has been processed. 491 2. Upon receipt of a client_cook message, the server checks whether 492 it supports the given cryptographic algorithms. It then 493 calculates the cookie according to the formula given in 494 Section 5. The server MAY use the client's certificate to check 495 that the client is authorized to use the secure time 496 synchronization service. With this, it MUST construct a 497 server_cook message as described in Section 6.2.3. 499 3. The client awaits a reply in the form of a server_cook message; 500 upon receipt it executes the following actions: 502 * It verifies that the received version number matches the one 503 negotiated beforehand. 505 * It verifies the signature using the server's public key. The 506 signature has to authenticate the encrypted data. 508 * It decrypts the encrypted data with its own private key. 510 * It checks that the decrypted message is of the expected 511 format: the concatenation of a 128 bit nonce and a 128 bit 512 cookie. 514 * It verifies that the received nonce matches the nonce sent in 515 the client_cook message. 517 If one of those checks fails, the client MUST abort the run. 519 +----------------------------+ 520 | o OPTIONAL: Check client's | 521 | authorization | 522 | o Generate cookie | 523 | o Encrypt inner message | 524 | o Generate signature | 525 +-------------+--------------+ 526 | 527 <-+-> 529 Server ---------------------------> 530 /| \ 531 client_ / \ server_ 532 cook / \ cook 533 / \| 534 Client ---------------------------> 536 <--- Cookie exchange --> 538 Procedure for association and cookie exchange. 540 6.3. Unicast Time Synchronisation Messages 542 In this message exchange, the usual time synchronization process is 543 executed, with the addition of integrity protection for all messages 544 that the server sends. This message can be repeatedly exchanged as 545 often as the client desires and as long as the integrity of the 546 server's time responses is verified successfully. 548 6.3.1. Goals of the Unicast Time Synchronization Exchange 550 The unicast time synchronization exchange: 552 o exchanges (unicast) time synchronization data as specified by the 553 appropriate time synchronization protocol, 555 o guarantees to the client that the response originates from the 556 server and is based on the client's original, unaltered request. 558 6.3.2. Message Type: "time_request" 560 This message is sent by the client when it requests a time exchange. 561 It contains 563 o the NTS message ID "time_request", 565 o the negotiated version number, 566 o a nonce, 568 o the negotiated hash algorithm H, 570 o the hash of the client's certificate under H. 572 6.3.3. Message Type: "time_response" 574 This message is sent by the server after it has received a 575 time_request message. Prior to this the server MUST recalculate the 576 client's cookie by using the hash of the client's certificate and the 577 transmitted hash algorithm. The message contains 579 o the NTS message ID "time_response", 581 o the version number as transmitted in time_request, 583 o the server's time synchronization response data, 585 o the nonce transmitted in time_request, 587 o a MAC (generated with the cookie as key) for verification of all 588 of the above data. 590 6.3.4. Procedure Overview of the Unicast Time Synchronization Exchange 592 For a unicast time synchronization exchange, the following steps are 593 performed: 595 1. The client sends a time_request message to the server. The 596 client MUST save the included nonce and the transmit_timestamp 597 (from the time synchronization data) as a correlated pair for 598 later verification steps. 600 2. Upon receipt of a time_request message, the server re-calculates 601 the cookie, then computes the necessary time synchronization data 602 and constructs a time_response message as given in Section 6.3.3. 604 3. It awaits a reply in the form of a time_response message. Upon 605 receipt, it checks: 607 * that the transmitted version number matches the one negotiated 608 previously, 610 * that the transmitted nonce belongs to a previous time_request 611 message, 613 * that the transmit_timestamp in that time_request message 614 matches the corresponding time stamp from the synchronization 615 data received in the time_response, and 617 * that the appended MAC verifies the received synchronization 618 data, version number and nonce. 620 If at least one of the first three checks fails (i.e. if the 621 version number does not match, if the client has never used the 622 nonce transmitted in the time_response message, or if it has used 623 the nonce with initial time synchronization data different from 624 that in the response), then the client MUST ignore this 625 time_response message. If the MAC is invalid, the client MUST do 626 one of the following: abort the run or go back to step 5 (because 627 the cookie might have changed due to a server seed refresh). If 628 both checks are successful, the client SHOULD continue time 629 synchronization by going back to step 7. 631 +-----------------------+ 632 | o Re-generate cookie | 633 | o Assemble response | 634 | o Generate MAC | 635 +-----------+-----------+ 636 | 637 <-+-> 639 Server -----------------------------------------------> 640 /| \ 641 time_ / \ time_ 642 request / \ response 643 / \| 644 Client -----------------------------------------------> 646 <------ Unicast time ------> <- Client-side -> 647 synchronization validity 648 exchange checks 650 Procedure for unicast time synchronization exchange. 652 6.4. Broadcast Parameter Messages 654 In this message exchange, the client receives the necessary 655 information to execute the TESLA protocol in a secured broadcast 656 association. The client can only initiate a secure broadcast 657 association after successful association and cookie exchanges and 658 only if it has made sure that its clock is roughly synchronized to 659 the server's. 661 See Appendix B for more details on TESLA. 663 6.4.1. Goals of the Broadcast Parameter Exchange 665 The broadcast parameter exchange 667 o provides the client with all the information necessary to process 668 broadcast time synchronization messages from the server, and 670 o guarantees authenticity, integrity and freshness of the broadcast 671 parameters to the client. 673 6.4.2. Message Type: "client_bpar" 675 This message is sent by the client in order to establish a secured 676 time broadcast association with the server. It contains 678 o the NTS message ID "client_bpar", 680 o the NTS version number negotiated during association, 682 o a nonce, 684 o the client's hostname, and 686 o the signature algorithm negotiated during association. 688 6.4.3. Message Type: "server_bpar" 690 This message is sent by the server upon receipt of a client_bpar 691 message during the broadcast loop of the server. It contains 693 o the NTS message ID "server_bpar", 695 o the version number as transmitted in the client_bpar message, 697 o the nonce transmitted in client_bpar, 699 o the one-way functions used for building the key chain, and 701 o the disclosure schedule of the keys. This contains: 703 * the last key of the key chain, 705 * time interval duration, 707 * the disclosure delay (number of intervals between use and 708 disclosure of a key), 710 * the time at which the next time interval will start, and 712 * the next interval's associated index. 714 o The message also contains a signature signed by the server with 715 its private key, verifying all the data listed above. 717 6.4.4. Procedure Overview of the Broadcast Parameter Exchange 719 A broadcast parameter exchange consists of the following steps: 721 1. The client sends a client_bpar message to the server. It MUST 722 remember the transmitted values for the nonce, the version number 723 and the signature algorithm. 725 2. Upon receipt of a client_bpar message, the server constructs and 726 sends a server_bpar message as described in Section 6.4.3. 728 3. The client waits for a reply in the form of a server_bpar 729 message, on which it performs the following checks: 731 * The message must contain all the necessary information for the 732 TESLA protocol, as listed in Section 6.4.3. 734 * The message must contain a nonce belonging to a client_bpar 735 message that the client has previously sent. 737 * Verification of the message's signature. 739 If any information is missing or if the server's signature cannot 740 be verified, the client MUST abort the broadcast run. If all 741 checks are successful, the client MUST remember all the broadcast 742 parameters received for later checks. 744 +---------------------+ 745 | o Assemble response | 746 | o Create public-key | 747 | signature | 748 +----------+----------+ 749 | 750 <-+-> 752 Server ---------------------------------------------> 753 /| \ 754 client_ / \ server_ 755 bpar / \ bpar 756 / \| 757 Client ---------------------------------------------> 759 <------- Broadcast ------> <- Client-side -> 760 parameter validity 761 exchange checks 763 Procedure for unicast time synchronization exchange. 765 6.5. Broadcast Time Synchronization Exchange 767 Via a stream of messages of the following message type, the server 768 keeps sending broadcast time synchronization messages to all 769 participating clients. 771 6.5.1. Goals of the Broadcast Time Synchronization Exchange 773 The broadcast time synchronization exchange: 775 o transmits (broadcast) time synchronization data from the server to 776 the client as specified by the appropriate time synchronization 777 protocol, 779 o guarantees to the client that the received synchronization data 780 has arrived in a timely manner as required by the TESLA protocol 781 and is trustworthy enough to be stored for later checks, 783 o additionally guarantees authenticity of a certain broadcast 784 synchronization message in the client's storage. 786 6.5.2. Message Type: "server_broad" 788 This message is sent by the server over the course of its broadcast 789 schedule. It is part of any broadcast association. It contains 791 o the NTS message ID "server_broad", 792 o the version number that the server is working under, 794 o time broadcast data, 796 o the index that belongs to the current interval (and therefore 797 identifies the current, yet undisclosed, key), 799 o the disclosed key of the previous disclosure interval (current 800 time interval minus disclosure delay), 802 o a MAC, calculated with the key for the current time interval, 803 verifying 805 * the message ID, 807 * the version number, and 809 * the time data. 811 6.5.3. Procedure Overview of Broadcast Time Synchronization Exchange 813 A broadcast time synchronization message exchange consists of the 814 following steps: 816 1. The server follows the TESLA protocol by regularly sending 817 server_broad messages as described in Section 6.5.2, adhering to 818 its own disclosure schedule. 820 2. The client awaits time synchronization data in the form of a 821 server_broadcast message. Upon receipt, it performs the 822 following checks: 824 * Proof that the MAC is based on a key that is not yet disclosed 825 (packet timeliness). This is achieved via a combination of 826 checks. First, the disclosure schedule is used, which 827 requires loose time synchronization. If this is successful, 828 the client obtains a stronger guarantee via a key check 829 exchange (see below). If its timeliness is verified, the 830 packet will be buffered for later authentication. Otherwise, 831 the client MUST discard it. Note that the time information 832 included in the packet will not be used for synchronization 833 until its authenticity could also be verified. 835 * The client checks that it does not already know the disclosed 836 key. Otherwise, the client SHOULD discard the packet to avoid 837 a buffer overrun. If this check is successful, the client 838 ensures that the disclosed key belongs to the one-way key 839 chain by applying the one-way function until equality with a 840 previous disclosed key is shown. If it is falsified, the 841 client MUST discard the packet. 843 * If the disclosed key is legitimate, then the client verifies 844 the authenticity of any packet that it has received during the 845 corresponding time interval. If authenticity of a packet is 846 verified, then it is released from the buffer and its time 847 information can be utilized. If the verification fails, then 848 authenticity is not given. In this case, the client MUST 849 request authentic time from the server by means other than 850 broadcast messages. Also, the client MUST re-initialize the 851 broadcast sequence with a "client_bpar" message if the one-way 852 key chain expires, which it can check via the disclosure 853 schedule. 855 See RFC 4082[RFC4082] for a detailed description of the packet 856 verification process. 858 Server ----------------------------------> 859 \ 860 \ server_ 861 \ broad 862 \| 863 Client ----------------------------------> 865 < Broadcast > <- Client-side -> 866 time sync. validity and 867 exchange timeliness 868 checks 870 Procedure for broadcast time synchronization exchange. 872 6.6. Broadcast Keycheck 874 This message exchange is performed for an additional check of packet 875 timeliness in the course of the TESLA scheme, see Appendix B. 877 6.6.1. Goals of the Broadcast Keycheck Exchange 879 The keycheck exchange: 881 o guarantees to the client that the key belonging to the respective 882 TESLA interval communicated in the exchange had not been disclosed 883 before the client_keycheck message was sent. 885 o guarantees to the client the timeliness of any broadcast packet 886 secured with this key if it arrived before client_keycheck was 887 sent. 889 6.6.2. Message Type: "client_keycheck" 891 A message of this type is sent by the client in order to initiate an 892 additional check of packet timeliness for the TESLA scheme. It 893 contains 895 o the NTS message ID "client_keycheck", 897 o the NTS version number negotiated during association, 899 o a nonce, 901 o an interval number from the TESLA disclosure schedule, 903 o the hash algorithm H negotiated during association, and 905 o the hash of the client's certificate under H. 907 6.6.3. Message Type: "server_keycheck" 909 A message of this type is sent by the server upon receipt of a 910 client_keycheck message during the broadcast loop of the server. 911 Prior to this, the server MUST recalculate the client's cookie by 912 using the hash of the client's certificate and the transmitted hash 913 algorithm. It contains 915 o the NTS message ID "server_keycheck" 917 o the version number as transmitted in "client_keycheck, 919 o the nonce transmitted in the client_keycheck message, 921 o the interval number transmitted in the client_keycheck message, 922 and 924 o a MAC (generated with the cookie as key) for verification of all 925 of the above data. 927 6.6.4. Procedure Overview of the Broadcast Keycheck Exchange 929 A broadcast keycheck message exchange consists of the following 930 steps: 932 1. The client sends a client_keycheck message. It MUST memorize the 933 nonce and the time interval number that it sends as a correlated 934 pair. 936 2. Upon receipt of a client_keycheck message, the server looks up 937 whether it has already disclosed the key associated with the 938 interval number transmitted in that message. If it has not 939 disclosed it, it constructs and sends the appropriate 940 server_keycheck message as described in Section 6.6.3. For more 941 details, see also Appendix B. 943 3. The client awaits a reply in the form of a server_keycheck 944 message. On receipt, it performs the following checks: 946 * that the transmitted version number matches the one negotiated 947 previously, 949 * that the transmitted nonce belongs to a previous 950 client_keycheck message, 952 * that the TESLA interval number in that client_keycheck message 953 matches the corresponding interval number from the 954 server_keycheck, and 956 * that the appended MAC verifies the received data. 958 +----------------------+ 959 | o Assemble response | 960 | o Re-generate cookie | 961 | o Generate MAC | 962 +-----------+----------+ 963 | 964 <-+-> 965 Server ---------------------------------------------> 966 \ /| \ 967 \ server_ client_ / \ server_ 968 \ broad keycheck / \ keycheck 969 \| / \| 970 Client ---------------------------------------------> 971 <-------- Extended broadcast time -------> 972 synchronization exchange 974 <---- Keycheck exchange ---> 976 Procedure for extended broadcast time synchronization exchange. 978 7. Server Seed Considerations 980 The server has to calculate a random seed which has to be kept 981 secret. The server MUST generate a seed for each supported hash 982 algorithm, see Section 8.1. 984 According to the requirements in [RFC7384], the server MUST refresh 985 each server seed periodically. Consequently, the cookie memorized by 986 the client becomes obsolete. In this case, the client cannot verify 987 the MAC attached to subsequent time response messages and has to 988 respond accordingly by re-initiating the protocol with a cookie 989 request (Section 6.2). 991 8. Hash Algorithms and MAC Generation 993 8.1. Hash Algorithms 995 Hash algorithms are used at different points: calculation of the 996 cookie and the MAC, and hashing of the client's certificate. The 997 client and the server negotiate a hash algorithm H during the 998 association message exchange (Section 6.1) at the beginning. The 999 selected algorithm H is used for all hashing processes in that run. 1001 In the TESLA scheme, hash algorithms are used as pseudo-random 1002 functions to construct the one-way key chain. Here, the utilized 1003 hash algorithm is communicated by the server and is non-negotiable. 1005 Note: 1007 Any hash algorithm is prone to be compromised in the future. A 1008 successful attack on a hash algorithm would enable any NTS client 1009 to derive the server seed from its own cookie. Therefore, the 1010 server MUST have separate seed values for its different supported 1011 hash algorithms. This way, knowledge gained from an attack on a 1012 hash algorithm H can at least only be used to compromise such 1013 clients who use hash algorithm H as well. 1015 8.2. MAC Calculation 1017 For the calculation of the MAC, client and server use a Keyed-Hash 1018 Message Authentication Code (HMAC) approach [RFC2104]. The HMAC is 1019 generated with the hash algorithm specified by the client (see 1020 Section 8.1). 1022 9. IANA Considerations 1024 10. Security Considerations 1026 10.1. Privacy 1028 The payload of time synchronization protocol packets of two-way time 1029 transfer approaches like NTP and PTP consists basically of time 1030 stamps, which are not considered secret [RFC7384]. Therefore, 1031 encryption of the time synchronization protocol packet's payload is 1032 not considered in this document. However, an attacker can exploit 1033 the exchange of time synchronization protocol packets for topology 1034 detection and inference attacks as described in 1035 [I-D.iab-privsec-confidentiality-threat]. To make such attacks more 1036 difficult, that draft recommends the encryption of the packet 1037 payload. Yet, in the case of time synchronization protocols the 1038 confidentiality protection of time synchronization packet's payload 1039 is of secondary role since the packets meta data (IP addresses, port 1040 numbers, possibly packet size and regular sending intervals) carry 1041 more information than the payload. To enhance the privacy of the 1042 time synchronization partners, the usage of tunnel protocols such as 1043 IPsec and MACsec, where applicable, is therefore more suited than 1044 confidentiality protection of the payload. 1046 10.2. Initial Verification of the Server Certificates 1048 The client has to verify the validity of the certificates during the 1049 certification message exchange (Section 6.1.3). Since it generally 1050 has no reliable time during this initial communication phase, it is 1051 impossible to verify the period of validity of the certificates. To 1052 solve this chicken-and-egg problem, the client as to rely on external 1053 means. 1055 10.3. Revocation of Server Certificates 1057 According to Section 7, it is the client's responsibility to initiate 1058 a new association with the server after the server's certificate 1059 expires. To this end, the client reads the expiration date of the 1060 certificate during the certificate message exchange (Section 6.1.3). 1061 Furthermore, certificates may also be revoked prior to the normal 1062 expiration date. To increase security the client MAY periodically 1063 verify the state of the server's certificate via OCSP. 1065 10.4. Mitigating Denial-of-Service for broadcast packets 1067 TESLA authentication buffers packets for delayed authentication. 1068 This makes the protocol vulnerable to flooding attacks, causing the 1069 client to buffer excessive numbers of packets. To add stronger DoS 1070 protection to the protocol, the client and the server use the "not 1071 re-using keys" scheme of TESLA as pointed out in Section 3.7.2 of RFC 1072 4082 [RFC4082]. In this scheme the server never uses a key for the 1073 MAC generation more than once. Therefore, the client can discard any 1074 packet that contains a disclosed key it already knows, thus 1075 preventing memory flooding attacks. 1077 Note that an alternative approach to enhance TESLA's resistance 1078 against DoS attacks involves the addition of a group MAC to each 1079 packet. This requires the exchange of an additional shared key 1080 common to the whole group. This adds additional complexity to the 1081 protocol and hence is currently not considered in this document. 1083 10.5. Delay Attack 1085 In a packet delay attack, an adversary with the ability to act as a 1086 MITM delays time synchronization packets between client and server 1087 asymmetrically [RFC7384]. This prevents the client from accurately 1088 measuring the network delay, and hence its time offset to the server 1089 [Mizrahi]. The delay attack does not modify the content of the 1090 exchanged synchronization packets. Therefore, cryptographic means do 1091 not provide a feasible way to mitigate this attack. However, several 1092 non-cryptographic precautions can be taken in order to detect this 1093 attack. 1095 1. Usage of multiple time servers: this enables the client to detect 1096 the attack, provided that the adversary is unable to delay the 1097 synchronization packets between the majority of servers. This 1098 approach is commonly used in NTP to exclude incorrect time 1099 servers [RFC5905]. 1101 2. Multiple communication paths: The client and server utilize 1102 different paths for packet exchange as described in the I-D 1103 [I-D.shpiner-multi-path-synchronization]. The client can detect 1104 the attack, provided that the adversary is unable to manipulate 1105 the majority of the available paths [Shpiner]. Note that this 1106 approach is not yet available, neither for NTP nor for PTP. 1108 3. Usage of an encrypted connection: the client exchanges all 1109 packets with the time server over an encrypted connection (e.g. 1110 IPsec). This measure does not mitigate the delay attack, but it 1111 makes it more difficult for the adversary to identify the time 1112 synchronization packets. 1114 4. For unicast-type messages: Introduction of a threshold value for 1115 the delay time of the synchronization packets. The client can 1116 discard a time server if the packet delay time of this time 1117 server is larger than the threshold value. 1119 Additional provision against delay attacks has to be taken for 1120 broadcast-type messages. This mode relies on the TESLA scheme which 1121 is based on the requirement that a client and the broadcast server 1122 are loosely time synchronized. Therefore, a broadcast client has to 1123 establish time synchronization with its broadcast server before it 1124 starts utilizing broadcast messages for time synchronization. 1126 One possible way to achieve this initial synchronization is to 1127 establish a unicast association with its broadcast server until time 1128 synchronization and calibration of the packet delay time is achieved. 1129 After that, the client can establish a broadcast association with the 1130 broadcast server and utilizes TESLA to verify integrity and 1131 authenticity of any received broadcast packets. 1133 An adversary who is able to delay broadcast packets can cause a time 1134 adjustment at the receiving broadcast clients. If the adversary 1135 delays broadcast packets continuously, then the time adjustment will 1136 accumulate until the loose time synchronization requirement is 1137 violated, which breaks the TESLA scheme. To mitigate this 1138 vulnerability the security condition in TESLA has to be supplemented 1139 by an additional check in which the client, upon receipt of a 1140 broadcast message, verifies the status of the corresponding key via a 1141 unicast message exchange with the broadcast server (see Appendix B.4 1142 for a detailed description of this check). Note that a broadcast 1143 client should also apply the above-mentioned precautions as far as 1144 possible. 1146 10.6. Random Number Generation 1148 At various points of the protocol, the generation of random numbers 1149 is required. The employed methods of generation need to be 1150 cryptographically secure. See [RFC4086] for guidelines concerning 1151 this topic. 1153 11. Acknowledgements 1155 The authors would like to thank Tal Mizrahi, Russ Housley, Steven 1156 Bellovin, David Mills and Kurt Roeckx for discussions and comments on 1157 the design of NTS. Also, thanks go to Harlan Stenn for his technical 1158 review and specific text contributions to this document. 1160 12. References 1162 12.1. Normative References 1164 [RFC2104] Krawczyk, H., Bellare, M., and R. Canetti, "HMAC: Keyed- 1165 Hashing for Message Authentication", RFC 2104, February 1166 1997. 1168 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 1169 Requirement Levels", BCP 14, RFC 2119, March 1997. 1171 [RFC4082] Perrig, A., Song, D., Canetti, R., Tygar, J., and B. 1172 Briscoe, "Timed Efficient Stream Loss-Tolerant 1173 Authentication (TESLA): Multicast Source Authentication 1174 Transform Introduction", RFC 4082, June 2005. 1176 [RFC5652] Housley, R., "Cryptographic Message Syntax (CMS)", STD 70, 1177 RFC 5652, September 2009. 1179 [RFC7384] Mizrahi, T., "Security Requirements of Time Protocols in 1180 Packet Switched Networks", RFC 7384, October 2014. 1182 12.2. Informative References 1184 [I-D.iab-privsec-confidentiality-threat] 1185 Barnes, R., Schneier, B., Jennings, C., Hardie, T., 1186 Trammell, B., Huitema, C., and D. Borkmann, 1187 "Confidentiality in the Face of Pervasive Surveillance: A 1188 Threat Model and Problem Statement", draft-iab-privsec- 1189 confidentiality-threat-03 (work in progress), February 1190 2015. 1192 [I-D.ietf-ntp-cms-for-nts-message] 1193 Sibold, D., Roettger, S., Teichel, K., and R. Housley, 1194 "Protecting Network Time Security Messages with the 1195 Cryptographic Message Syntax (CMS)", draft-ietf-ntp-cms- 1196 for-nts-message-00 (work in progress), October 2014. 1198 [I-D.shpiner-multi-path-synchronization] 1199 Shpiner, A., Tse, R., Schelp, C., and T. Mizrahi, "Multi- 1200 Path Time Synchronization", draft-shpiner-multi-path- 1201 synchronization-03 (work in progress), February 2014. 1203 [IEEE1588] 1204 IEEE Instrumentation and Measurement Society. TC-9 Sensor 1205 Technology, "IEEE standard for a precision clock 1206 synchronization protocol for networked measurement and 1207 control systems", 2008. 1209 [Mizrahi] Mizrahi, T., "A game theoretic analysis of delay attacks 1210 against time synchronization protocols", in Proceedings of 1211 Precision Clock Synchronization for Measurement Control 1212 and Communication, ISPCS 2012, pp. 1-6, September 2012. 1214 [RFC4086] Eastlake, D., Schiller, J., and S. Crocker, "Randomness 1215 Requirements for Security", BCP 106, RFC 4086, June 2005. 1217 [RFC5905] Mills, D., Martin, J., Burbank, J., and W. Kasch, "Network 1218 Time Protocol Version 4: Protocol and Algorithms 1219 Specification", RFC 5905, June 2010. 1221 [Shpiner] Shpiner, A., Revah, Y., and T. Mizrahi, "Multi-path Time 1222 Protocols", in Proceedings of Precision Clock 1223 Synchronization for Measurement Control and Communication, 1224 ISPCS 2013, pp. 1-6, September 2013. 1226 Appendix A. (informative) TICTOC Security Requirements 1228 The following table compares the NTS specifications against the 1229 TICTOC security requirements [RFC7384]. 1231 +---------+------------------------------+-------------+------------+ 1232 | Section | Requirement from RFC 7384 | Requirement | NTS | 1233 | | | level | | 1234 +---------+------------------------------+-------------+------------+ 1235 | 5.1.1 | Authentication of Servers | MUST | OK | 1236 +---------+------------------------------+-------------+------------+ 1237 | 5.1.1 | Authorization of Servers | MUST | OK | 1238 +---------+------------------------------+-------------+------------+ 1239 | 5.1.2 | Recursive Authentication of | MUST | OK | 1240 | | Servers (Stratum 1) | | | 1241 +---------+------------------------------+-------------+------------+ 1242 | 5.1.2 | Recursive Authorization of | MUST | OK | 1243 | | Servers (Stratum 1) | | | 1244 +---------+------------------------------+-------------+------------+ 1245 | 5.1.3 | Authentication and | MAY | Optional, | 1246 | | Authorization of Clients | | Limited | 1247 +---------+------------------------------+-------------+------------+ 1248 | 5.2 | Integrity protection | MUST | OK | 1249 +---------+------------------------------+-------------+------------+ 1250 | 5.3 | Spoofing Prevention | MUST | OK | 1251 +---------+------------------------------+-------------+------------+ 1252 | 5.4 | Protection from DoS attacks | SHOULD | OK | 1253 | | against the time protocol | | | 1254 +---------+------------------------------+-------------+------------+ 1255 | 5.5 | Replay protection | MUST | OK | 1256 +---------+------------------------------+-------------+------------+ 1257 | 5.6 | Key freshness | MUST | OK | 1258 +---------+------------------------------+-------------+------------+ 1259 | | Security association | SHOULD | OK | 1260 +---------+------------------------------+-------------+------------+ 1261 | | Unicast and multicast | SHOULD | OK | 1262 | | associations | | | 1263 +---------+------------------------------+-------------+------------+ 1264 | 5.7 | Performance: no degradation | MUST | OK | 1265 | | in quality of time transfer | | | 1266 +---------+------------------------------+-------------+------------+ 1267 | | Performance: lightweight | SHOULD | OK | 1268 | | computation | | | 1269 +---------+------------------------------+-------------+------------+ 1270 | | Performance: storage | SHOULD | OK | 1271 +---------+------------------------------+-------------+------------+ 1272 | | Performance: bandwidth | SHOULD | OK | 1273 +---------+------------------------------+-------------+------------+ 1274 | 5.8 | Confidentiality protection | MAY | NO | 1275 +---------+------------------------------+-------------+------------+ 1276 | 5.9 | Protection against Packet | MUST | Limited*) | 1277 | | Delay and Interception | | | 1278 | | Attacks | | | 1279 +---------+------------------------------+-------------+------------+ 1280 | 5.10 | Secure mode | MUST | OK | 1281 +---------+------------------------------+-------------+------------+ 1282 | | Hybrid mode | SHOULD | - | 1283 +---------+------------------------------+-------------+------------+ 1285 *) See discussion in Section 10.5. 1287 Comparison of NTS specification against Security Requirements of Time 1288 Protocols in Packet Switched Networks (RFC 7384) 1290 Appendix B. (normative) Using TESLA for Broadcast-Type Messages 1292 For broadcast-type messages , NTS adopts the TESLA protocol with some 1293 customizations. This appendix provides details on the generation and 1294 usage of the one-way key chain collected and assembled from 1295 [RFC4082]. Note that NTS uses the "not re-using keys" scheme of 1296 TESLA as described in Section 3.7.2. of [RFC4082]. 1298 B.1. Server Preparation 1300 server setup: 1302 1. The server determines a reasonable upper bound B on the network 1303 delay between itself and an arbitrary client, measured in 1304 milliseconds. 1306 2. It determines the number n+1 of keys in the one-way key chain. 1307 This yields the number n of keys that are usable to authenticate 1308 broadcast packets. This number n is therefore also the number of 1309 time intervals during which the server can send authenticated 1310 broadcast messages before it has to calculate a new key chain. 1312 3. It divides time into n uniform intervals I_1, I_2, ..., I_n. 1313 Each of these time intervals has length L, measured in 1314 milliseconds. In order to fulfill the requirement 3.7.2. of RFC 1315 4082, the time interval L has to be shorter than the time 1316 interval between the broadcast messages. 1318 4. The server generates a random key K_n. 1320 5. Using a one-way function F, the server generates a one-way chain 1321 of n+1 keys K_0, K_1, ..., K_{n} according to 1323 K_i = F(K_{i+1}). 1325 6. Using another one-way function F', it generates a sequence of n 1326 MAC keys K'_0, K'_1, ..., K'_{n-1} according to 1328 K'_i = F'(K_i). 1330 7. Each MAC key K'_i is assigned to the time interval I_i. 1332 8. The server determines the key disclosure delay d, which is the 1333 number of intervals between using a key and disclosing it. Note 1334 that although security is provided for all choices d>0, the 1335 choice still makes a difference: 1337 * If d is chosen too short, the client might discard packets 1338 because it fails to verify that the key used for its MAC has 1339 not yet been disclosed. 1341 * If d is chosen too long, the received packets have to be 1342 buffered for an unnecessarily long time before they can be 1343 verified by the client and be subsequently utilized for time 1344 synchronization. 1346 The server SHOULD calculate d according to 1348 d = ceil( 2*B / L) + 1, 1350 where ceil yields the smallest integer greater than or equal to 1351 its argument. 1353 < - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1354 Generation of Keys 1356 F F F F 1357 K_0 <-------- K_1 <-------- ... <-------- K_{n-1} <------- K_n 1358 | | | | 1359 | | | | 1360 | F' | F' | F' | F' 1361 | | | | 1362 v v v v 1363 K'_0 K'_1 ... K'_{n-1} K'_n 1364 [______________|____ ____|_________________|_______] 1365 I_1 ... I_{n-1} I_n 1367 Course of Time/Usage of Keys 1368 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -> 1370 A schematic explanation of the TESLA protocol's one-way key chain 1372 B.2. Client Preparation 1374 A client needs the following information in order to participate in a 1375 TESLA broadcast: 1377 o One key K_i from the one-way key chain, which has to be 1378 authenticated as belonging to the server. Typically, this will be 1379 K_0. 1381 o The disclosure schedule of the keys. This consists of: 1383 * the length n of the one-way key chain, 1385 * the length L of the time intervals I_1, I_2, ..., I_n, 1387 * the starting time T_i of an interval I_i. Typically this is 1388 the starting time T_1 of the first interval; 1390 * the disclosure delay d. 1392 o The one-way function F used to recursively derive the keys in the 1393 one-way key chain, 1395 o The second one-way function F' used to derive the MAC keys K'_0, 1396 K'_1, ... , K'_n from the keys in the one-way chain. 1398 o An upper bound D_t on how far its own clock is "behind" that of 1399 the server. 1401 Note that if D_t is greater than (d - 1) * L, then some authentic 1402 packets might be discarded. If D_t is greater than d * L, then all 1403 authentic packets will be discarded. In the latter case, the client 1404 should not participate in the broadcast, since there will be no 1405 benefit in doing so. 1407 B.3. Sending Authenticated Broadcast Packets 1409 During each time interval I_i, the server sends at most one 1410 authenticated broadcast packet P_i. Such a packet consists of: 1412 o a message M_i, 1414 o the index i (in case a packet arrives late), 1416 o a MAC authenticating the message M_i, with K'_i used as key, 1418 o the key K_{i-d}, which is included for disclosure. 1420 B.4. Authentication of Received Packets 1422 When a client receives a packet P_i as described above, it first 1423 checks that it has not already received a packet with the same 1424 disclosed key. This is done to avoid replay/flooding attacks. A 1425 packet that fails this test is discarded. 1427 Next, the client begins to check the packet's timeliness by ensuring 1428 that according to the disclosure schedule and with respect to the 1429 upper bound D_t determined above, the server cannot have disclosed 1430 the key K_i yet. Specifically, it needs to check that the server's 1431 clock cannot read a time that is in time interval I_{i+d} or later. 1432 Since it works under the assumption that the server's clock is not 1433 more than D_t "ahead" of the client's clock, the client can calculate 1434 an upper bound t_i for the server's clock at the time when P_i 1435 arrived. This upper bound t_i is calculated according to 1437 t_i = R + D_t, 1439 where R is the client's clock at the arrival of P_i. This implies 1440 that at the time of arrival of P_i, the server could have been in 1441 interval I_x at most, with 1443 x = floor((t_i - T_1) / L) + 1, 1445 where floor gives the greatest integer less than or equal to its 1446 argument. The client now needs to verify that 1448 x < i+d 1450 is valid (see also Section 3.5 of [RFC4082]). If it is falsified, it 1451 is discarded. 1453 If the check above is successful, the client performs another more 1454 rigorous check: it sends a key check request to the server (in the 1455 form of a client_keycheck message), asking explicitly if K_i has 1456 already been disclosed. It remembers the time stamp t_check of the 1457 sending time of that request as well as the nonce it used correlated 1458 with the interval number i. If it receives an answer from the server 1459 stating that K_i has not yet been disclosed and it is able to verify 1460 the HMAC on that response, then it deduces that K_i was undisclosed 1461 at t_check and therefore also at R. In this case, the client accepts 1462 P_i as timely. 1464 Next the client verifies that a newly disclosed key K_{i-d} belongs 1465 to the one-way key chain. To this end, it applies the one-way 1466 function F to K_{i-d} until it can verify the identity with an 1467 earlier disclosed key (see Clause 3.5 in RFC 4082, item 3). 1469 Next the client verifies that the transmitted time value s_i belongs 1470 to the time interval I_i, by checking 1472 T_i =< s_i, and 1474 s_i < T_{i+1}. 1476 If it is falsified, the packet MUST be discarded and the client MUST 1477 reinitialize its broadcast module by performing time synchronization 1478 by other means than broadcast messages, and it MUST perform a new 1479 broadcast parameter exchange (because a falsification of this check 1480 yields that the packet was not generated according to protocol, which 1481 suggests an attack). 1483 If a packet P_i passes all the tests listed above, it is stored for 1484 later authentication. Also, if at this time there is a package with 1485 index i-d already buffered, then the client uses the disclosed key 1486 K_{i-d} to derive K'_{i-d} and uses that to check the MAC included in 1487 package P_{i-d}. Upon success, it regards M_{i-d} as authenticated. 1489 Appendix C. (informative) Dependencies 1490 +---------+--------------+--------+-------------------------------+ 1491 | Issuer | Type | Owner | Description | 1492 +---------+--------------+--------+-------------------------------+ 1493 | Server | private key | server | Used for server_assoc, | 1494 | PKI | (signature) | | server_cook, server_bpar. | 1495 | +--------------+--------+ The server uses the private | 1496 | | public key | client | key to sign these messages. | 1497 | | (signature) | | The client uses the public | 1498 | +--------------+--------+ key to verify them. | 1499 | | certificate | server | The certificate is used in | 1500 | | | | server_assoc messages, for | 1501 | | | | verifying authentication and | 1502 | | | | (optionally) authorization. | 1503 +---------+--------------+--------+-------------------------------+ 1504 | Client | private key | client | The server uses the client's | 1505 | PKI | (encryption) | | public key to encrypt the | 1506 | +--------------+--------+ content of server_cook | 1507 | | public key | server | messages. The client uses | 1508 | | (encryption) | | the private key to decrypt | 1509 | +--------------+--------+ them. The certificate is | 1510 | | certificate | client | sent in client_cook messages, | 1511 | | | | where it is used for trans- | 1512 | | | | portation of the public key | 1513 | | | | as well as (optionally) for | 1514 | | | | verification of client | 1515 | | | | authorization. | 1516 +---------+--------------+--------+-------------------------------+ 1517 +------------<---------------+ 1518 | At least one | 1519 V successful | 1520 ++====[ ]===++ ++=====^=====++ 1521 || Cookie || ||Association|| 1522 || Exchange || || Exchange || 1523 ++====_ _===++ ++===========++ 1524 | 1525 | At least one 1526 | successful 1527 V 1528 ++=======[ ]=======++ 1529 || Unicast Time |>-----\ As long as further 1530 || Synchronization || | synchronization 1531 || Exchange(s) |<-----/ is desired 1532 ++=======_ _=======++ 1533 | 1534 \ Other (unspecified) 1535 Sufficient \ / methods which give 1536 accuracy \ either or / sufficient accuracy 1537 \----------\ /---------/ 1538 | 1539 | 1540 V 1541 ++========[ ]=========++ 1542 || Broadcast || 1543 || Parameter Exchange || 1544 ++========_ _=========++ 1545 | 1546 | One successful 1547 | per client 1548 V 1549 ++=======[ ]=======++ 1550 || Broadcast Time |>--------\ As long as further 1551 || Synchronization || | synchronization 1552 || Reception |<--------/ is desired 1553 ++=======_ _=======++ 1554 | 1555 / \ 1556 either / \ or 1557 /----------/ \-------------\ 1558 | | 1559 V V 1560 ++========[ ]========++ ++========[ ]========++ 1561 || Keycheck Exchange || || Keycheck Exchange || 1562 ++===================++ || with TimeSync || 1563 ++===================++ 1565 Authors' Addresses 1567 Dieter Sibold 1568 Physikalisch-Technische Bundesanstalt 1569 Bundesallee 100 1570 Braunschweig D-38116 1571 Germany 1573 Phone: +49-(0)531-592-8420 1574 Fax: +49-531-592-698420 1575 Email: dieter.sibold@ptb.de 1577 Stephen Roettger 1578 Google Inc. 1580 Email: stephen.roettger@googlemail.com 1582 Kristof Teichel 1583 Physikalisch-Technische Bundesanstalt 1584 Bundesallee 100 1585 Braunschweig D-38116 1586 Germany 1588 Phone: +49-(0)531-592-8421 1589 Email: kristof.teichel@ptb.de