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