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