idnits 2.17.1 draft-ietf-ntp-autokey-03.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- ** It looks like you're using RFC 3978 boilerplate. You should update this to the boilerplate described in the IETF Trust License Policy document (see https://trustee.ietf.org/license-info), which is required now. -- Found old boilerplate from RFC 3978, Section 5.1 on line 17. -- Found old boilerplate from RFC 3978, Section 5.5, updated by RFC 4748 on line 2325. -- Found old boilerplate from RFC 3979, Section 5, paragraph 1 on line 2336. -- Found old boilerplate from RFC 3979, Section 5, paragraph 2 on line 2343. -- Found old boilerplate from RFC 3979, Section 5, paragraph 3 on line 2349. 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 : ---------------------------------------------------------------------------- == There are 1 instance of lines with non-RFC2606-compliant FQDNs in the document. == The 'Obsoletes: ' line in the draft header should list only the _numbers_ of the RFCs which will be obsoleted by this document (if approved); it should not include the word 'RFC' in the list. -- The draft header indicates that this document obsoletes RFC1305, but the abstract doesn't seem to mention this, which it should. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust Copyright Line does not match the current year -- The document seems to lack a disclaimer for pre-RFC5378 work, but may have content which was first submitted before 10 November 2008. If you have contacted all the original authors and they are all willing to grant the BCP78 rights to the IETF Trust, then this is fine, and you can ignore this comment. If not, you may need to add the pre-RFC5378 disclaimer. (See the Legal Provisions document at https://trustee.ietf.org/license-info for more information.) -- The document date (June 9, 2008) is 5797 days in the past. Is this intentional? -- Found something which looks like a code comment -- if you have code sections in the document, please surround them with '' and '' lines. Checking references for intended status: Informational ---------------------------------------------------------------------------- == Outdated reference: A later version (-13) exists of draft-ietf-ntp-ntpv4-proto-09 -- Obsolete informational reference (is this intentional?): RFC 1305 (Obsoleted by RFC 5905) -- Obsolete informational reference (is this intentional?): RFC 2402 (Obsoleted by RFC 4302, RFC 4305) -- Obsolete informational reference (is this intentional?): RFC 2406 (Obsoleted by RFC 4303, RFC 4305) -- Obsolete informational reference (is this intentional?): RFC 2408 (Obsoleted by RFC 4306) -- Obsolete informational reference (is this intentional?): RFC 2510 (Obsoleted by RFC 4210) -- Obsolete informational reference (is this intentional?): RFC 2875 (Obsoleted by RFC 6955) -- Obsolete informational reference (is this intentional?): RFC 3280 (Obsoleted by RFC 5280) Summary: 1 error (**), 0 flaws (~~), 4 warnings (==), 16 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 Network Working Group B. Haberman, Ed. 3 Internet-Draft JHU/APL 4 Obsoletes: RFC 1305 D. Mills 5 (if approved) U. Delaware 6 Intended status: Informational June 9, 2008 7 Expires: December 11, 2008 9 Network Time Protocol Version 4 Autokey Specification 10 draft-ietf-ntp-autokey-03 12 Status of this Memo 14 By submitting this Internet-Draft, each author represents that any 15 applicable patent or other IPR claims of which he or she is aware 16 have been or will be disclosed, and any of which he or she becomes 17 aware will be disclosed, in accordance with Section 6 of BCP 79. 19 Internet-Drafts are working documents of the Internet Engineering 20 Task Force (IETF), its areas, and its working groups. Note that 21 other groups may also distribute working documents as Internet- 22 Drafts. 24 Internet-Drafts are draft documents valid for a maximum of six months 25 and may be updated, replaced, or obsoleted by other documents at any 26 time. It is inappropriate to use Internet-Drafts as reference 27 material or to cite them other than as "work in progress." 29 The list of current Internet-Drafts can be accessed at 30 http://www.ietf.org/ietf/1id-abstracts.txt. 32 The list of Internet-Draft Shadow Directories can be accessed at 33 http://www.ietf.org/shadow.html. 35 This Internet-Draft will expire on December 11, 2008. 37 Abstract 39 This memo describes the Autokey security model for authenticating 40 servers to clients using the Network Time Protocol (NTP) and public 41 key cryptography. Its design is based on the premise that IPSEC 42 schemes cannot be adopted intact, since that would preclude stateless 43 servers and severely compromise timekeeping accuracy. In addition, 44 PKI schemes presume authenticated time values are always available to 45 enforce certificate lifetimes; however, cryptographically verified 46 timestamps require interaction between the timekeeping and 47 authentication functions. 49 This memo includes the Autokey requirements analysis, design 50 principles and protocol specification. A detailed description of the 51 protocol states, events and transition functions is included. A 52 prototype of the Autokey design based on this memo has been 53 implemented, tested and documented in the NTP Version 4 (NTPv4) 54 software distribution for Unix, Windows and VMS at 55 http://www.ntp.org. 57 Table of Contents 59 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 4 60 2. NTP Security Model . . . . . . . . . . . . . . . . . . . . . . 4 61 3. Approach . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 62 4. Autokey Cryptography . . . . . . . . . . . . . . . . . . . . . 8 63 5. NTP Secure Groups . . . . . . . . . . . . . . . . . . . . . . 11 64 6. Identity Schemes . . . . . . . . . . . . . . . . . . . . . . . 15 65 7. Timestamps and Filestamps . . . . . . . . . . . . . . . . . . 16 66 8. Autokey Protocol Overview . . . . . . . . . . . . . . . . . . 18 67 9. Autokey Operations . . . . . . . . . . . . . . . . . . . . . . 20 68 10. Autokey Protocol Messages . . . . . . . . . . . . . . . . . . 21 69 10.1. No-Operation . . . . . . . . . . . . . . . . . . . . . . 24 70 10.2. Association Message (ASSOC) . . . . . . . . . . . . . . . 24 71 10.3. Certificate Message (CERT) . . . . . . . . . . . . . . . 24 72 10.4. Cookie Message (COOKIE) . . . . . . . . . . . . . . . . . 24 73 10.5. Autokey Message (AUTO) . . . . . . . . . . . . . . . . . 24 74 10.6. Leapseconds Values Message (LEAP) . . . . . . . . . . . . 25 75 10.7. Sign Message (SIGN) . . . . . . . . . . . . . . . . . . . 25 76 10.8. Identity Messages (IFF, GQ, MV) . . . . . . . . . . . . . 25 77 11. Autokey State Machine . . . . . . . . . . . . . . . . . . . . 25 78 11.1. Status Word . . . . . . . . . . . . . . . . . . . . . . . 25 79 11.2. Host State Variables . . . . . . . . . . . . . . . . . . 27 80 11.3. Client State Variables (all modes) . . . . . . . . . . . 29 81 11.4. Protocol State Transitions . . . . . . . . . . . . . . . 30 82 11.4.1. Server Dance . . . . . . . . . . . . . . . . . . . . 30 83 11.4.2. Broadcast Dance . . . . . . . . . . . . . . . . . . . 31 84 11.4.3. Symmetric Dance . . . . . . . . . . . . . . . . . . . 32 85 11.5. Error Recovery . . . . . . . . . . . . . . . . . . . . . 33 86 11.6. Security Considerations . . . . . . . . . . . . . . . . . 35 87 11.7. Protocol Vulnerability . . . . . . . . . . . . . . . . . 35 88 11.8. Clogging Vulnerability . . . . . . . . . . . . . . . . . 36 89 12. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 37 90 13. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . 37 91 14. References . . . . . . . . . . . . . . . . . . . . . . . . . . 37 92 14.1. Normative References . . . . . . . . . . . . . . . . . . 37 93 14.2. Informative References . . . . . . . . . . . . . . . . . 37 94 Appendix A. Timestamps, Filestamps and Partial Ordering . . . . . 38 95 Appendix B. Identity Schemes . . . . . . . . . . . . . . . . . . 39 96 Appendix C. Private Certificate (PC) Scheme . . . . . . . . . . . 40 97 Appendix D. Trusted Certificate (TC) Scheme . . . . . . . . . . . 40 98 Appendix E. Schnorr (IFF) Identity Scheme . . . . . . . . . . . . 41 99 Appendix F. Guillard-Quisquater (GQ) Identity Scheme . . . . . . 43 100 Appendix G. Mu-Varadharajan (MV) Identity Scheme . . . . . . . . 45 101 Appendix H. ASN.1 Encoding Rules . . . . . . . . . . . . . . . . 47 102 H.1. COOKIE request, IFF response, GQ response, MV response . 48 103 H.2. Certificates . . . . . . . . . . . . . . . . . . . . . . 48 104 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . . 50 105 Intellectual Property and Copyright Statements . . . . . . . . . . 52 107 1. Introduction 109 A distributed network service requires reliable, ubiquitous and 110 survivable provisions to prevent accidental or malicious attacks on 111 the servers and clients in the network or the values they exchange. 112 Reliability requires that clients can determine that received packets 113 are authentic; that is, were actually sent by the intended server and 114 not manufactured or modified by an intruder. Ubiquity requires that 115 a client can verify the authenticity of a server using only public 116 information. Survivability requires protection from faulty 117 implementations, improper operation and possibly malicious clogging 118 and replay attacks. 120 This memo describes a cryptographically sound and efficient 121 methodology for use in the Network Time Protocol (NTP) 122 [I-D.ietf-ntp-ntpv4-proto]. The various key agreement schemes 123 [RFC2408][RFC2412][RFC2522] proposed require per-association state 124 variables, which contradicts the principles of the remote procedure 125 call (RPC) paradigm in which servers keep no state for a possibly 126 large client population. An evaluation of the PKI model and 127 algorithms as implemented in the OpenSSL library leads to the 128 conclusion that any scheme requiring every NTP packet to carry a PKI 129 digital signature would result in unacceptably poor timekeeping 130 performance. 132 The Autokey protocol is based on a combination of PKI and a pseudo- 133 random sequence generated by repeated hashes of a cryptographic value 134 involving both public and private components. This scheme has been 135 implemented, tested and deployed in the Internet of today. A 136 detailed description of the security model, design principles and 137 implementation is presented in this memo. 139 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 140 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 141 document are to be interpreted as described in RFC 2119 [RFC2119]. 143 2. NTP Security Model 145 NTP security requirements are even more stringent than most other 146 distributed services. First, the operation of the authentication 147 mechanism and the time synchronization mechanism are inextricably 148 intertwined. Reliable time synchronization requires cryptographic 149 keys which are valid only over a designated time intervals; but, time 150 intervals can be enforced only when participating servers and clients 151 are reliably synchronized to UTC. In addition, the NTP subnet is 152 hierarchical by nature, so time and trust flow from the primary 153 servers at the root through secondary servers to the clients at the 154 leaves. 156 A client can claim authentic to dependent applications only if all 157 servers on the path to the primary servers are bone-fide authentic. 158 In order to emphasize this requirement, in this memo the notion of 159 "authentic" is replaced by "proventic", a noun new to English and 160 derived from provenance, as in the provenance of a painting. Having 161 abused the language this far, the suffixes fixable to the various 162 derivatives of authentic will be adopted for proventic as well. In 163 NTP each server authenticates the next lower stratum servers and 164 proventicates (authenticates by induction) the lowest stratum 165 (primary) servers. Serious computer linguists would correctly 166 interpret the proventic relation as the transitive closure of the 167 authentic relation. 169 It is important to note that the notion of proventic does not 170 necessarily imply the time is correct. A NTP client mobilizes a 171 number of concurrent associations with different servers and uses a 172 crafted agreement algorithm to pluck truechimers from the population 173 possibly including falsetickers. A particular association is 174 proventic if the server certificate and identity have been verified 175 by the means described in this memo. However, the statement "the 176 client is synchronized to proventic sources" means that the system 177 clock has been set using the time values of one or more proventic 178 associations and according to the NTP mitigation algorithms. 180 Over the last several years the IETF has defined and evolved the 181 IPSEC infrastructure for privacy protection and source authentication 182 in the Internet. The infrastructure includes the Encapsulating 183 Security Payload (ESP) [RFC2406] and Authentication Header (AH) 184 [RFC2402] for IPv4 and IPv6. Cryptographic algorithms that use these 185 headers for various purposes include those developed for the PKI, 186 including MD5 message digests, RSA digital signatures and several 187 variations of Diffie-Hellman key agreements. The fundamental 188 assumption in the security model is that packets transmitted over the 189 Internet can be intercepted by other than the intended recipient, 190 remanufactured in various ways and replayed in whole or part. These 191 packets can cause the client to believe or produce incorrect 192 information, cause protocol operations to fail, interrupt network 193 service or consume precious network and processor resources. 195 In the case of NTP, the assumed goal of the intruder is to inject 196 false time values, disrupt the protocol or clog the network, servers 197 or clients with spurious packets that exhaust resources and deny 198 service to legitimate applications. The mission of the algorithms 199 and protocols described in this memo is to detect and discard 200 spurious packets sent by other than the intended sender or sent by 201 the intended sender, but modified or replayed by an intruder. The 202 cryptographic means of the reference implementation are based on the 203 OpenSSL cryptographic software library available at www.openssl.org, 204 but other libraries with equivalent functionality could be used as 205 well. It is important for distribution and export purposes that the 206 way in which these algorithms are used precludes encryption of any 207 data other than incidental to the construction of digital signatures. 209 There are a number of defense mechanisms already built in the NTP 210 architecture, protocol and algorithms. The on-wire timestamp 211 exchange scheme is inherently resistant to spoofing, packet loss and 212 replay attacks. The engineered clock filter, selection and 213 clustering algorithms are designed to defend against evil cliques of 214 Byzantine traitors. While not necessarily designed to defeat 215 determined intruders, these algorithms and accompanying sanity checks 216 have functioned well over the years to deflect improperly operating 217 but presumably friendly scenarios. However, these mechanisms do not 218 securely identify and authenticate servers to clients. Without 219 specific further protection, an intruder can inject any or all of the 220 following attacks. 222 1. An intruder can intercept and archive packets forever, as well as 223 all the public values ever generated and transmitted over the 224 net. 226 2. An intruder can generate packets faster than the server, network 227 or client can process them, especially if they require expensive 228 cryptographic computations. 230 3. In a wiretap attack the intruder can intercept, modify and replay 231 a packet. However, it cannot permanently prevent onward 232 transmission of the original packet; that is, it cannot break the 233 wire, only tell lies and congest it. Except in unlikely cases 234 considered in Section 11.6, the modified packet cannot arrive at 235 the victim before the original packet, nor does it have the 236 server private keys or identity parameters. 238 4. In a middleman or masquerade attack the intruder is positioned 239 between the server and client, so it can intercept, modify and 240 replay a packet and prevent onward transmission of the original 241 packet. Except in unlikely cases considered in Section 11.6, the 242 middleman does not have the server private keys. 244 The NTP security model assumes the following possible limitations. 246 1. The running times for public key algorithms are relatively long 247 and highly variable. In general, the performance of the time 248 synchronization function is badly degraded if these algorithms 249 must be used for every NTP packet. 251 2. In some modes of operation it is not feasible for a server to 252 retain state variables for every client. It is however feasible 253 to regenerated them for a client upon arrival of a packet from 254 that client. 256 3. The lifetime of cryptographic values must be enforced, which 257 requires a reliable system clock. However, the sources that 258 synchronize the system clock must be cryptographically 259 proventicated. This circular interdependence of the timekeeping 260 and proventication functions requires special handling. 262 4. Client security functions must involve only public values 263 transmitted over the net. Private values must never be disclosed 264 beyond the machine on which they were created, except in the case 265 of a special trusted agent (TA) assigned for this purpose. 267 Unlike the Secure Shell security model, where the client must be 268 securely authenticated to the server, in NTP the server must be 269 securely authenticated to the client. In ssh each different 270 interface address can be bound to a different name, as returned by a 271 reverse-DNS query. In this design separate public/private key pairs 272 may be required for each interface address with a distinct name. A 273 perceived advantage of this design is that the security compartment 274 can be different for each interface. This allows a firewall, for 275 instance, to require some interfaces to authenticate the client and 276 others not. 278 3. Approach 280 The Autokey protocol described in this memo is designed to meet the 281 following objectives. In-depth discussions on these objectives is in 282 the web briefings and will not be elaborated in this memo. Note that 283 here and elsewhere in this memo mention of broadcast mode means 284 multicast mode as well, with exceptions as noted in the NTP software 285 documentation. 287 1. It must interoperate with the existing NTP architecture model and 288 protocol design. In particular, it must support the symmetric 289 key scheme described in [RFC1305]. As a practical matter, the 290 reference implementation must use the same internal key 291 management system, including the use of 32-bit key IDs and 292 existing mechanisms to store, activate and revoke keys. 294 2. It must provide for the independent collection of cryptographic 295 values and time values. A NTP packet is accepted for processing 296 only when the required cryptographic values have been obtained 297 and verified and the packet has passed all header sanity checks. 299 3. It must not significantly degrade the potential accuracy of the 300 NTP synchronization algorithms. In particular, it must not make 301 unreasonable demands on the network or host processor and memory 302 resources. 304 4. It must be resistant to cryptographic attacks, specifically those 305 identified in the security model above. In particular, it must 306 be tolerant of operational or implementation variances, such as 307 packet loss or disorder, or suboptimal configurations. 309 5. It must build on a widely available suite of cryptographic 310 algorithms, yet be independent of the particular choice. In 311 particular, it must not require data encryption other than 312 incidental to signature and cookie encryption operations. 314 6. It must function in all the modes supported by NTP, including 315 server, symmetric and broadcast modes. 317 4. Autokey Cryptography 319 Autokey cryptography is based on the PKI algorithms commonly used in 320 the Secure Shell and Secure Sockets Layer applications. As in these 321 applications Autokey uses message digests to detect packet 322 modification, digital signatures to verify credentials and public 323 certificates to provide traceable authority. What makes Autokey 324 cryptography unique is the way in which these algorithms are used to 325 deflect intruder attacks while maintaining the integrity and accuracy 326 of the time synchronization function. 328 NTPv3 and NTPv4 symmetric key cryptography uses keyed-MD5 message 329 digests with a 128-bit private key and 32-bit key ID. In order to 330 retain backward compatibility with NTPv3, the NTPv4 key ID space is 331 partitioned in two subspaces at a pivot point of 65536. Symmetric 332 key IDs have values less than the pivot and indefinite lifetime. 333 Autokey key IDs have pseudo-random values equal to or greater than 334 the pivot and are expunged immediately after use. 336 Both symmetric key and public key cryptography authenticate as shown 337 in Figure 1. The server looks up the key associated with the key ID 338 and calculates the message digest from the NTP header and extension 339 fields together with the key value. The key ID and digest form the 340 message authentication code (MAC) included with the message. The 341 client does the same computation using its local copy of the key and 342 compares the result with the digest in the MAC. If the values agree, 343 the message is assumed authentic. 345 +------------------+ 346 | NTP Header and | 347 | Extension Fields | 348 +------------------+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 349 | | | Message Authenticator Code | 350 \|/ \|/ + (MAC) + 351 ******************** | +-------------------------+ | 352 * Compute Hash *<----| Key ID | Message Digest | + 353 ******************** | +-------------------------+ | 354 | +-+-+-+-+-+-+-|-+-+-+-+-+-+-+-+-+ 355 \|/ \|/ 356 +------------------+ +-------------+ 357 | Message Digest |------>| Compare | 358 +------------------+ +-------------+ 360 Figure 1: Message Authentication 362 Autokey uses specially contrived session keys, called autokeys, and a 363 precomputed pseudo-random sequence of autokeys which are saved in the 364 autokey list. The Autokey protocol operates separately for each 365 association, so there may be several autokey sequences operating 366 independently at the same time. 368 +-------------+-------------+--------+--------+ 369 | Src Address | Dst Address | Key ID | Cookie | 370 +-------------+-------------+--------+--------+ 372 Figure 2: NTPv4 Autokey 374 An autokey is computed from four fields in network byte order as 375 shown in Figure 2. The four values are hashed by the MD5 message 376 digest algorithm to produce the 128-bit autokey value, which in the 377 reference implementation is stored along with the key ID in a cache 378 used for symmetric keys as well as autokeys. Keys are retrieved from 379 the cache by key ID using hash tables and a fast lookup algorithm. 381 For use with IPv4 the Source Address and Dest Address fields contain 382 32 bits; for use with IPv6 these fields contain 128 bits. In either 383 case the Key ID and Cookie fields contain 32 bits. Thus, an IPv4 384 autokey has four 32-bit words, while an IPv6 autokey has ten 32-bit 385 words. The source and destination addresses and key ID are public 386 values visible in the packet, while the cookie can be a public value 387 or shared private value, depending on the NTP mode. 389 The NTP packet format has been augmented to include one or more 390 extension fields piggybacked between the original NTP header and the 391 MAC. For packets without extension fields, the cookie is a shared 392 private value. For packets with extension fields, the cookie has a 393 default public value of zero, since these packets are validated 394 independently using digital signatures. 396 There are some scenarios where the use of endpoint IP addresses may 397 be difficult or impossible. These include configurations where 398 network address translation (NAT) devices are in use or when 399 addresses are changed during an association lifetime due to mobility 400 constraints. For Autokey, the only restriction is that the address 401 fields visible in the transmitted packet must be the same as those 402 used to construct the autokey list and that these fields be the same 403 as those visible in the received packet. [The use of alternative 404 means, such as Autokey host names (discussed later) or hashes of 405 these names may be a topic for future study.] 407 +-----------+-----------+------+------+ +---------+ +-----+------+ 408 |Src Address|Dst Address|Key ID|Cookie|-->| | |Final|Final | 409 +-----------+-----------+------+------+ | Session | |Index|Key ID| 410 | | | | | Key ID | +-----+------+ 411 \|/ \|/ \|/ \|/ | List | | | 412 ************************************* +---------+ \|/ \|/ 413 * COMPUTE HASH * ******************* 414 ************************************* *COMPUTE SIGNATURE* 415 | Index n ******************* 416 \|/ | 417 +--------+ | 418 | Next | \|/ 419 | Key ID | +-----------+ 420 +--------+ | Signature | 421 Index n+1 +-----------+ 423 Figure 3: Constructing the Key List 425 Figure 3 shows how the autokey list and autokey values are computed. 426 The key IDs used in the autokey list consists of a sequence starting 427 with a random 32-bit nonce (autokey seed) equal to or greater than 428 the pivot as the first key ID. The first autokey is computed as 429 above using the given cookie and autokey seed and assigned index 0. 430 The first 32 bits of the result in network byte order become the next 431 The MD5 hash of the autokey is the key value saved in the key cache 432 along with the key ID. The first 32 bits of the key become the key 433 ID for the next autokey assigned index 1. 435 Operations continue to generate the entire list. It may happen that 436 a newly generated key ID is less than the pivot or collides with 437 another one already generated (birthday event). When this happens, 438 which occurs only rarely, the key list is terminated at that point. 439 The lifetime of each key is set to expire one poll interval after its 440 scheduled use. In the reference implementation, the list is 441 terminated when the maximum key lifetime is about one hour, so for 442 poll intervals above one hour a new key list containing only a single 443 entry is regenerated for every poll. 445 +------------------+ 446 | NTP Header and | 447 | Extension Fields | 448 +------------------+ 449 | | 450 \|/ \|/ +---------+ 451 **************** +--------+ | Session | 452 * COMPUTE HASH *<---| Key ID |<---| Key ID | 453 **************** +--------+ | List | 454 | | +---------+ 455 \|/ \|/ 456 +----------------------------------+ 457 | Message Authenticator Code (MAC) | 458 +----------------------------------+ 460 Figure 4: Transmitting Messages 462 The index of the last autokey in the list is saved along with the key 463 ID for that entry, collectively called the autokey values. The 464 autokey values are then signed for use later. The list is used in 465 reverse order as shown in Figure 4, so that the first autokey used is 466 the last one generated. 468 The Autokey protocol includes a message to retrieve the autokey 469 values and verify the signature, so that subsequent packets can be 470 validated using one or more hashes that eventually match the last key 471 ID (valid) or exceed the index (invalid). This is called the autokey 472 test in the following and is done for every packet, including those 473 with and without extension fields. In the reference implementation 474 the most recent key ID received is saved for comparison with the 475 first 32 bits in network byte order of the next following key value. 476 This minimizes the number of hash operations in case a single packet 477 is lost. 479 5. NTP Secure Groups 481 NTP secure groups are used to define cryptographic compartments and 482 security hierarchies. A secure group consists of a number of hosts 483 dynamically assembled as a forest with roots the trusted hosts (THs) 484 at the lowest stratum of the group. The THs do not have to be, but 485 often are, primary (stratum 1) servers. A trusted authority (TA), 486 not necessarily a group host, generates private identity keys for 487 servers and public identity keys for clients at the leaves of the 488 forest. The TA deploys the server keys to the THs and other 489 designated servers using secure means and posts the client keys on a 490 public web site. 492 For Autokey purposes all hosts belonging to a secure group have the 493 same group name but different host names, not necessarily related to 494 the DNS names. The group name is used in the subject and issuer 495 fields of the TH certificates; the host name is used in these fields 496 for other hosts. Thus, all host certificates are self-signed. 497 During the Autokey protocol a client requests the server to sign its 498 certificate and caches the result. A certificate trail is 499 constructed by each host, possibly via intermediate hosts and ending 500 at a TH. Thus, each host along the trail retrieves the entire trail 501 from its server(s) and provides this plus its own signed certificates 502 to its clients. 504 Secure groups can be configured as hierarchies where a TH of one 505 group can be a client of one or more other groups operating at a 506 lower stratum. In one scenario, groups RED and GREEN can be 507 cryptographically distinct, but both be clients of group BLUE 508 operating at a lower stratum. In another scenario, group CYAN can be 509 a client of multiple groups YELLOW and MAGENTA, both operating at a 510 lower stratum. There are many other scenarios, but all must be 511 configured to include only acyclic certificate trails. 513 In Figure 5, the Alice group consists of THs Alice, which is also the 514 TA, and Carol. Dependent servers Brenda and Denise have configured 515 Alice and Carol, respectively, as their time sources. Stratum 3 516 server Eileen has configured both Brenda and Denise as her time 517 sources. Public certificates are identified by the subject and 518 signed by the issuer. Note that the server keys have been previously 519 installed on Brenda and Denise and the client keys installed on all 520 machines. 522 +-------------+ +-------------+ +-------------+ 523 | Alice | | Brenda | | Denise | 524 | | | | | | 525 | +-+-+-+-+ | | +-+-+-+-+ | | +-+-+-+-+ | 526 Certificate | | Alice | | | | Brenda| | | | Denise| | 527 +-+-+-+-+-+ | +-+-+-+-+ | | +-+-+-+-+ | | +-+-+-+-+ | 528 | Subject | | | Alice*| 1 | | | Alice | 4 | | | Carol | 4 | 529 +-+-+-+-+-+ | +-+-+-+-+ | | +-+-+-+-+ | | +-+-+-+-+ | 530 | Issuer | S | | | | | | 531 +-+-+-+-+-+ | +=======+ | | +-+-+-+-+ | | +-+-+-+-+ | 532 | ||Alice|| 3 | | | Alice | | | | Carol | | 533 Group Key | +=======+ | | +-+-+-+-+ | | +-+-+-+-+ | 534 +=========+ +-------------+ | | Alice*| 2 | | | Carol*| 2 | 535 || Group || S | Carol | | +-+-+-+-+ | | +-+-+-+-+ | 536 +=========+ | | | | | | 537 | +-+-+-+-+ | | +-+-+-+-+ | | +-+-+-+-+ | 538 S = step | | Carol | | | | Brenda| | | | Denise| | 539 * = trusted | +-+-+-+-+ | | +-+-+-+-+ | | +-+-+-+-+ | 540 | | Carol*| 1 | | | Brenda| 1 | | | Denise| 1 | 541 | +-+-+-+-+ | | +-+-+-+-+ | | +-+-+-+-+ | 542 | | | | | | 543 | +=======+ | | +=======+ | | +=======+ | 544 | ||Alice|| 3 | | ||Alice|| 3 | | ||Alice|| 3 | 545 | +=======+ | | +=======+ | | +=======+ | 546 +-------------+ +-------------+ +-------------+ 547 Stratum 1 Stratum 2 549 +---------------------------------------------+ 550 | Eileen | 551 | | 552 | +-+-+-+-+ +-+-+-+-+ | 553 | | Eileen| | Eileen| | 554 | +-+-+-+-+ +-+-+-+-+ | 555 | | Brenda| | Carol | 4 | 556 | +-+-+-+-+ +-+-+-+-+ | 557 | | 558 | +-+-+-+-+ +-+-+-+-+ | 559 | | Alice | | Carol | | 560 | +-+-+-+-+ +-+-+-+-+ | 561 | | Alice*| | Carol*| 2 | 562 | +-+-+-+-+ +-+-+-+-+ | 563 | | 564 | +-+-+-+-+ +-+-+-+-+ | 565 | | Brenda| | Denise| | 566 | +-+-+-+-+ +-+-+-+-+ | 567 | | Alice | | Carol | 2 | 568 | +-+-+-+-+ +-+-+-+-+ | 569 | | 570 | +-+-+-+-+ | 571 | | Eileen| | 572 | +-+-+-+-+ | 573 | | Eileen| 1 | 574 | +-+-+-+-+ | 575 | | 576 | +=======+ | 577 | ||Alice|| 3 | 578 | +=======+ | 579 +---------------------------------------------+ 580 Stratum 3 582 Figure 5: NTP Secure Groups 584 The steps in hiking the certificate trails and verifying identity are 585 as follows. Note the step number in the description matches the step 586 number in the figure. 588 1. The girls start by loading the host key, sign key, self-signed 589 certificate and group key. They start the Autokey protocol by 590 exchanging host names and negotiating digest/signature schemes 591 and identity schemes. 593 2. They continue to load certificates recursively until a self- 594 signed trusted certificate is found. Brenda and Denise 595 immediately find trusted certificates for Alice and Carol, 596 respectively, but Eileen will loop because neither Brenda nor 597 Denise have their own certificates signed by either Alice or 598 Carol. 600 3. Brenda and Denise continue with the selected identity schemes to 601 verify that Alice and Carol have the correct group key previously 602 generated by Alice. If this succeeds, each continues in step 4. 604 4. Brenda and Denise present their certificates for signature. If 605 this succeeds, either or both Brenda and Denise can now provide 606 these signed certificates to Eileen, which may be looping in step 607 2. Eileen can now verify the trail via either Brenda or Denise 608 to the trusted certificates for Alice and Carol. Once this is 609 done, Eileen can complete the protocol just as Brenda and Denise. 611 For various reasons it may be convenient for a server to have client 612 keys for more than one group. For example, Figure 6 shows three 613 secure groups Alice, Helen and Carol arranged in a hierarchy. Hosts 614 A, B, C and D belong to Alice, R, S to Helen and X, Y and Z belong to 615 Carol. While not strictly necessary, hosts A, B and R are stratum 1 616 and presumed trusted, but the TA generating the identity keys could 617 be one of them or another not shown. 619 ***** ***** @@@@@ 620 Stratum 1 * A * * B * @ R @ 621 ***** ***** @@@@@ 622 \ / / 623 \ / / 624 ***** @@@@@ ********* 625 2 * C * @ S @ * Alice * 626 ***** @@@@@ ********* 627 / \ / 628 / \ / @@@@@@@@@ 629 ***** ##### @ Helen @ 630 3 * D * # X # @@@@@@@@@ 631 ***** ##### 632 / \ ######### 633 / \ # Carol # 634 ##### ##### ######### 635 4 # Y # # Z # 636 ##### ##### 638 Figure 6: Hierarchical Overlapping Groups 640 The intent of the scenario is to provide security separation, so that 641 servers cannot masquerade as in other groups and clients cannot 642 masquerade as servers. Assume for example that Alice and Helen 643 belong to national standards laboratories and their server keys are 644 used to confirm identity between members of each group. Carol is a 645 prominent corporation receiving standards products and requiring 646 cryptographic authentication. Perhaps under contract, host X 647 belonging to Carol has client keys for both Alice and Helen and 648 server keys for Carol. The Autokey protocol operates for each group 649 separately while preserving security separation. Host X can prove 650 identity in Carol to clients Y and Z, but cannot prove to anybody 651 that it belongs to either Alice or Helen. 653 6. Identity Schemes 655 A digital signature scheme provides secure server authentication, but 656 it does not provide protection against masquerade, unless the server 657 identity is verified by other means. The PKI model requires a server 658 to prove identity to the client by a certificate trail, but 659 independent means such as a drivers license are required for a CA to 660 sign the server certificate. While Autokey supports this model by 661 default, in a hierarchical ad-hoc network, especially with server 662 discovery schemes like NTP Manycast, proving identity at each rest 663 stop on the trail must be an intrinsic capability of Autokey itself. 665 While the identity scheme described in [RFC2875] is based on a 666 ubiquitous Diffie-Hellman infrastructure, it is expensive to generate 667 and use when compared to others described in Appendix B. In 668 principle, an ordinary public key scheme could be devised for this 669 purpose, but the most stringent Autokey design requires that every 670 challenge, even if duplicated, results in a different acceptable 671 response. 673 There are five schemes now implemented in the NTPv4 reference 674 implementation to prove identity: (1) private certificate (PC), (2) 675 trusted certificate (TC), (3) a modified Schnorr algorithm (IFF aka 676 Identify Friendly or Foe), (4) a modified Guillou-Quisquater 677 algorithm (GQ), and (5) a modified Mu-Varadharajan algorithm (MV). 678 Following is a summary description of each; details are given in 679 Appendix B. 681 The PC scheme involves a private certificate as group key. The 682 certificate is distributed to all other group members by secure means 683 and is never revealed outside the group. In effect, the private 684 certificate is used as a symmetric key. This scheme is used 685 primarily for testing and development and is not recommended for 686 regular use and is not considered further in this memo. 688 All other schemes involve a conventional certificate trail as 689 described in RFC 2510 [RFC2510]. This is the default scheme when an 690 identity scheme is not specified. While the remaining identity 691 schemes incorporate TC, it is not by itself considered further in 692 this memo. 694 The three remaining schemes IFF, GQ and MV involve a 695 cryptographically strong challenge-response exchange where an 696 intruder cannot deduce the server key, even after repeated 697 observations of multiple exchanges. In addition, the MV scheme is 698 properly described as a zero-knowledge proof, because the client can 699 verify the server has the correct group key without either the server 700 or client knowing its value. These schemes start when the client 701 sends a nonce to the server, which then rolls its own nonce, performs 702 a mathematical operation and sends the results to the client. The 703 client performs another mathematical operation and verifies the 704 results are correct. 706 7. Timestamps and Filestamps 708 While public key signatures provide strong protection against 709 misrepresentation of source, computing them is expensive. This 710 invites the opportunity for an intruder to clog the client or server 711 by replaying old messages or originating bogus messages. A client 712 receiving such messages might be forced to verify what turns out to 713 be an invalid signature and consume significant processor resources. 714 In order to foil such attacks, every Autokey message carries a 715 timestamp in the form of the NTP seconds when it was. If the system 716 clock is synchronized to a proventic source, a signature is produced 717 with valid (nonzero) timestamp. Otherwise, there is no signature and 718 the timestamp is invalid (zero). The protocol detects and discards 719 extension fields with old or duplicate timestamps, before any values 720 are used or signatures are verified. 722 Signatures are computed only when cryptographic values are created or 723 modified, which is by design not very often. Extension fields 724 carrying these signatures are copied to messages as needed, but the 725 signatures are not recomputed. There are three signature types: 727 1. Cookie signature/timestamp. The cookie is signed when created by 728 the server and sent to the client. 730 2. Autokey signature/timestamp. The autokey values are signed when 731 the key list is created. 733 3. Public values signature/timestamp. The public key, certificate 734 and leapsecond values are signed at the time of generation, which 735 occurs when the system clock is first synchronized to a proventic 736 source, when the values have changed and about once per day after 737 that, even if these values have not changed. 739 The most recent timestamp received of each type is saved for 740 comparison. Once a signature with valid timestamp has been received, 741 messages with invalid timestamps or earlier valid timestamps of the 742 same type are discarded before the signature is verified. This is 743 most important in broadcast mode, which could be vulnerable to a 744 clogging attack without this test. 746 All cryptographic values used by the protocol are time sensitive and 747 are regularly refreshed. In particular, files containing 748 cryptographic values used by signature and encryption algorithms are 749 regenerated from time to time. It is the intent that file 750 regenerations occur without specific advance warning and without 751 requiring prior distribution of the file contents. While 752 cryptographic data files are not specifically signed, every file is 753 associated with a filestamp showing the NTP seconds at the creation 754 epoch. 756 Filestamps and timestamps can be compared in any combination and use 757 the same conventions. It is necessary to compare them from time to 758 time to determine which are earlier or later. Since these quantities 759 have a granularity only to the second, such comparisons are ambiguous 760 if the values are in the same second. 762 It is important that filestamps be proventic data; thus, they cannot 763 be produced unless the producer has been synchronized to a proventic 764 source. As such, the filestamps throughout the NTP subnet represent 765 a partial ordering of all creation epochs and serve as means to 766 expunge old data and insure new data are consistent. As the data are 767 forwarded from server to client, the filestamps are preserved, 768 including those for certificate and leapseconds values. Packets with 769 older filestamps are discarded before spending cycles to verify the 770 signature. 772 8. Autokey Protocol Overview 774 The Autokey protocol includes a number of request/response exchanges 775 that must be completed in order. In each exchange a client sends a 776 request message with data and expects a server response message with 777 data. Requests and responses are contained in extension fields, one 778 request or response in each field, as described later. An NTP packet 779 can contain one request message and one or more response messages. 780 Following is a list of these messages. 782 o Parameter exchange. The request includes the client host name and 783 status word; the response includes the server host name and status 784 word. The status word specifies the digest/signature scheme to 785 use and the identity schemes supported. 787 o Certificate exchange. The request includes the subject name of a 788 certificate; the response consists of a signed certificate with 789 that subject name. If the issuer name is not the same as the 790 subject name, it has been signed by a host one step closer to a 791 trusted host, so certificate retrieval continues for the issuer 792 name. If it is trusted and self-signed, the trail concludes at 793 the trusted host. If nontrusted and self-signed, the host 794 certificate has not yet been signed, so the trail temporarily 795 loops. Completion of this exchange lights the VAL bit as 796 described below. 798 o Identity exchange. The certificate trail is generally not 799 considered sufficient protection against middleman attacks unless 800 additional protection such as the proof-of-possession scheme 801 described in [RFC2875] is available, but this is expensive and 802 requires servers to retain state. Autokey can use one of the 803 challenge/response identity schemes described in Appendix B. 804 Completion of this exchange lights the IFF bit as described below. 806 o Cookie exchange. The request includes the public key of the. The 807 response includes the server cookie encrypted with this key. The 808 client uses this value when constructing the key list. Completion 809 of this exchange lights the COOK bit as described below. 811 o Autokey exchange. The request includes either no data or the 812 autokey values in symmetric modes. The response includes the 813 autokey values of the server. These values are used to verify the 814 autokey sequence. Completion of this exchange lights the AUT bit 815 as described below. 817 o Sign exchange. This exchange is executed only when the client has 818 synchronized to a proventic source. The request includes the 819 self-signed client certificate. The server acting as CA 820 interprets the certificate as a X.509v3 certificate request. It 821 extracts the subject, issuer, and extension fields, builds a new 822 certificate with these data along with its own serial number and 823 expiration time, then signs it using its own public key and 824 includes it in the response. The client uses the signed 825 certificate in its own role as server for dependent clients. 826 Completion of this exchange lights the SIGN bit as described 827 below. 829 o Leapseconds exchange. This exchange is executed only when the 830 client has synchronized to a proventic source. This exchange 831 occurs when the server has the leapseconds values, as indicated in 832 the host status word. If so, the client requests the values and 833 compares them with its own values, if available. If the server 834 values are newer than the client values, the client replaces its 835 own with the server values. The client, acting as server, can now 836 provide the most recent values to its dependent clients. In 837 symmetric mode, this results in both peers having the newest 838 values. Completion of this exchange lights the LPT bit as 839 described below. 841 Once the certificates and identity have been validated, subsequent 842 packets are validated by digital signatures and the autokey sequence. 843 The association is now proventic with respect to the downstratum 844 trusted host, but is not yet selectable to discipline the system 845 clock. The associations accumulate time values and the mitigation 846 algorithms continue in the usual way. When these algorithms have 847 culled the falsetickers and cluster outlyers and at least three 848 survivors remain, the system clock has been synchronized to a 849 proventic source. 851 The time values for truechimer sources form a proventic partial 852 ordering relative to the applicable signature timestamps. This 853 raises the interesting issue of how to mitigate between the 854 timestamps of different associations. It might happen, for instance, 855 that the timestamp of some Autokey message is ahead of the system 856 clock by some presumably small amount. For this reason, timestamp 857 comparisons between different associations and between associations 858 and the system clock are avoided, except in the NTP intersection and 859 clustering algorithms and when determining whether a certificate has 860 expired. 862 9. Autokey Operations 864 The NTP protocol has three principal modes of operation: client/ 865 server, symmetric and broadcast and each has its own Autokey program, 866 or dance. Autokey choreography is designed to be nonintrusive and to 867 require no additional packets other than for regular NTP operations. 868 The NTP and Autokey protocols operate simultaneously and 869 independently. When the dance is complete, subsequent packets are 870 validated by the autokey sequence and thus considered proventic as 871 well. Autokey assumes NTP clients poll servers at a relatively low 872 rate, such as once per minute or slower. In particular, it assumes 873 that a request sent at one poll opportunity will normally result in a 874 response before the next poll opportunity; however the protocol is 875 robust against a missed or duplicate response. 877 The server dance was suggested by Steve Kent over lunch some time 878 ago, but considerably modified since that meal. The server keeps no 879 state for each client, but uses a fast algorithm and a 32-bit random 880 private value (server seed) to regenerate the cookie upon arrival of 881 a client packet. The cookie is calculated as the first 32 bits of 882 the autokey computed from the client and server addresses, key ID 883 zero and the server seed as cookie. The cookie is used for the 884 actual autokey calculation by both the client and server and is thus 885 specific to each client separately. 887 In the server dance the client uses the cookie and each key ID on the 888 key list in turn to retrieve the autokey and generate the MAC. The 889 server uses the same values to generate the message digest and 890 verifies it matches the MAC. It then generates the MAC for the 891 response using the same values, but with the client and server 892 addresses interchanged. The client generates the message digest and 893 verifies it matches the MAC. In order to deflect old replays, the 894 client verifies the key ID matches the last one sent. In this dance 895 the sequential structure of the key list is not exploited, but doing 896 it this way simplifies and regularizes the implementation while 897 making it nearly impossible for an intruder to guess the next key ID. 899 In the broadcast dance clients normally do not send packets to the 900 server, except when first starting up. At that time the client runs 901 the server dance to verify the server credentials and calibrate the 902 propagation delay. The dance requires the association ID of the 903 particular server association, since there can be more than one 904 operating in the same server. For this purpose, the server packet 905 includes the association ID in every response message sent and, when 906 sending the first packet after generating a new key list, it sends 907 the autokey values as well. After obtaining and verifying the 908 autokey values, no extension fields are necessary and the client 909 verifies further server packets using the autokey sequence. 911 The symmetric dance is similar to the server dance and requires only 912 a small amount of state between the arrival of a request and 913 departure of the response. The key list for each direction is 914 generated separately by each peer and used independently, but each is 915 generated with the same cookie. The cookie is conveyed in a way 916 similar to the server dance, except that the cookie is a simple 917 nonce. There exists a possible race condition where each peer sends 918 a cookie request before receiving the cookie response from the other 919 peer. In this case each peer winds up with two values, one it 920 generated and one the other peer generated. The ambiguity is 921 resolved simply by computing the working cookie as the EXOR of the 922 two values. 924 Once the autokey dance has completed, it is normally dormant. In all 925 except the broadcast dance, packets are normally sent without 926 extension fields, unless the packet is the first one sent after 927 generating a new key list or unless the client has requested the 928 cookie or autokey values. If for some reason the client clock is 929 stepped, rather than slewed, all cryptographic and time values for 930 all associations are purged and the dances in all associations 931 restarted from scratch. This insures that stale values never 932 propagate beyond a clock step. 934 10. Autokey Protocol Messages 936 The Autokey protocol data unit is the extension field, one or more of 937 which can be piggybacked in the NTP packet. An extension field 938 contains either a request with optional data or a response with 939 optional data. To avoid deadlocks, any number of responses can be 940 included in a packet, but only one request. A response is generated 941 for every request, even if the requestor is not synchronized to a 942 proventic source, but most contain meaningful data only if the 943 responder is synchronized to a proventic source. Some requests and 944 most responses carry timestamped signatures. The signature covers 945 the entire extension field, including the timestamp and filestamp, 946 where applicable. Only if the packet passes all extension field 947 tests are cycles spent to verify the signature. 949 There are currently eight Autokey requests and eight corresponding 950 responses. The NTP packet format is described in 952 [I-D.ietf-ntp-ntpv4-proto] and the extension field format used for 953 these messages is illustrated in Figure 7. 955 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 956 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 957 |R|E| Code | Field Type | Length | 958 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 959 | Association ID | 960 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 961 | Timestamp | 962 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 963 | Filestamp | 964 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 965 | Value Length | 966 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 967 \ / 969 / Value \ 970 \ / 971 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 972 | Signature Length | 973 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 974 \ / 975 / Signature \ 976 \ / 977 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 978 \ / 979 / Padding (if needed) \ 980 \ / 981 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 983 Figure 7: NTPv4 Extension Field Format 985 Each extension field is zero-padded to a 4 octet boundary. The 986 Length field covers the entire extension field, including the Length 987 and Padding fields. While the minimum field length is 8 octets, a 988 maximum field length remains to be established. The reference 989 implementation discards any packet with a field length more than 1024 990 octets. 992 The extension field parser initializes a pointer to the first octet 993 beyond the NTP header fields and calculates the number of octets 994 remaining in the packet. If this value is 20 the remaining data are 995 the MAC and parsing is complete. If greater than 20 an extension 996 field is present. If the length is less than 4 or not a multiple of 997 4, a format error has occurred and the packet is discarded; 998 otherwise, the parser increments the pointer by the lengthuses uses 999 the same rules as above to determine whether a MAC is present or 1000 another extension field. 1002 In Autokey the 8-bit Field Type field is interpreted as the version 1003 number, currently 2. For future versions values 1-7 have been 1004 reserved for Autokey; other values may be assigned for other 1005 applications. The 6-bit Code field specifies the request or response 1006 operation. There are two flag bits: bit 0 is the Response Flag (R) 1007 and bit 1 is the Error Flag (E); the Reserved field is unused and 1008 should be set to 0. The remaining fields will be described later. 1010 In the most common protocol operations, a client sends a request to a 1011 server with an operation code specified in the Code field and both 1012 the R bit and E bit dim. The Association ID field is set to the 1013 value previously received from the server or 0 otherwise. The server 1014 returns a response with the same operation code in the Code field and 1015 lights the R bit. The server can also light the E bit in case of 1016 error. The Association ID field is set to the association ID of the 1017 server as a handle for subsequent exchanges. If for some reason the 1018 association ID value in a request does not match the association ID 1019 of any mobilized association, the server returns the request with 1020 both the R and E bits lit. Note that it is not necessarily a 1021 protocol error to send an unsolicited response with no matching 1022 request. 1024 In some cases not all fields may be present. For requests, until a 1025 client has synchronized to a proventic source, signatures are not 1026 valid. In such cases the Timestamp and Signature Length fields are 0 1027 and the Signature field is empty. Some request and error response 1028 messages carry no value or signature fields, so in these messages 1029 only the first two words are present. 1031 The Timestamp and Filestamp words carry the seconds field of an NTP 1032 timestamp. The timestamp establishes the signature epoch of the data 1033 field in the message, while the filestamp establishes the generation 1034 epoch of the file that ultimately produced the data that is signed. 1035 A signature and timestamp are valid only when the signing host is 1036 synchronized to a proventic source; otherwise, the timestamp is zero. 1037 A cryptographic data file can only be generated if a signature is 1038 possible; otherwise, the filestamp is zero, except in the ASSOC 1039 response message, where it contains the server status word. 1041 As in all other TIP/IP protocol designs, all data are sent in network 1042 byte order. Unless specified otherwise in the descriptions to 1043 follow, the data referred to are stored in the Value field. 1045 10.1. No-Operation 1047 A No-operation request (Field Type 0) does nothing except return an 1048 empty response which can be used as a crypto-ping. 1050 10.2. Association Message (ASSOC) 1052 An Association Message (Field Type 1) is used in the parameter 1053 exchange to obtain the host name and status word. The request 1054 contains the client status word in the Filestamp field and the 1055 Autokey host name in the Value field. The response contains the 1056 server status word in the Filestamp field and the Autokey host name 1057 in the Value field. The Autokey host name is not necessarily the DNS 1058 host name. A valid response lights the ENAB bit and possibly others 1059 in the association status word. 1061 When multiple identity schemes are supported, the host status word 1062 determine which ones are available. In server and symmetric modes 1063 the response status word contains bits corresponding to the supported 1064 schemes. In all modes the scheme is selected based on the client 1065 identity parameters which are loaded at startup. 1067 10.3. Certificate Message (CERT) 1069 A Certificate Message (Field Type 2) is used in the certificate 1070 exchange to obtain a certificate by subject name. The request 1071 contains the subject name; the response contains the certificate 1072 encoded in X.509 format with ASN.1 syntax as described in Appendix H. 1074 If the subject name in the response does not match the issuer name, 1075 the exchange continues with the issuer name replacing the subject 1076 name in the request. The exchange continues until a trusted, self- 1077 signed certificate is found and lights the CERT bit in the 1078 association status word. 1080 10.4. Cookie Message (COOKIE) 1082 The Cookie Message (Field Type 3) is used in server and symmetric 1083 modes to obtain the server cookie. The request contains the host 1084 public key encoded with ASN.1 syntax as described in Appendix H. The 1085 response contains the cookie encrypted by the public key in the 1086 request. A valid response lights the COOKIE bit in the associaton 1087 status word. 1089 10.5. Autokey Message (AUTO) 1091 The Autokey Message (Field Type 4) is used to obtain the autokey 1092 values. The request contains no value for a client or the autokey 1093 values for a symmetric peer. The response contains two 32-bit words, 1094 the first is the final key ID, while the second is the index of the 1095 final key ID. A valid response lights the AUTO bit in the 1096 association status word. 1098 10.6. Leapseconds Values Message (LEAP) 1100 The Leapseconds Values Message (Field Type 5) is used to obtain the 1101 leapseconds values as parsed from the leapseconds table from NIST. 1102 The request contains no values. The response contains three 32-bit 1103 integers: first the NTP seconds of the latest leap event followed by 1104 the NTP seconds when the latest NIST table expires and then the TAI 1105 offset following the leap event. A valid response lights the LEAP 1106 bit in the association status word. 1108 10.7. Sign Message (SIGN) 1110 The Sign Message (Field Type 6) requests the server to sign and 1111 return a certificate presented in the request. The request contains 1112 the client certificate encoded in X.509 format with ASN.1 syntax as 1113 described in Appendix H. The response contains the client 1114 certificate signed by the server private key. A valid response 1115 lights the SIGN bit in the association status word. 1117 10.8. Identity Messages (IFF, GQ, MV) 1119 The Identity Messages (Field Type 7 (IFF), 8 (GQ), or 9 (MV)) 1120 contains the client challenge, usually a 160- or 512-bit nonce. The 1121 response contains the result of the mathematical operation defined in 1122 Appendix B. The Response is encoded in ASN.1 syntax as described in 1123 Appendix H. A valid responselights the VRFY bit in the association 1124 status word. 1126 11. Autokey State Machine 1128 This section describes the formal model of the Autokey state machine, 1129 its state variables and the state transition functions. 1131 11.1. Status Word 1133 The server implements a host status word, while each client 1134 implements an association status word. These words have the format 1135 and content shown in Figure 8. The low order 16 bits of the status 1136 word define the state of the Autokey dance, while the high order 16 1137 bits specify the message digest/signature encryption scheme as 1138 encoded in the OpenSSL library. Bits 24-31 are reserved for server 1139 use, while bits 16-23 are reserved for client use. In the host 1140 portion bits 24-27 specify the available identity schemes, while bits 1141 28-31 specify the server capabilities. There are two additional bits 1142 implemented separately. 1144 1 2 3 1145 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 1146 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1147 | Digest / Signature NID | Client | Ident | Host | 1148 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1150 Figure 8: Status Word 1152 The host status word is included in the ASSOC request and response 1153 messages. The client copies this word to the association status word 1154 and then lights additional bits as the dance proceeds. Once enabled, 1155 these bits ordinarily never come dark unless a general reset occurs 1156 and the protocol is restarted from the beginning. 1158 The host status bits are defined as follows: 1160 o ENAB (31) Lit if the server implements the Autokey protocol. 1162 o LVAL (30) Lit if the server has installed leapseconds values, 1163 either from the NIST leapseconds file or from another server. 1165 o Bits (28-29) are reserved - always dark. 1167 o Bits 24-27 select which server identity schemes are available. 1168 While specific coding for various schemes is yet to be determined, 1169 the schemes available in the reference implementation and 1170 described in Appendix B include the following: 1172 * none - Trusted Certificate (TC) Scheme (default). 1174 * PC (27) Private Certificate Scheme. 1176 * IFF (26) Schnorr aka Identify-Friendly-or-Foe Scheme. 1178 * GQ (25) Guillard-Quisquater Scheme. 1180 * MV (24) Mu-Varadharajan Scheme. 1182 o The PC scheme is exclusive of any other scheme. Otherwise, the 1183 IFF, GQ and MV bits can be enabled in any combination. 1185 The association status bits are defined as follows: 1187 o CERT (23) Lit when the trusted host certificate and public key are 1188 validated. 1190 o VRFY (22) Lit when the trusted host identity credentials are 1191 confirmed. 1193 o PROV (21) Lit when the server signature is verified using its 1194 public key and identity credentials. Also called the proventic 1195 bit elsewhere in this memo. When enabled, signed values in 1196 subsequent messages are presumed proventic. 1198 o COOK (20) Lit when the cookie is received and validated. When 1199 lit, key lists with nonzero cookies are generated; when dim, the 1200 cookie is zero. 1202 o AUTO (19) Lit when the autokey values are received and validated. 1203 When lit, clients can validate packets without extension fields 1204 according to the autokey sequence. 1206 o SIGN (18) Lit when the host certificate is signed by the server. 1208 o LEAP (17) Lit when the leapseconds values are received and 1209 validated. 1211 o Bit 16 is reserved - always dark. 1213 There are three additional bits: LIST, SYNC and PEER not included in 1214 the association status word. LIST is lit when the key list is 1215 regenerated and dim when the autokey values have been transmitted. 1216 This is necessary to avoid livelock under some conditions. SYNC is 1217 lit when the client has synchronized to a proventic source and never 1218 dim after that. PEER is lit when the server has synchronized, as 1219 indicated in the NTP header, and never dim after that. 1221 11.2. Host State Variables 1223 Following is a list of host state variables. 1225 Host Name - The name of the host, by default the string returned by 1226 the Unix gethostname() library function. In the reference 1227 implementation this is a configurable value. 1229 Host Status Word - This word is initialized when the host first 1230 starts up. The format is described above. 1232 Host Key - The RSA public/private key pair used to encrypt/decrypt 1233 cookies. This is also the default sign key. 1235 Sign Key - The RSA or DSA public/private key pair used to encrypt/ 1236 decrypt signatures when the host key is not used for this purpose. 1238 Sign Digest - The message digest algorithm used to compute the 1239 message digest before encryption. 1241 IFF Parameters - The parameters used in the optional IFF identity 1242 scheme described in Appendix B. 1244 GQ Parameters - The parameters used in the optional GQ identity 1245 scheme described in Appendix B. 1247 MV Parameters - The parameters used in the optional MV identity 1248 scheme described in Appendix B. 1250 Server Seed - The private value hashed with the IP addresses and key 1251 identifier to construct the cookie. 1253 Certificate Information Structure (CIS) - This structure includes 1254 certain information fields from an X.509v3 certificate, together with 1255 the certificate itself. The fields extracted include the subject and 1256 issuer names, subject public key and message digest algorithm 1257 (pointers), and the beginning and end of the valid period in NTP 1258 seconds. 1260 The certificate itself is stored as an extension field in network 1261 byte order so it can be copied intact to the message. The structure 1262 is signed using the sign key and carries the public values timestamp 1263 at signature time and the filestamp of the original certificate file. 1264 The structure is used by the CERT response message and SIGN request 1265 and response messages. 1267 A flags field in the CIS determines the status of the certificate. 1268 The field is encoded as follows: 1270 o TRUST (0x01) - The certificate has been signed by a trusted 1271 issuer. If the certificate is self-signed and contains 1272 "trustRoot" in the Extended Key Usage field, this bit is lit when 1273 the CIS is constructed. 1275 o SIGN (0x02) - The certificate signature has been verified. If the 1276 certificate is self-signed and verified using the contained public 1277 key, this bit is lit when the CIS is constructed. 1279 o VALID (0x04) - The certificate is valid and can be used to verify 1280 signatures. This bit is lit when a trusted certificate has been 1281 found on a valid certificate trail. 1283 o PRIV (0x08) - The certificate is private and not to be revealed. 1284 If the certificate is self-signed and contains "Private" in the 1285 Extended Key Usage field, this bit is lit when the CIS is 1286 constructed. 1288 o ERROR (0x80) - The certificate is defective and not to be used in 1289 any way. 1291 Certificate List - CIS structures are stored on the certificate list 1292 in order of arrival, with the most recently received CIS placed first 1293 on the list. The list is initialized with the CIS for the host 1294 certificate, which is read from the host certificate file. 1295 Additional CIS entries are added to the list as certificates are 1296 obtained from the servers during the certificate exchange. CIS 1297 entries are discarded if overtaken by newer ones. 1299 The following values are stored as an extension field structure in 1300 network byte order so they can be copied intact to the message. They 1301 are used to send some Autokey requests and responses. All but the 1302 Host Name Values structure are signed using the sign key and all 1303 carry the public values timestamp at signature time. 1305 Host Name Values. This is used to send ASSOC request and response 1306 messages. It contains the host status word and host name. 1308 Public Key Values - This is used to send the COOKIE request message. 1309 It contains the public encryption key used for the COOKIE response 1310 message. 1312 Leapseconds Values. This is used to send the LEAP response message. 1313 In contains the leapseconds values in the LEAP message description. 1315 11.3. Client State Variables (all modes) 1317 Following is a list of state variables used by the various dances in 1318 all modes. 1320 Association ID - The association ID used in responses. It is 1321 assigned when the association is mobilized. 1323 Association Status Word - The status word copied from the ASSOC 1324 response; subsequently modified by the state machine. 1326 Subject Name - The server host name copied from the ASSOC respones. 1328 Issuer Name - The host name signing the certificate. It is extracted 1329 from the current server certificate upon arrival and used to request 1330 the next host on the certificate trail. 1332 Server Public Key - The public key used to decrypt signatures. It is 1333 extracted from the server host certificate. 1335 Server Message Digest - The digest/signature scheme determined in the 1336 parameter exchange. 1338 Group Key - A set of values used by the identity exchange. It 1339 identifies the cryptographic compartment shared by the server and 1340 client. 1342 Receive Cookie Values - The cookie returned in a COOKIE response, 1343 together with its timestamp and filestamp 1345 Receive Autokey Values - The autokey values returned in an AUTO 1346 response, together with its timestamp and filestamp. 1348 Send Autokey Values - The autokey values with signature and 1349 timestamps. 1351 Key List - A sequence of key IDs starting with the autokey seed and 1352 each pointing to the next. It is computed, timestamped and signed at 1353 the next poll opportunity when the key list becomes empty. 1355 Current Key Number - The index of the entry on the Key List to be 1356 used at the next poll opportunity. 1358 11.4. Protocol State Transitions 1360 The protocol state machine is very simple but robust. The state is 1361 determined by the client status word bits defined above. The state 1362 transitions of the three dances are shown below. The capitalized 1363 truth values represent the client status bits. All bits are 1364 initialized dark and are lit upon the arrival of a specific response 1365 message as detailed above. 1367 11.4.1. Server Dance 1369 The server dance begins when the client sends an ASSOC request to the 1370 server. The clock is updated when PREV is lit and the dance ends 1371 when LEAP is lit. In this dance the autokey values are not used, so 1372 an autokey exchange is not necessary. Note that the SIGN and LEAP 1373 requests are not issued until the client has synchronized to a 1374 proventic source. Subsequent packets without extension fields are 1375 validated by the autokey sequence. This example and others assumes 1376 the IFF identity scheme has been selected in the parameter exchange.. 1378 1 while (1) { 1379 2 wait_for_next_poll; 1380 3 make_NTP_header; 1381 4 if (response_ready) 1382 5 send_response; 1383 6 if (!ENB) /* parameter exchange */ 1384 7 ASSOC_request; 1385 8 else if (!CERT) /* certificate exchange */ 1386 9 CERT_request(Host_Name); 1387 10 else if (!IFF) /* identity exchange */ 1388 11 IFF_challenge; 1389 12 else if (!COOK) /* cookie exchange */ 1390 13 COOKIE_request; 1391 14 else if (!SYNC) /* wait for synchronization */ 1392 15 continue; 1393 16 else if (!SIGN) /* sign exchange */ 1394 17 SIGN_request(Host_Certificate); 1395 18 else if (!LEAP) /* leapsecond values exchange */ 1396 19 LEAP_request; 1397 20 send packet; 1398 21 } 1400 Figure 9: Server Dance 1402 If the server refreshes the private seed, the cookie becomes invalid. 1403 The server responds to an invalid cookie with a crypto_NAK message, 1404 which causes the client to restart the protocol from the beginning. 1406 11.4.2. Broadcast Dance 1408 The broadcast dance is similar to the server dance with the cookie 1409 exchange replaced by the autokey values exchange. The broadcast 1410 dance begins when the client receives a broadcast packet including an 1411 ASSOC response with the server association ID. This mobilizes a 1412 client ssociation in order to proventicate the source and calibrate 1413 the propagation delay. The dance ends when the LEAP bit is lit, 1414 after which the client sends no further packets. Normally, the 1415 broadcast server includes an ASSOC response in each transmitted 1416 packet. However, when the server generates a new key list, it 1417 includes an AUTO response instead. 1419 In the broadcast dance extension fields are used with every packet, 1420 so the cookie is always zero and no cookie exchange is necessary. As 1421 in the server dance, the clock is updated when PREV is lit and the 1422 dance ends when LEAP is lit. Note that the SIGN and LEAP requests 1423 are not issued until the client has synchronized to a proventic 1424 source. Subsequent packets without extension fields are validated by 1425 the autokey sequence. 1427 1 while (1) { 1428 2 wait_for_next_poll; 1429 3 make_NTP_header; 1430 4 if (response_ready) 1431 5 send_response; 1432 6 if (!ENB) /* parameters exchange */ 1433 7 ASSOC_request; 1434 8 else if (!CERT) /* certificate exchange */ 1435 9 CERT_request(Host_Name); 1436 10 else if (!IFF) /* identity exchange */ 1437 11 IFF_challenge; 1438 12 else if (!AUT) /* autokey values exchange */ 1439 13 AUTO_request; 1440 14 else if (!SYNC) /* wait for synchronization */ 1441 15 continue; 1442 16 else if (!SIGN) /* sign exchange */ 1443 17 SIGN_request(Host_Certificate); 1444 18 else if (!LEAP) /* leapsecond values exchange */ 1445 19 LEAP_request; 1446 20 send NTP_packet; 1447 21 } 1449 Figure 10: Server Dance 1451 If a packet is lost and the autokey sequence is broken, the client 1452 hashes the current autokey until either it matches the previous 1453 autokey or the number of hashes exceeds the count given in the 1454 autokey values. If the latter, the client sends an AUTO request to 1455 retrive the autokey values. If the client receives a crypto-NAK 1456 during the dance, or if the association ID changes, the client 1457 restarts the protocol from the beginning. 1459 11.4.3. Symmetric Dance 1461 The symmetric dance is intricately choreographed. It begins when the 1462 active peer sends an ASSOC request to the passive peer. The passive 1463 peer mobilizes an association and both peers step a three-way dance 1464 where each peer completes a parameter exchange with the other. Until 1465 one of the peers has synchronized to a proventic source (which could 1466 be the other peer) and can sign messages, the other peer loops 1467 waiting for a valid timestamp in the ensuing CERT response. 1469 1 while (1) { 1470 2 wait_for_next_poll; 1471 3 make_NTP_header; 1472 4 if (!ENB) /* parameters exchange */ 1473 5 ASSOC_request; 1474 6 else if (!CERT) /* certificate exchange */ 1475 7 CERT_request(Host_Name); 1476 8 else if (!IFF) /* identity exchange */ 1477 9 IFF_challenge; 1478 10 else if (!COOK && PEER) /* cookie exchange */ 1479 11 COOKIE_request); 1480 12 else if (!AUTO) /* autokey values exchange */ 1481 13 AUTO_request; 1482 14 else if (LIST) /* autokey values response */ 1483 15 AUTO_response; 1484 16 else if (!SYNC) /* wait for synchronization */ 1485 17 continue; 1486 18 else if (!SIGN) /* sign exchange */ 1487 19 SIGN_request; 1488 20 else if (!LEAP) /* leapsecond values exchange */ 1489 21 LEAP_request; 1490 22 send NTP_packet; 1491 23 } 1493 Figure 11: Symmetric Dance 1495 Once a peer has synchronized to a proventic source, it includes 1496 timestamped signatures in its messages. The other peer, which has 1497 been stalled waiting for valid timestamps, now mates the dance. It 1498 retrives the now nonzero cookie using a a cookie exchange and then 1499 the updated autokey values using an autokey exchange. 1501 As in the broadcasst dance, if a packet is lost and the autokey 1502 sequence broken, the peer hashes the current autokey until either it 1503 matches the previous autokey or the number of hashes exceeds tha 1504 count given in the autokey values. If the latter, the client sends 1505 an AUTO request to retrive the autokey values. If the peer receives 1506 a crypto-NAK during the dance, or if the association ID changes, the 1507 peer restarts the protocol from the beginning. 1509 11.5. Error Recovery 1511 The Autokey protocol state machine includes provisions for various 1512 kinds of error conditions that can arise due to missing files, 1513 corrupted data, protocol violations and packet loss or misorder, not 1514 to mention hostile intrusion. This section describes how the 1515 protocol responds to reachability and timeout events which can occur 1516 due to such errors. 1518 A persistent NTP association is mobilized by an entry in the 1519 configuration file, while an ephemeral association is mobilized upon 1520 the arrival of a broadcast or symmetric active packet with no 1521 matching association. Subsequently, a general reset reinitializes 1522 all association variables to the initial state when first mobilized. 1523 In addition, if the association is ephemeral, the association is 1524 demobilized and all resources acquired are returned to the system. 1526 Every NTP association has two variables which maintain the liveness 1527 state of the protocol, the 8-bit reach register and the unreach 1528 counter defined in [I-D.ietf-ntp-ntpv4-proto]. At every poll 1529 interval the reach register is shifted left, the low order bit is 1530 dimmed and the high order bit is lost. At the same time the unreach 1531 counter is incremented by one. If an arriving packet passes all 1532 authentication and sanity checks, the rightmost bit of the reach 1533 register is lit and the unreach counter is set to zero. If any bit 1534 in the reach register is lit, the server is reachable, otherwise it 1535 is unreachable. 1537 When the first poll is sent from an association, the reach register 1538 and unreach counter are set to zero. If the the unreach counter 1539 reaches 16, the poll interval is doubled. In addition, if 1540 association is persistent, it is demobilized. This reduces the 1541 network load for packets that are unlikely to elicit a response. 1543 At each state in the protocol the client expects a particular 1544 response from the server. A request is included in the NTP packet 1545 sent at each poll interval until a valid response is received or a 1546 general reset occurs, in which case the protocol restarts from the 1547 beginning. A general reset also occurs for an association when an 1548 unrecoverable protocol error occurs. A general reset occurs for all 1549 associations when the system clock is first synchronized or the clock 1550 is stepped or when the server seed is refreshed. 1552 There are special cases designed to quickly respond to broken 1553 associations, such as when a server restarts or refreshes keys. 1554 Since the client cookie is invalidated, the server rejects the next 1555 client request and returns a crypto-NAK packet. Since the crypto-NAK 1556 has no MAC, the problem for the client is to determine whether it is 1557 legitimate or the result of intruder mischief. In order to reduce 1558 the vulnerability in such cases, the crypto-NAK, as well as all 1559 responses, is believed only if the result of a previous packet sent 1560 by the client and not a replay, as confirmed by the NTP on-wire 1561 protocol. While this defense can be easily circumvented by a 1562 middleman, it does deflect other kinds of intruder warfare. 1564 There are a number of situations where some event happens that causes 1565 the remaining autokeys on the key list to become invalid. When one 1566 of these situations happens, the key list and associated autokeys in 1567 the key cache are purged. A new key list, signature and timestamp 1568 are generated when the next NTP message is sent, assuming there is 1569 one. Following is a list of these situations: 1571 1. When the cookie value changes for any reason. 1573 2. When the poll interval is changed. In this case the calculated 1574 expiration times for the keys become invalid. 1576 3. If a problem is detected when an entry is fetched from the key 1577 list. This could happen if the key was marked non-trusted or 1578 timed out, either of which implies a software bug. 1580 11.6. Security Considerations 1582 This section discusses the most obvious security vulnerabilities in 1583 the various Autokey dances. In the following discussion the 1584 cryptographic algorithms and private values themselves are assumed 1585 secure; that is, a brute force cryptanalytic attack will not reveal 1586 the host private key, sign private key, cookie value, identity 1587 parameters, server seed or autokey seed. In addition, an intruder 1588 will not be able to predict random generator values. 1590 11.7. Protocol Vulnerability 1592 While the protocol has not been subjected to a formal analysis, a few 1593 preliminary assertions can be made. In the client/server and 1594 symmetric dances the underlying NTP on-wire protocol is resistant to 1595 lost, duplicate and bogus packets, even if the clock is not 1596 synchronized, so the protocol is not vulnerable to a wiretapper 1597 attack. A middleman attack, even if it could simulate a valid 1598 cookie, could not present a valid signature. 1600 In the broadcast dance the client begins with a volley in client/ 1601 server mode to obtain the autokey values and signature, so has the 1602 same protection as in that mode. When continuing in receive-only 1603 mode, a wiretapper cannot produce a key list with valid signed 1604 autokey values. If it replays an old packet, the client will reject 1605 it by the timestamp check. The most it can do is manufacture a 1606 future packet causing clients to repeat the autokey hash operations 1607 until exceeding the maximum key number. If this happens the 1608 broadcast client tempoerarily revers to client mode to refresh the 1609 autokey values. 1611 A client instantiates cryptographic variables only if the server is 1612 synchronized to a proventic source. A server does not sign values or 1613 generate cryptographic data files unless synchronized to a proventic 1614 source. This raises an interesting issue: how does a client generate 1615 proventic cryptographic files before it has ever been synchronized to 1616 a proventic source? [Who shaves the barber if the barber shaves 1617 everybody in town who does not shave himself?] In principle, this 1618 paradox is resolved by assuming the primary (stratum 1) servers are 1619 proventicated by external phenomenological means. 1621 11.8. Clogging Vulnerability 1623 A self-induced clogging incident cannot happen, since signatures are 1624 computed only when the data have changed and the data do not change 1625 very often. For instance, the autokey values are signed only when 1626 the key list is regenerated, which happens about once an hour, while 1627 the public values are signed only when one of them is updated during 1628 a dance or the server seed is refreshed, which happens about once per 1629 day. 1631 There are two clogging vulnerabilities exposed in the protocol 1632 design: an encryption attack where the intruder hopes to clog the 1633 victim server with needless cryptographic calculations, and a 1634 decryption attack where the intruder attempts to clog the victim 1635 client with needless cryptographic calculations. Autokey uses public 1636 key cryptography and the algorithms that perform these functions 1637 consume significant resources. 1639 In client/server and peer dances an encryption hazard exists when a 1640 wiretapper replays prior cookie request messages at speed. There is 1641 no obvious way to deflect such attacks, as the server retains no 1642 state between requests. Replays of cookie request or response 1643 messages are detected and discarded by the client on-wire protocol. 1645 In broadcast mode a client a decryption hazard exists when a 1646 wiretapper replays autokey response messages at speed. Once 1647 synchronized to a proventic source, a legitimate extension field with 1648 timestamp the same as or earlier than the most recently received of 1649 that type is immediately discarded. This foils a middleman cut-and- 1650 paste attack using an earlier response, for example. A legitimate 1651 extension field with timestamp in the future is unlikely, as that 1652 would require predicting the autokey sequence. However, this causes 1653 the client to refresh and verify the autokey values and signature. 1655 A determined middleman can modify a recent packet with an intentional 1656 bit error. A stateless server will return a crypto-NAK message which 1657 will cause the client to perform a general reset. The middleman can 1658 do other things as well and have nothing to do with Autokey. 1660 12. IANA Considerations 1662 Any IANA registries needed? 1664 13. Acknowledgements 1666 ... 1668 14. References 1670 14.1. Normative References 1672 [I-D.ietf-ntp-ntpv4-proto] 1673 Burbank, J., "Network Time Protocol Version 4 Protocol And 1674 Algorithms Specification", draft-ietf-ntp-ntpv4-proto-09 1675 (work in progress), February 2008. 1677 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 1678 Requirement Levels", BCP 14, RFC 2119, March 1997. 1680 14.2. Informative References 1682 [DASBUCH] Mills, D., ""Compouter Network Time Synchronization - the 1683 Network Time Protocol"", 2006. 1685 [GUILLOU] Guillou, L. and J. Quisquatar, "A "paradoxical" identity- 1686 based signature scheme resulting from zero-knowledge", 1687 1990. 1689 [MV] Mu, Y. and V. Varadharajan, "Robust and secure 1690 broadcasting", 2001. 1692 [RFC1305] Mills, D., "Network Time Protocol (Version 3) 1693 Specification, Implementation", RFC 1305, March 1992. 1695 [RFC2402] Kent, S. and R. Atkinson, "IP Authentication Header", 1696 RFC 2402, November 1998. 1698 [RFC2406] Kent, S. and R. Atkinson, "IP Encapsulating Security 1699 Payload (ESP)", RFC 2406, November 1998. 1701 [RFC2408] Maughan, D., Schneider, M., and M. Schertler, "Internet 1702 Security Association and Key Management Protocol 1703 (ISAKMP)", RFC 2408, November 1998. 1705 [RFC2412] Orman, H., "The OAKLEY Key Determination Protocol", 1706 RFC 2412, November 1998. 1708 [RFC2510] Adams, C. and S. Farrell, "Internet X.509 Public Key 1709 Infrastructure Certificate Management Protocols", 1710 RFC 2510, March 1999. 1712 [RFC2522] Karn, P. and W. Simpson, "Photuris: Session-Key Management 1713 Protocol", RFC 2522, March 1999. 1715 [RFC2875] Prafullchandra, H. and J. Schaad, "Diffie-Hellman Proof- 1716 of-Possession Algorithms", RFC 2875, July 2000. 1718 [RFC3279] Bassham, L., Polk, W., and R. Housley, "Algorithms and 1719 Identifiers for the Internet X.509 Public Key 1720 Infrastructure Certificate and Certificate Revocation List 1721 (CRL) Profile", RFC 3279, April 2002. 1723 [RFC3280] Housley, R., Polk, W., Ford, W., and D. Solo, "Internet 1724 X.509 Public Key Infrastructure Certificate and 1725 Certificate Revocation List (CRL) Profile", RFC 3280, 1726 April 2002. 1728 [SCHNORR] Schnorr, C., "Efficient signature generation for smart 1729 cards", 1991. 1731 [STINSON] Stinson, D., "Cryptography - Theory and Practice", 1995. 1733 Appendix A. Timestamps, Filestamps and Partial Ordering 1735 When the host starts, it reads the host key and host certificate 1736 files, which are required for continued operation. It also reads the 1737 sign key and leapseconds values, when available. When reading these 1738 files the host checks the file formats and filestamps for validity; 1739 for instance, all filestamps must be later than the time the UTC 1740 timescale was established in 1972 and the certificate filestamp must 1741 not be earlier than its associated sign key filestamp. At the time 1742 the files are read the host is not synchronized, so it cannot 1743 determine whether the filestamps are bogus other than these simple 1744 checks. It must not produce filestamps or timestamps until 1745 synchronized to a proventic source. 1747 In the following the relation A --> B is Lamport's "happens before" 1748 relation, which is true if event A happens before event B. When 1749 timestamps are compared to timestamps, the relation is false if A 1750 <--> B; that is, false if the events are simultaneous. For 1751 timestamps compared to filestamps and filestamps compared to 1752 filestamps, the relation is true if A <--> B. Note that the current 1753 time plays no part in these assertions except in (6) below; however, 1754 the NTP protocol itself insures a correct partial ordering for all 1755 current time values. 1757 The following assertions apply to all relevant responses: 1759 1. The client saves the most recent timestamp T0 and filestamp F0 1760 for the respective signature type. For every received message 1761 carrying timestamp T1 and filestamp F1, the message is discarded 1762 unless T0 --> T1 and F0 --> F1. The requirement that T0 --> T1 1763 is the primary defense against replays of old messages. 1765 2. For timestamp T and filestamp F, F --> T; that is, the filestamp 1766 must happen before the timestamp. If not, this could be due to a 1767 file generation error or a significant error in the system clock 1768 time. 1770 3. For sign key filestamp S, certificate filestamp C, cookie 1771 timestamp D and autokey timestamp A, S --> C --> D --> A; that 1772 is, the autokey must be generated after the cookie, the cookie 1773 after the certificate and the certificate after the sign key. 1775 4. For sign key filestamp S and certificate filestamp C specifying 1776 begin time B and end time E, S --> C--> B --> E; that is, the 1777 valid period must not be retroactive. 1779 5. A certificate for subject S signed by issuer I and with filestamp 1780 C1 obsoletes, but does not necessarily invalidate, another 1781 certificate with the same subject and issuer but with filestamp 1782 C0, where C0 --> C1. 1784 6. A certificate with begin time B and end time E is invalid and can 1785 not be used to verify signatures if t --> B or E --> t, where t 1786 is the current proventic time. Note that the public key 1787 previously extracted from the certificate continues to be valid 1788 for an indefinite time. This raises the interesting possibility 1789 where a truechimer server with expired certificate or a 1790 falseticker with valid certificate are not detected until the 1791 client has synchronized to a proventic source. 1793 Appendix B. Identity Schemes 1795 There are five identity schemes in the NTPv4 reference 1796 implementation: (1) private certificate (PC), (2) trusted certificate 1797 (TC), (3) a modified Schnorr algorithm (IFF - Identify Friend or 1798 Foe), (4) a modified Guillou-Quisquater algorithm (GQ), and (5) a 1799 modified Mu-Varadharajan algorithm (MV). 1801 The PC scheme is intended for testing and development and not 1802 recommended for general use. The TC scheme uses a certificate trail, 1803 but not an identity scheme. The IFF, GQ and MV identity schemes use 1804 a cryptographically strong challenge-response exchange where an 1805 intruder cannot learn the group key, even after repeated observations 1806 of multiple exchanges. These schemes begin when the client sends a 1807 nonce to the server, which then rolls its own nonce, performs a 1808 mathematical operation and sends the results to the client. The 1809 client performs a second mathematical operation to prove the server 1810 has the same group key as the client. 1812 Appendix C. Private Certificate (PC) Scheme 1814 The PC scheme shown in Figure Figure 12 uses a private certificate as 1815 the group key. 1817 Trusted 1818 Authority 1819 Secure +-------------+ Secure 1820 +--------------| Certificate |-------------+ 1821 | +-------------+ | 1822 | | 1823 \|/ \|/ 1824 +-------------+ +-------------+ 1825 | Certificate | | Certificate | 1826 +-------------+ +-------------+ 1827 Server Client 1829 Figure 12: Private Certificate (PC) Identity Scheme 1831 A certificate is designated private when the X509v3 Extended Key 1832 Usage extension field is present and contains "Private". The private 1833 certificate is distributed to all other group members by secret 1834 means, so in fact becomes a symmetric key. Private certificates are 1835 also trusted, so there is no need for a certificate trail or identity 1836 scheme. 1838 Appendix D. Trusted Certificate (TC) Scheme 1840 All other schemes involve a conventional certificate trail as shown 1841 in Figure Figure 13. 1843 Trusted 1844 Host Host Host 1845 +-----------+ +-----------+ +-----------+ 1846 +--->| Subject | +--->| Subject | +--->| Subject | 1847 | +-----------+ | +-----------+ | +-----------+ 1848 ...---+ | Issuer |---+ | Issuer |---+ | Issuer | 1849 +-----------+ +-----------+ +-----------+ 1850 | Signature | | Signature | | Signature | 1851 +-----------+ +-----------+ +-----------+ 1853 Figure 13: Trusted Certificate (TC) Identity Scheme 1855 As described in RFC-2510 [RFC2510], each certificate is signed by an 1856 issuer one step closer to the trusted host, which has a self-signed 1857 trusted certificate. A certificate is designated trusted when an 1858 X509v3 Extended Key Usage extension field is present and contains 1859 "trustRoot". If no identity scheme is specified in the parameter 1860 exchange, this is the default scheme. 1862 Appendix E. Schnorr (IFF) Identity Scheme 1864 The IFF scheme is useful when the group key is concealed, so that 1865 client keys need not be protected. The primary disadvantage is that 1866 when the server key is refreshed all hosts must update the client 1867 key. The scheme shown in Figure Figure 14 involves a set of public 1868 parameters and a group key including both private and public 1869 components. The public component is the client key. 1871 Trusted 1872 Authority 1873 +------------+ 1874 | Parameters | 1875 Secure +------------+ Insecure 1876 +-------------| Group Key |-----------+ 1877 | +------------+ | 1878 \|/ \|/ 1879 +------------+ Challenge +------------+ 1880 | Parameters |<------------------------| Parameters | 1881 +------------+ +------------+ 1882 | Group Key |------------------------>| Client Key | 1883 +------------+ Response +------------+ 1884 Server Client 1886 Figure 14: Schnorr (IFF) Identity Scheme 1888 By happy coincidence, the mathematical principles on which IFF is 1889 based are similar to DSA. The scheme is a modification an algorithm 1890 described in [SCHNORR] and [STINSON] p. 285. The parameters are 1891 generated by routines in the OpenSSL library, but only the moduli p, 1892 q and generator g are used. The p is a 512-bit prime, g a generator 1893 of the multiplicative group Z_p* and q a 160-bit prime that divides 1894 (p-1) and is a qth root of 1 mod p; that is, g^q = 1 mod p. The TA 1895 rolls a private random group key b (0 < b < q), then computes public 1896 client key v = g^(q-b) mod p. The TA distributes (p, q, g, b) to all 1897 servers using secure means and (p, q, g, v) to all clients not 1898 necessarily using secure means. 1900 The TA hides IFF parameters and keys in an OpenSSL DSA cuckoo 1901 structure. The IFF parameters are identical to the DSA parameters, 1902 so the OpenSSL library can be used directly. The structure shown in 1903 FigureFigure 15 is written to a file as a DSA private key encoded in 1904 PEM. Unused structure members are set to one. 1906 +----------------------------------+-------------+ 1907 | IFF | DSA | Item | Include | 1908 +=========+==========+=============+=============+ 1909 | p | p | modulus | all | 1910 +---------+----------+-------------+-------------+ 1911 | q | q | modulus | all | 1912 +---------+----------+-------------+-------------+ 1913 | g | g | generator | all | 1914 +---------+----------+-------------+-------------+ 1915 | b | priv_key | group key | server | 1916 +---------+----------+-------------+-------------+ 1917 | v | pub_key | client key | client | 1918 +---------+----------+-------------+-------------+ 1920 Figure 15: IFF Identity Scheme Structure 1922 Alice challenges Bob to confirm identity using the following protocol 1923 exchange. 1925 1. Alice rolls random r (0 < r < q) and sends to Bob. 1927 2. Bob rolls random k (0 < k < q), computes y = k + br mod q and x = 1928 g^k mod p, then sends (y, hash(x)) to Alice. 1930 3. Alice computes z = g^y * v^r mod p and verifies hash(z) equals 1931 hash(x). 1933 If the hashes match, Alice knows that Bob has the group key b. 1935 Besides making the response shorter, the hash makes it effectively 1936 impossible for an intruder to solve for b by observing a number of 1937 these messages. The signed response binds this knowledge to Bob's 1938 private key and the public key previously received in his 1939 certificate. 1941 Appendix F. Guillard-Quisquater (GQ) Identity Scheme 1943 The GQ scheme is useful when the server key must be refreshed from 1944 time to time without changing the group key. The NTP utility 1945 programs include the GQ client key in the X509v3 Subject Key 1946 Identifier extension field. The primary disadvantage of the scheme 1947 is that the group key must be protected in both the server and 1948 client. A secondary disadvantage is that when a server key is 1949 refreshed, old extension fields no longer work. The scheme is shown 1950 in Figure Figure 16a involves a set of public parameters and group 1951 key used to generate private server keys and client keys. 1953 Trusted 1954 Authority 1955 +------------+ 1956 | Parameters | 1957 Secure +------------+ Secure 1958 +-------------| Group Key |-----------+ 1959 | +------------+ | 1960 \|/ \|/ 1961 +------------+ Challenge +------------+ 1962 | Parameters |<------------------------| Parameters | 1963 +------------+ +------------+ 1964 | Group Key | | Group Key | 1965 +------------+ Response +------------+ 1966 | Server Key |------------------------>| Client Key | 1967 +------------+ +------------+ 1968 Server Client 1970 Figure 16: Schnorr (IFF) Identity Scheme 1972 By happy coincidence, the mathematical principles on which GQ is 1973 based are similar to RSA. The scheme is a modification of an 1974 algorithm described in [GUILLOU] and [STINSON] p. 300 (with errors). 1975 The parameters are generated by routines in the OpenSSL library, but 1976 only the moduli p and q are used. The 512-bit public modulus is 1977 n=pq, where p and q are secret large primes. The TA rolls random 1978 large prime b (0 < b < n) and distributes (n, b) to all group servers 1979 and clients using secure means, since an intruder in possession of 1980 these values could impersonate a legitimate server. The private 1981 server key and public client key are constructed later. 1983 The TA hides GQ parameters and keys in an OpenSSL RSA cuckoo 1984 structure. The GQ parameters are identical to the RSA parameters, so 1985 the OpenSSL library can be used directly. When generating a 1986 certificate, the server rolls random server key u (0 < u < n) and 1987 client key its inverse obscured by the group key v = (u^-1)^b mod n. 1988 These values replace the private and public keys normally generated 1989 by the RSA scheme. The client key is conveyed in a X.509 certificate 1990 extension. The updated GQ structure shown in Figure Figure 17 is 1991 written as an RSA private key encoded in PEM. Unused structure 1992 members are set to one. 1994 +---------------------------------+-------------+ 1995 | GQ | RSA | Item | Include | 1996 +=========+==========+============+=============+ 1997 | n | n | modulus | all | 1998 +---------+----------+------------+-------------+ 1999 | b | e | group key | all | 2000 +---------+----------+------------+-------------+ 2001 | u | p | server key | server | 2002 +---------+----------+------------+-------------+ 2003 | v | q | client key | client | 2004 +---------+----------+------------+-------------+ 2006 Figure 17: GQ Identity Scheme Structure 2008 Alice challenges Bob to confirm identity using the following 2009 exchange. 2011 1. Alice rolls random r (0 < r < n) and sends to Bob. 2013 2. Bob rolls random k (0 < k < n) and computes y = ku^r mod n and x 2014 = k^b mod n, then sends (y, hash(x)) to Alice. 2016 3. Alice computes z = (v^r)*(y^b) mod n and verifies hash(z) equals 2017 hash(x). 2019 If the hashes match, Alice knows that Bob has the corresponding 2020 server key u. Besides making the response shorter, the hash makes it 2021 effectively impossible for an intruder to solve for u by observing a 2022 number of these messages. The signed response binds this knowledge 2023 to Bob's private key and the client key previously received in his 2024 certificate. 2026 Appendix G. Mu-Varadharajan (MV) Identity Scheme 2028 The MV scheme is perhaps the most interesting and flexible of the 2029 three challenge/response schemes, but is devilishly complicated. It 2030 is most useful when a small number of servers provide synchronization 2031 to a large client population where there might be considerable risk 2032 of compromise between and among the servers and clients. The client 2033 population can be partitioned into a modest number of subgroups, each 2034 associated with an individual client key. 2036 The TA generates an intricate cryptosystem involving encryption and 2037 decryption keys, together with a number of activation keys and 2038 associated client keys. The TA can activate and revoke individual 2039 client keys without changing the client keys themselves. The TA 2040 provides to the servers an encryption key E and partial decryption 2041 keys g-bar and g-hat which depend on the activated keys. The servers 2042 have no additional information and, in particular, cannot masquerade 2043 as a TA. In addition, the TA provides to each client j individual 2044 partial decryption keys x-bar_j and x-hat_j, which do not need to be 2045 changed if the TA activates or deactivates any client key. The 2046 clients have no further information and, in particular, cannot 2047 masquerade as a server or TA. 2049 The scheme uses an encryption algorithm similar to El Gamal 2050 cryptography and a polynomial formed from the expansion of product 2051 terms (x-x_1)(x-x_2)(x-x_3)...(x-x_n), as described in [MV]. The 2052 paper has significant errors and serious omissions. The cryptosystem 2053 is constructed so that, for every encryption key E its inverse is 2054 (g-bar^x-hat_j)(g-hat^x-bar_j) mod p for every j. This remains true 2055 if both quantities are raised to the power k mod p. The difficulty 2056 in finding E is equivalent to the descrete log problem. 2058 The scheme is shown in Figure Figure 18. The TA generates the 2059 parameters, group key, server keys and client keys, one for each 2060 client, all of which must be protected to prevent theft of service. 2061 Note that only the TA has the group key, which is not known to either 2062 the servers or clients. In this sense the MV scheme is a zero- 2063 knowledge proof. 2065 Trusted 2066 Authority 2067 +------------+ 2068 | Parameters | 2069 +------------+ 2070 | Group Key | 2071 +------------+ 2072 | Server Key | 2073 Secure +------------+ Secure 2074 +-------------| Client Key |-----------+ 2075 | +------------+ | 2076 \|/ \|/ 2077 +------------+ Challenge +------------+ 2078 | Parameters |<------------------------| Parameters | 2079 +------------+ +------------+ 2080 | Server Key |------------------------>| Client Key | 2081 +------------+ Response +------------+ 2082 Server Client 2084 Figure 18: Mu-Varadharajan (MV) Identity Scheme 2086 The TA hides MV parameters and keys in OpenSSL DSA cuckoo structures. 2087 The MV parameters are identical to the DSA parameters, so the OpenSSL 2088 library can be used directly. The structure shown in Figures below 2089 are written to files as a DSA private key encoded in PEM. Unused 2090 structure members are set to one. Figure Figure 19 shows the data 2091 structure used by the servers, while Figure Figure 20 shows the 2092 client data structure associated with each activation key. 2094 +---------------------------------+-------------+ 2095 | MV | DSA | Item | Include | 2096 +=========+==========+============+=============+ 2097 | p | p | modulus | all | 2098 +---------+----------+------------+-------------+ 2099 | q | q | modulus | server | 2100 +---------+----------+------------+-------------+ 2101 | E | g | private | server | 2102 | | | encrypt | | 2103 +---------+----------+------------+-------------+ 2104 | g-bar | priv_key | public | server | 2105 | | | decrypt | | 2106 +---------+----------+------------+-------------+ 2107 | g-hat | pub_key | public | server | 2108 | | | decrypt | | 2109 +---------+----------+------------+-------------+ 2110 Figure 19: MV Scheme Server Structure 2112 +---------------------------------+-------------+ 2113 | MV | DSA | Item | Include | 2114 +=========+==========+============+=============+ 2115 | p | p | modulus | all | 2116 +---------+----------+------------+-------------+ 2117 | x-bar_j | priv_key | public | client | 2118 | | | decrypt | | 2119 +---------+----------+------------+-------------+ 2120 | x-hat_j | pub_key | public | client | 2121 | | | decrypt | | 2122 +---------+----------+------------+-------------+ 2124 Figure 20: MV Scheme Client Structure 2126 The devil is in the details, which are beyond the scope of this memo. 2127 The steps in generating the cryptosystem activating the keys and 2128 generating the partial decryption keys are in [DASBUCH] page 170 ff. 2130 Alice challenges Bob to confirm identity using the following 2131 exchange. 2133 1. Alice rolls random r (0 < r < q) and sends to Bob. 2135 2. Bob rolls random k (0 < k < q) and computes the session 2136 encryption key E-prime = E^k mod p and partial decryption keys 2137 g-bar-prime = g-bar^k mod p and g-hat-prime = g-hat^k mod p. He 2138 encrypts x = E-prime * r mod p and sends (x, g-bar-prime, g-hat- 2139 prime) to Alice. 2141 3. Alice computes the session decryption key E^-1 = (g-bar-prime)^x- 2142 hat_j (g-hat-prime)^x-bar_j mod p and verifies that r = E^-1 x. 2144 Appendix H. ASN.1 Encoding Rules 2146 Certain value fields in request and response messages contain data 2147 encoded in ASN.1 distinguished encoding rules (DER). The BNF grammar 2148 for each encoding rule is given below along with the OpenSSL routine 2149 used for the encoding in the reference implementation. The object 2150 identifiers for the encryption algorithms and message digest/ 2151 signature encryption schemes are specified in [RFC3279]. The 2152 particular algorithms required for conformance are not specified in 2153 this memo. 2155 H.1. COOKIE request, IFF response, GQ response, MV response 2157 The value field of the COOKIE request message contains a sequence of 2158 two integers (n, e) encoded by the i2d_RSAPublicKey() routine in the 2159 OpenSSL distribution. In the request, n is the RSA modulus in bits 2160 and e is the public exponent. 2162 RSAPublicKey ::= SEQUENCE { 2163 n ::= INTEGER, 2164 e ::= INTEGER 2165 } 2167 The IFF and GQ responses contain a sequence of two integers (r, s) 2168 encoded by the i2d_DSA_SIG() routine in the OpenSSL distribution. In 2169 the responses, r is the challenge response and s is the hash of the 2170 private value. 2172 DSAPublicKey ::= SEQUENCE { 2173 r ::= INTEGER, 2174 s ::= INTEGER 2175 } 2177 The MV response contains a sequence of three integers (p, q, g) 2178 encoded by the i2d_DSAparams() routine in the OpenSSL library. In 2179 the response, p is the hash of the encrypted challenge value and (q, 2180 g) is the client portion of the decryption key. 2182 DSAparameters ::= SEQUENCE { 2183 p ::= INTEGER, 2184 q ::= INTEGER, 2185 g ::= INTEGER 2186 } 2188 H.2. Certificates 2190 Certificate extension fields are used to convey information used by 2191 the identity schemes. While the semantics of these fields generally 2192 conforms with conventional usage, there are subtle variations. The 2193 fields used by Autokey Version 2 include: 2195 o Basic Constraints. This field defines the basic functions of the 2196 certificate. It contains the string "critical,CA:TRUE", which 2197 means the field must be interpreted and the associated private key 2198 can be used to sign other certificates. While included for 2199 compatibility, Autokey makes no use of this field. 2201 o Key Usage. This field defines the intended use of the public key 2202 contained in the certificate. It contains the string 2203 "digitalSignature,keyCertSign", which means the contained public 2204 key can be used to verify signatures on data and other 2205 certificates. While included for compatibility, Autokey makes no 2206 use of this field. 2208 o Extended Key Usage. This field further refines the intended use 2209 of the public key contained in the certificate and is present only 2210 in self-signed certificates. It contains the string "Private" if 2211 the certificate is designated private or the string "trustRoot" if 2212 it is designated trusted. A private certificate is always 2213 trusted. 2215 o Subject Key Identifier. This field contains the client identity 2216 key used in the GQ identity scheme. It is present only if the GQ 2217 scheme is in use. 2219 The value field contains a X509v3 certificate encoded by the 2220 i2d_X509() routine in the OpenSSL distribution. The encoding follows 2221 the rules stated in [RFC3280], including the use of X509v3 extension 2222 fields. 2224 Certificate ::= SEQUENCE { 2225 tbsCertificate TBSCertificate, 2226 signatureAlgorithm AlgorithmIdentifier, 2227 signatureValue BIT STRING 2228 } 2230 The signatureAlgorithm is the object identifier of the message 2231 digest/signature encryption scheme used to sign the certificate. The 2232 signatureValue is computed by the certificate issuer using this 2233 algorithm and the issuer private key. 2235 TBSCertificate ::= SEQUENCE { 2236 version EXPLICIT v3(2), 2237 serialNumber CertificateSerialNumber, 2238 signature AlgorithmIdentifier, 2239 issuer Name, 2240 validity Validity, 2241 subject Name, 2242 subjectPublicKeyInfo SubjectPublicKeyInfo, 2243 extensions EXPLICIT Extensions OPTIONAL 2244 } 2246 The serialNumber is an integer guaranteed to be unique for the 2247 generating host. The reference implementation uses the NTP seconds 2248 when the certificate was generated. The signature is the object 2249 identifier of the message digest/signature encryption scheme used to 2250 sign the certificate. It must be identical to the 2251 signatureAlgorithm. 2253 CertificateSerialNumber ::= INTEGER 2254 Validity ::= SEQUENCE { 2255 notBefore UTCTime, 2256 notAfter UTCTime 2257 } 2259 The notBefore and notAfter define the period of validity as defined 2260 in Appendix B. 2262 SubjectPublicKeyInfo ::= SEQUENCE { 2263 algorithm AlgorithmIdentifier, 2264 subjectPublicKey BIT STRING 2265 } 2267 The AlgorithmIdentifier specifies the encryption algorithm for the 2268 subject public key. The subjectPublicKey is the public key of the 2269 subject. 2271 Extensions ::= SEQUENCE SIZE (1..MAX) OF Extension 2272 Extension ::= SEQUENCE { 2273 extnID OBJECT IDENTIFIER, 2274 critical BOOLEAN DEFAULT FALSE, 2275 extnValue OCTET STRING 2276 } 2278 Name ::= SEQUENCE { 2279 OBJECT IDENTIFIER commonName 2280 PrintableString HostName 2281 } 2283 For trusted host certificates the subject and issuer HostName is the 2284 NTP name of the group, while for all other host certificates the 2285 subject and issuer HostName is the NTP name of the host. In the 2286 reference implementation if these names are not explicitly specified, 2287 they default to the string returned by the Unix gethostname() routine 2288 (trailing NUL removed). For other than self-signed certificates, the 2289 issuer HostName is the unique DNS name of the host signing the 2290 certificate. 2292 Authors' Addresses 2294 Brian Haberman (editor) 2295 The Johns Hopkins University Applied Physics Laboratory 2296 11100 Johns Hopkins Road 2297 Laurel, MD 20723-6099 2298 US 2300 Phone: +1 443 778 1319 2301 Email: brian@innovationslab.net 2303 Dr. David L. Mills 2304 University of Delaware 2305 Newark, DE 19716 2306 US 2308 Phone: +1 302 831 8247 2309 Email: mills@udel.edu 2311 Full Copyright Statement 2313 Copyright (C) The IETF Trust (2008). 2315 This document is subject to the rights, licenses and restrictions 2316 contained in BCP 78, and except as set forth therein, the authors 2317 retain all their rights. 2319 This document and the information contained herein are provided on an 2320 "AS IS" basis and THE CONTRIBUTOR, THE ORGANIZATION HE/SHE REPRESENTS 2321 OR IS SPONSORED BY (IF ANY), THE INTERNET SOCIETY, THE IETF TRUST AND 2322 THE INTERNET ENGINEERING TASK FORCE DISCLAIM ALL WARRANTIES, EXPRESS 2323 OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF 2324 THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED 2325 WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. 2327 Intellectual Property 2329 The IETF takes no position regarding the validity or scope of any 2330 Intellectual Property Rights or other rights that might be claimed to 2331 pertain to the implementation or use of the technology described in 2332 this document or the extent to which any license under such rights 2333 might or might not be available; nor does it represent that it has 2334 made any independent effort to identify any such rights. Information 2335 on the procedures with respect to rights in RFC documents can be 2336 found in BCP 78 and BCP 79. 2338 Copies of IPR disclosures made to the IETF Secretariat and any 2339 assurances of licenses to be made available, or the result of an 2340 attempt made to obtain a general license or permission for the use of 2341 such proprietary rights by implementers or users of this 2342 specification can be obtained from the IETF on-line IPR repository at 2343 http://www.ietf.org/ipr. 2345 The IETF invites any interested party to bring to its attention any 2346 copyrights, patents or patent applications, or other proprietary 2347 rights that may cover technology that may be required to implement 2348 this standard. Please address the information to the IETF at 2349 ietf-ipr@ietf.org.