draft-ietf-ntp-autokey-06.txt   draft-ietf-ntp-autokey-07.txt 
Network Working Group B. Haberman, Ed. Network Working Group B. Haberman, Ed.
Internet-Draft JHU/APL Internet-Draft JHU/APL
Obsoletes: RFC 1305 D. Mills Intended status: Informational D. Mills
(if approved) U. Delaware Expires: May 15, 2010 U. Delaware
Intended status: Informational July 8, 2009 November 11, 2009
Expires: January 9, 2010
Network Time Protocol Version 4 Autokey Specification Network Time Protocol Version 4 Autokey Specification
draft-ietf-ntp-autokey-06 draft-ietf-ntp-autokey-07
Abstract
This memo describes the Autokey security model for authenticating
servers to clients using the Network Time Protocol (NTP) and public
key cryptography. Its design is based on the premise that IPsec
schemes cannot be adopted intact, since that would preclude stateless
servers and severely compromise timekeeping accuracy. In addition,
PKI schemes presume authenticated time values are always available to
enforce certificate lifetimes; however, cryptographically verified
timestamps require interaction between the timekeeping and
authentication functions.
This memo includes the Autokey requirements analysis, design
principles and protocol specification. A detailed description of the
protocol states, events and transition functions is included. A
prototype of the Autokey design based on this memo has been
implemented, tested and documented in the NTP Version 4 (NTPv4)
software distribution for Unix, Windows and VMS at
http://www.ntp.org.
Status of this Memo Status of this Memo
This Internet-Draft is submitted to IETF in full conformance with the This Internet-Draft is submitted to IETF in full conformance with the
provisions of BCP 78 and BCP 79. This document may contain material provisions of BCP 78 and BCP 79.
from IETF Documents or IETF Contributions published or made publicly
available before November 10, 2008. The person(s) controlling the
copyright in some of this material may not have granted the IETF
Trust the right to allow modifications of such material outside the
IETF Standards Process. Without obtaining an adequate license from
the person(s) controlling the copyright in such materials, this
document may not be modified outside the IETF Standards Process, and
derivative works of it may not be created outside the IETF Standards
Process, except to format it for publication as an RFC or to
translate it into languages other than English.
Internet-Drafts are working documents of the Internet Engineering Internet-Drafts are working documents of the Internet Engineering
Task Force (IETF), its areas, and its working groups. Note that Task Force (IETF), its areas, and its working groups. Note that
other groups may also distribute working documents as Internet- other groups may also distribute working documents as Internet-
Drafts. Drafts.
Internet-Drafts are draft documents valid for a maximum of six months Internet-Drafts are draft documents valid for a maximum of six months
and may be updated, replaced, or obsoleted by other documents at any and may be updated, replaced, or obsoleted by other documents at any
time. It is inappropriate to use Internet-Drafts as reference time. It is inappropriate to use Internet-Drafts as reference
material or to cite them other than as "work in progress." material or to cite them other than as "work in progress."
The list of current Internet-Drafts can be accessed at The list of current Internet-Drafts can be accessed at
http://www.ietf.org/ietf/1id-abstracts.txt. http://www.ietf.org/ietf/1id-abstracts.txt.
The list of Internet-Draft Shadow Directories can be accessed at The list of Internet-Draft Shadow Directories can be accessed at
http://www.ietf.org/shadow.html. http://www.ietf.org/shadow.html.
This Internet-Draft will expire on January 9, 2010. This Internet-Draft will expire on May 15, 2010.
Copyright Notice Copyright Notice
Copyright (c) 2009 IETF Trust and the persons identified as the Copyright (c) 2009 IETF Trust and the persons identified as the
document authors. All rights reserved. document authors. All rights reserved.
This document is subject to BCP 78 and the IETF Trust's Legal This document is subject to BCP 78 and the IETF Trust's Legal
Provisions Relating to IETF Documents in effect on the date of Provisions Relating to IETF Documents
publication of this document (http://trustee.ietf.org/license-info). (http://trustee.ietf.org/license-info) in effect on the date of
Please review these documents carefully, as they describe your rights publication of this document. Please review these documents
and restrictions with respect to this document. carefully, as they describe your rights and restrictions with respect
to this document. Code Components extracted from this document must
Abstract include Simplified BSD License text as described in Section 4.e of
the Trust Legal Provisions and are provided without warranty as
This memo describes the Autokey security model for authenticating described in the BSD License.
servers to clients using the Network Time Protocol (NTP) and public
key cryptography. Its design is based on the premise that IPSEC
schemes cannot be adopted intact, since that would preclude stateless
servers and severely compromise timekeeping accuracy. In addition,
PKI schemes presume authenticated time values are always available to
enforce certificate lifetimes; however, cryptographically verified
timestamps require interaction between the timekeeping and
authentication functions.
This memo includes the Autokey requirements analysis, design This document may contain material from IETF Documents or IETF
principles and protocol specification. A detailed description of the Contributions published or made publicly available before November
protocol states, events and transition functions is included. A 10, 2008. The person(s) controlling the copyright in some of this
prototype of the Autokey design based on this memo has been material may not have granted the IETF Trust the right to allow
implemented, tested and documented in the NTP Version 4 (NTPv4) modifications of such material outside the IETF Standards Process.
software distribution for Unix, Windows and VMS at Without obtaining an adequate license from the person(s) controlling
http://www.ntp.org. the copyright in such materials, this document may not be modified
outside the IETF Standards Process, and derivative works of it may
not be created outside the IETF Standards Process, except to format
it for publication as an RFC or to translate it into languages other
than English.
Table of Contents Table of Contents
1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 4 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 4
2. NTP Security Model . . . . . . . . . . . . . . . . . . . . . . 4 2. NTP Security Model . . . . . . . . . . . . . . . . . . . . . . 4
3. Approach . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 3. Approach . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
4. Autokey Cryptography . . . . . . . . . . . . . . . . . . . . . 8 4. Autokey Cryptography . . . . . . . . . . . . . . . . . . . . . 8
5. NTP Secure Groups . . . . . . . . . . . . . . . . . . . . . . 11 5. Autokey Protocol Overview . . . . . . . . . . . . . . . . . . 12
6. Identity Schemes . . . . . . . . . . . . . . . . . . . . . . . 15 6. NTP Secure Groups . . . . . . . . . . . . . . . . . . . . . . 14
7. Timestamps and Filestamps . . . . . . . . . . . . . . . . . . 17 7. Identity Schemes . . . . . . . . . . . . . . . . . . . . . . . 18
8. Autokey Protocol Overview . . . . . . . . . . . . . . . . . . 18 8. Timestamps and Filestamps . . . . . . . . . . . . . . . . . . 20
9. Autokey Operations . . . . . . . . . . . . . . . . . . . . . . 20 9. Autokey Operations . . . . . . . . . . . . . . . . . . . . . . 21
10. Autokey Protocol Messages . . . . . . . . . . . . . . . . . . 22 10. Autokey Protocol Messages . . . . . . . . . . . . . . . . . . 23
11. No-Operation . . . . . . . . . . . . . . . . . . . . . . . . . 24 10.1. No-Operation . . . . . . . . . . . . . . . . . . . . . . 26
12. Association Message (ASSOC) . . . . . . . . . . . . . . . . . 25 10.2. Association Message (ASSOC) . . . . . . . . . . . . . . . 26
13. Certificate Message (CERT) . . . . . . . . . . . . . . . . . . 25 10.3. Certificate Message (CERT) . . . . . . . . . . . . . . . 26
14. Cookie Message (COOKIE) . . . . . . . . . . . . . . . . . . . 25 10.4. Cookie Message (COOKIE) . . . . . . . . . . . . . . . . . 26
15. Autokey Message (AUTO) . . . . . . . . . . . . . . . . . . . . 25 10.5. Autokey Message (AUTO) . . . . . . . . . . . . . . . . . 26
16. Leapseconds Values Message (LEAP) . . . . . . . . . . . . . . 26 10.6. Leapseconds Values Message (LEAP) . . . . . . . . . . . . 27
17. Sign Message (SIGN) . . . . . . . . . . . . . . . . . . . . . 26 10.7. Sign Message (SIGN) . . . . . . . . . . . . . . . . . . . 27
18. Identity Messages (IFF, GQ, MV) . . . . . . . . . . . . . . . 26 10.8. Identity Messages (IFF, GQ, MV) . . . . . . . . . . . . . 27
19. Autokey State Machine . . . . . . . . . . . . . . . . . . . . 26 11. Autokey State Machine . . . . . . . . . . . . . . . . . . . . 27
20. Status Word . . . . . . . . . . . . . . . . . . . . . . . . . 26 11.1. Status Word . . . . . . . . . . . . . . . . . . . . . . . 27
21. Host State Variables . . . . . . . . . . . . . . . . . . . . . 28 11.2. Host State Variables . . . . . . . . . . . . . . . . . . 30
22. Client State Variables (all modes) . . . . . . . . . . . . . . 30 11.3. Client State Variables (all modes) . . . . . . . . . . . 32
23. Protocol State Transitions . . . . . . . . . . . . . . . . . . 31 11.4. Protocol State Transitions . . . . . . . . . . . . . . . 32
24. Server Dance . . . . . . . . . . . . . . . . . . . . . . . . . 31 11.4.1. Server Dance . . . . . . . . . . . . . . . . . . . . 33
25. Broadcast Dance . . . . . . . . . . . . . . . . . . . . . . . 32 11.4.2. Broadcast Dance . . . . . . . . . . . . . . . . . . . 33
26. Symmetric Dance . . . . . . . . . . . . . . . . . . . . . . . 33 11.4.3. Symmetric Dance . . . . . . . . . . . . . . . . . . . 35
27. Error Recovery . . . . . . . . . . . . . . . . . . . . . . . . 34 11.5. Error Recovery . . . . . . . . . . . . . . . . . . . . . 36
28. Security Considerations . . . . . . . . . . . . . . . . . . . 36 12. Security Considerations . . . . . . . . . . . . . . . . . . . 37
29. Protocol Vulnerability . . . . . . . . . . . . . . . . . . . . 36 12.1. Protocol Vulnerability . . . . . . . . . . . . . . . . . 37
30. Clogging Vulnerability . . . . . . . . . . . . . . . . . . . . 37 12.2. Clogging Vulnerability . . . . . . . . . . . . . . . . . 38
31. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 38 13. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 39
32. References . . . . . . . . . . . . . . . . . . . . . . . . . . 38 14. References . . . . . . . . . . . . . . . . . . . . . . . . . . 39
32.1. Normative References . . . . . . . . . . . . . . . . . . 38 14.1. Normative References . . . . . . . . . . . . . . . . . . 39
32.2. Informative References . . . . . . . . . . . . . . . . . 38 14.2. Informative References . . . . . . . . . . . . . . . . . 39
Appendix A. Timestamps, Filestamps and Partial Ordering . . . . . 39 Appendix A. Timestamps, Filestamps and Partial Ordering . . . . . 41
Appendix B. Identity Schemes . . . . . . . . . . . . . . . . . . 41 Appendix B. Identity Schemes . . . . . . . . . . . . . . . . . . 42
Appendix C. Private Certificate (PC) Scheme . . . . . . . . . . . 41 Appendix C. Private Certificate (PC) Scheme . . . . . . . . . . . 42
Appendix D. Trusted Certificate (TC) Scheme . . . . . . . . . . . 42 Appendix D. Trusted Certificate (TC) Scheme . . . . . . . . . . . 43
Appendix E. Schnorr (IFF) Identity Scheme . . . . . . . . . . . . 42 Appendix E. Schnorr (IFF) Identity Scheme . . . . . . . . . . . . 44
Appendix F. Guillard-Quisquater (GQ) Identity Scheme . . . . . . 44 Appendix F. Guillard-Quisquater (GQ) Identity Scheme . . . . . . 45
Appendix G. Mu-Varadharajan (MV) Identity Scheme . . . . . . . . 46 Appendix G. Mu-Varadharajan (MV) Identity Scheme . . . . . . . . 47
Appendix H. ASN.1 Encoding Rules . . . . . . . . . . . . . . . . 49 Appendix H. ASN.1 Encoding Rules . . . . . . . . . . . . . . . . 50
Appendix I. COOKIE request, IFF response, GQ response, MV Appendix I. COOKIE request, IFF response, GQ response, MV
response . . . . . . . . . . . . . . . . . . . . . . 49 response . . . . . . . . . . . . . . . . . . . . . . 50
Appendix J. Certificates . . . . . . . . . . . . . . . . . . . . 50 Appendix J. Certificates . . . . . . . . . . . . . . . . . . . . 51
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . . 52 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . . 53
1. Introduction 1. Introduction
A distributed network service requires reliable, ubiquitous and A distributed network service requires reliable, ubiquitous and
survivable provisions to prevent accidental or malicious attacks on survivable provisions to prevent accidental or malicious attacks on
the servers and clients in the network or the values they exchange. the servers and clients in the network or the values they exchange.
Reliability requires that clients can determine that received packets Reliability requires that clients can determine that received packets
are authentic; that is, were actually sent by the intended server and are authentic; that is, were actually sent by the intended server and
not manufactured or modified by an intruder. Ubiquity requires that not manufactured or modified by an intruder. Ubiquity requires that
a client can verify the authenticity of a server using only public a client can verify the authenticity of a server using only public
skipping to change at page 4, line 37 skipping to change at page 4, line 37
digital signature would result in unacceptably poor timekeeping digital signature would result in unacceptably poor timekeeping
performance. performance.
The Autokey protocol is based on a combination of PKI and a pseudo- The Autokey protocol is based on a combination of PKI and a pseudo-
random sequence generated by repeated hashes of a cryptographic value random sequence generated by repeated hashes of a cryptographic value
involving both public and private components. This scheme has been involving both public and private components. This scheme has been
implemented, tested and deployed in the Internet of today. A implemented, tested and deployed in the Internet of today. A
detailed description of the security model, design principles and detailed description of the security model, design principles and
implementation is presented in this memo. implementation is presented in this memo.
This informational document describes the NTP extensions for Autokey
as implemented in an NTPv4 software distribution available from
http://www.ntp.org. This description is provided to offer a basis
for future work and a reference for the software release. This
document also describes the motivation for the extensions within the
protocol.
2. NTP Security Model 2. NTP Security Model
NTP security requirements are even more stringent than most other NTP security requirements are even more stringent than most other
distributed services. First, the operation of the authentication distributed services. First, the operation of the authentication
mechanism and the time synchronization mechanism are inextricably mechanism and the time synchronization mechanism are inextricably
intertwined. Reliable time synchronization requires cryptographic intertwined. Reliable time synchronization requires cryptographic
keys which are valid only over a designated time intervals; but, time keys which are valid only over a designated time intervals; but, time
intervals can be enforced only when participating servers and clients intervals can be enforced only when participating servers and clients
are reliably synchronized to UTC. In addition, the NTP subnet is are reliably synchronized to UTC. In addition, the NTP subnet is
hierarchical by nature, so time and trust flow from the primary hierarchical by nature, so time and trust flow from the primary
skipping to change at page 5, line 28 skipping to change at page 5, line 34
number of concurrent associations with different servers and uses a number of concurrent associations with different servers and uses a
crafted agreement algorithm to pluck truechimers from the population crafted agreement algorithm to pluck truechimers from the population
possibly including falsetickers. A particular association is possibly including falsetickers. A particular association is
proventic if the server certificate and identity have been verified proventic if the server certificate and identity have been verified
by the means described in this memo. However, the statement "the by the means described in this memo. However, the statement "the
client is synchronized to proventic sources" means that the system client is synchronized to proventic sources" means that the system
clock has been set using the time values of one or more proventic clock has been set using the time values of one or more proventic
associations and according to the NTP mitigation algorithms. associations and according to the NTP mitigation algorithms.
Over the last several years the IETF has defined and evolved the Over the last several years the IETF has defined and evolved the
IPSEC infrastructure for privacy protection and source authentication IPsec infrastructure for privacy protection and source authentication
in the Internet. The infrastructure includes the Encapsulating in the Internet. The infrastructure includes the Encapsulating
Security Payload (ESP) [RFC2406] and Authentication Header (AH) Security Payload (ESP) [RFC2406] and Authentication Header (AH)
[RFC2402] for IPv4 and IPv6. Cryptographic algorithms that use these [RFC2402] for IPv4 and IPv6. Cryptographic algorithms that use these
headers for various purposes include those developed for the PKI, headers for various purposes include those developed for the PKI,
including various message digest, digital signature and key agreement including various message digest, digital signature and key agreement
algorithms. This memo takes no position on which message digest or algorithms. This memo takes no position on which message digest or
which digital signature algorithm is used. This is established by a which digital signature algorithm is used. This is established by a
profile for each community of users. profile for each community of users.
It will facilitate the discussion in this memo to refer to the It will facilitate the discussion in this memo to refer to the
skipping to change at page 6, line 42 skipping to change at page 6, line 49
net. net.
2. An intruder can generate packets faster than the server, network 2. An intruder can generate packets faster than the server, network
or client can process them, especially if they require expensive or client can process them, especially if they require expensive
cryptographic computations. cryptographic computations.
3. In a wiretap attack the intruder can intercept, modify and replay 3. In a wiretap attack the intruder can intercept, modify and replay
a packet. However, it cannot permanently prevent onward a packet. However, it cannot permanently prevent onward
transmission of the original packet; that is, it cannot break the transmission of the original packet; that is, it cannot break the
wire, only tell lies and congest it. Except in unlikely cases wire, only tell lies and congest it. Except in unlikely cases
considered in Section 28, the modified packet cannot arrive at considered in Section 12, the modified packet cannot arrive at
the victim before the original packet, nor does it have the the victim before the original packet, nor does it have the
server private keys or identity parameters. server private keys or identity parameters.
4. In a middleman or masquerade attack the intruder is positioned 4. In a man-in-the-middle or masquerade attack the intruder is
between the server and client, so it can intercept, modify and positioned between the server and client, so it can intercept,
replay a packet and prevent onward transmission of the original modify and replay a packet and prevent onward transmission of the
packet. Except in unlikely cases considered in Section 28, the original packet. Except in unlikely cases considered in
middleman does not have the server private keys. Section 12, the middleman does not have the server private keys.
The NTP security model assumes the following possible limitations. The NTP security model assumes the following possible limitations.
1. The running times for public key algorithms are relatively long 1. The running times for public key algorithms are relatively long
and highly variable. In general, the performance of the time and highly variable. In general, the performance of the time
synchronization function is badly degraded if these algorithms synchronization function is badly degraded if these algorithms
must be used for every NTP packet. must be used for every NTP packet.
2. In some modes of operation it is not feasible for a server to 2. In some modes of operation it is not feasible for a server to
retain state variables for every client. It is however feasible retain state variables for every client. It is however feasible
skipping to change at page 7, line 50 skipping to change at page 8, line 8
The Autokey protocol described in this memo is designed to meet the The Autokey protocol described in this memo is designed to meet the
following objectives. In-depth discussions on these objectives is in following objectives. In-depth discussions on these objectives is in
the web briefings and will not be elaborated in this memo. Note that the web briefings and will not be elaborated in this memo. Note that
here and elsewhere in this memo mention of broadcast mode means here and elsewhere in this memo mention of broadcast mode means
multicast mode as well, with exceptions as noted in the NTP software multicast mode as well, with exceptions as noted in the NTP software
documentation. documentation.
1. It must interoperate with the existing NTP architecture model and 1. It must interoperate with the existing NTP architecture model and
protocol design. In particular, it must support the symmetric protocol design. In particular, it must support the symmetric
key scheme described in [RFC1305]. key scheme described in [RFC1305]. As a practical matter, the
reference implementation must use the same internal key
management system, including the use of 32-bit key IDs and
existing mechanisms to store, activate and revoke keys.
2. It must provide for the independent collection of cryptographic 2. It must provide for the independent collection of cryptographic
values and time values. A NTP packet is accepted for processing values and time values. A NTP packet is accepted for processing
only when the required cryptographic values have been obtained only when the required cryptographic values have been obtained
and verified and the packet has passed all header sanity checks. and verified and the packet has passed all header sanity checks.
3. It must not significantly degrade the potential accuracy of the 3. It must not significantly degrade the potential accuracy of the
NTP synchronization algorithms. In particular, it must not make NTP synchronization algorithms. In particular, it must not make
unreasonable demands on the network or host processor and memory unreasonable demands on the network or host processor and memory
resources. resources.
skipping to change at page 8, line 46 skipping to change at page 9, line 7
deflect intruder attacks while maintaining the integrity and accuracy deflect intruder attacks while maintaining the integrity and accuracy
of the time synchronization function. of the time synchronization function.
Autokey, like many other remote procedure call (RPC) protocols, Autokey, like many other remote procedure call (RPC) protocols,
depends on message digests for basic authentication; however, it is depends on message digests for basic authentication; however, it is
important to understand that message digests are also used by NTP important to understand that message digests are also used by NTP
when Autokey is not available or not configured. Selection of the when Autokey is not available or not configured. Selection of the
digest algorithm is a function of NTP configuration and is digest algorithm is a function of NTP configuration and is
transparent to Autokey. transparent to Autokey.
The protocol design supports both 128-bit and 160-bit message digest The protocol design and reference implementation support both 128-bit
algorithms, each with a 32-bit key ID. The message digest algorthm and 160-bit message digest algorithms, each with a 32-bit key ID. In
is a property of NTPv4 and is not specified in this memo. In order order to retain backward compatibility with NTPv3, the NTPv4 key ID
to retain backward compatibility with NTPv3, the key ID space is space is partitioned in two subspaces at a pivot point of 65536.
partitioned in two subspaces at a pivot point of 65536. Symmetric Symmetric key IDs have values less than the pivot and indefinite
key IDs have values less than the pivot and indefinite lifetime. lifetime. Autokey key IDs have pseudo-random values equal to or
greater than the pivot and are expunged immediately after use.
Autokey key IDs have pseudo-random values equal to or greater than
the pivot and are expunged immediately after use.
Both symmetric key and public key cryptography authenticate as shown Both symmetric key and public key cryptography authenticate as shown
in Figure 1. The server looks up the key associated with the key ID in Figure 1. The server looks up the key associated with the key ID
and calculates the message digest from the NTP header and extension and calculates the message digest from the NTP header and extension
fields together with the key value. The key ID and digest form the fields together with the key value. The key ID and digest form the
message authentication code (MAC) included with the message. The message authentication code (MAC) included with the message. The
client does the same computation using its local copy of the key and client does the same computation using its local copy of the key and
compares the result with the digest in the MAC. If the values agree, compares the result with the digest in the MAC. If the values agree,
the message is assumed authentic. the message is assumed authentic.
skipping to change at page 9, line 48 skipping to change at page 10, line 7
independently at the same time. independently at the same time.
+-------------+-------------+--------+--------+ +-------------+-------------+--------+--------+
| Src Address | Dst Address | Key ID | Cookie | | Src Address | Dst Address | Key ID | Cookie |
+-------------+-------------+--------+--------+ +-------------+-------------+--------+--------+
Figure 2: NTPv4 Autokey Figure 2: NTPv4 Autokey
An autokey is computed from four fields in network byte order as An autokey is computed from four fields in network byte order as
shown in Figure 2. The four values are hashed using the MD5 shown in Figure 2. The four values are hashed using the MD5
algorithm to produce the 128-bit autokey value. For use with IPv4 algorithm to produce the 128-bit autokey value, which in the
the Src Address and Dst Address fields contain 32 bits; for use with reference implementation is stored along with the key ID in a cache
IPv6 these fields contain 128 bits. In either case the Key ID and used for symmetric keys as well as autokeys. Keys are retrieved from
Cookie fields contain 32 bits. Thus, an IPv4 autokey has four 32-bit the cache by key ID using hash tables and a fast lookup algorithm.
words, while an IPv6 autokey has ten 32-bit words. The source and
destination addresses and key ID are public values visible in the For use with IPv4 the Src Address and Dst Address fields contain 32
packet, while the cookie can be a public value or shared private bits; for use with IPv6 these fields contain 128 bits. In either
value, depending on the NTP mode. case the Key ID and Cookie fields contain 32 bits. Thus, an IPv4
autokey has four 32-bit words, while an IPv6 autokey has ten 32-bit
words. The source and destination addresses and key ID are public
values visible in the packet, while the cookie can be a public value
or shared private value, depending on the NTP mode.
The NTP packet format has been augmented to include one or more The NTP packet format has been augmented to include one or more
extension fields piggybacked between the original NTP header and the extension fields piggybacked between the original NTP header and the
MAC. For packets without extension fields, the cookie is a shared MAC. For packets without extension fields, the cookie is a shared
private value. For packets with extension fields, the cookie has a private value. For packets with extension fields, the cookie has a
default public value of zero, since these packets are validated default public value of zero, since these packets are validated
independently using digital signatures. independently using digital signatures.
There are some scenarios where the use of endpoint IP addresses may There are some scenarios where the use of endpoint IP addresses may
be difficult or impossible. These include configurations where be difficult or impossible. These include configurations where
skipping to change at page 11, line 11 skipping to change at page 11, line 38
The first 32 bits of the result in network byte order become the next The first 32 bits of the result in network byte order become the next
key ID. The MD5 hash of the autokey is the key value saved in the key ID. The MD5 hash of the autokey is the key value saved in the
key cache along with the key ID. The first 32 bits of the key become key cache along with the key ID. The first 32 bits of the key become
the key ID for the next autokey assigned index 1. the key ID for the next autokey assigned index 1.
Operations continue to generate the entire list. It may happen that Operations continue to generate the entire list. It may happen that
a newly generated key ID is less than the pivot or collides with a newly generated key ID is less than the pivot or collides with
another one already generated (birthday event). When this happens, another one already generated (birthday event). When this happens,
which occurs only rarely, the key list is terminated at that point. which occurs only rarely, the key list is terminated at that point.
The lifetime of each key is set to expire one poll interval after its The lifetime of each key is set to expire one poll interval after its
scheduled use. The list is terminated when the maximum key lifetime scheduled use. In the reference implementation, the list is
is about one hour, so for poll intervals above one hour a new key terminated when the maximum key lifetime is about one hour, so for
list containing only a single entry is regenerated for every poll. poll intervals above one hour a new key list containing only a single
entry is regenerated for every poll.
+------------------+ +------------------+
| NTP Header and | | NTP Header and |
| Extension Fields | | Extension Fields |
+------------------+ +------------------+
| | | |
\|/ \|/ +---------+ \|/ \|/ +---------+
**************** +--------+ | Session | **************** +--------+ | Session |
* COMPUTE HASH *<---| Key ID |<---| Key ID | * COMPUTE HASH *<---| Key ID |<---| Key ID |
**************** +--------+ | List | **************** +--------+ | List |
skipping to change at page 11, line 43 skipping to change at page 12, line 33
ID for that entry, collectively called the autokey values. The ID for that entry, collectively called the autokey values. The
autokey values are then signed for use later. The list is used in autokey values are then signed for use later. The list is used in
reverse order as shown in Figure 4, so that the first autokey used is reverse order as shown in Figure 4, so that the first autokey used is
the last one generated. the last one generated.
The Autokey protocol includes a message to retrieve the autokey The Autokey protocol includes a message to retrieve the autokey
values and verify the signature, so that subsequent packets can be values and verify the signature, so that subsequent packets can be
validated using one or more hashes that eventually match the last key validated using one or more hashes that eventually match the last key
ID (valid) or exceed the index (invalid). This is called the autokey ID (valid) or exceed the index (invalid). This is called the autokey
test in the following and is done for every packet, including those test in the following and is done for every packet, including those
with and without extension fields. The most recent key ID received with and without extension fields. In the reference implementation
is saved for comparison with the first 32 bits in network byte order the most recent key ID received is saved for comparison with the
of the next following key value. This minimizes the number of hash first 32 bits in network byte order of the next following key value.
operations in case a single packet is lost. This minimizes the number of hash operations in case a single packet
is lost.
5. NTP Secure Groups 5. Autokey Protocol Overview
The Autokey protocol includes a number of request/response exchanges
that must be completed in order. In each exchange a client sends a
request message with data and expects a server response message with
data. Requests and responses are contained in extension fields, one
request or response in each field, as described later. An NTP packet
can contain one request message and one or more response messages.
Following is a list of these messages.
o Parameter exchange. The request includes the client host name and
status word; the response includes the server host name and status
word. The status word specifies the digest/signature scheme to
use and the identity schemes supported.
o Certificate exchange. The request includes the subject name of a
certificate; the response consists of a signed certificate with
that subject name. If the issuer name is not the same as the
subject name, it has been signed by a host one step closer to a
trusted host, so certificate retrieval continues for the issuer
name. If it is trusted and self-signed, the trail concludes at
the trusted host. If nontrusted and self-signed, the host
certificate has not yet been signed, so the trail temporarily
loops. Completion of this exchange lights the VAL bit as
described below.
o Identity exchange. The certificate trail is generally not
considered sufficient protection against man-in-the-middle attacks
unless additional protection such as the proof-of-possession
scheme described in [RFC2875] is available, but this is expensive
and requires servers to retain state. Autokey can use one of the
challenge/response identity schemes described in Appendix B.
Completion of this exchange lights the IFF bit as described below.
o Cookie exchange. The request includes the public key of the
server. The response includes the server cookie encrypted with
this key. The client uses this value when constructing the key
list. Completion of this exchange lights the COOK bit as
described below.
o Autokey exchange. The request includes either no data or the
autokey values in symmetric modes. The response includes the
autokey values of the server. These values are used to verify the
autokey sequence. Completion of this exchange lights the AUT bit
as described below.
o Sign exchange. This exchange is executed only when the client has
synchronized to a proventic source. The request includes the
self-signed client certificate. The server acting as CA
interprets the certificate as a X.509v3 certificate request. It
extracts the subject, issuer, and extension fields, builds a new
certificate with these data along with its own serial number and
expiration time, then signs it using its own private key and
includes it in the response. The client uses the signed
certificate in its own role as server for dependent clients.
Completion of this exchange lights the SIGN bit as described
below.
o Leapseconds exchange. This exchange is executed only when the
client has synchronized to a proventic source. This exchange
occurs when the server has the leapseconds values, as indicated in
the host status word. If so, the client requests the values and
compares them with its own values, if available. If the server
values are newer than the client values, the client replaces its
own with the server values. The client, acting as server, can now
provide the most recent values to its dependent clients. In
symmetric mode, this results in both peers having the newest
values. Completion of this exchange lights the LPT bit as
described below.
Once the certificates and identity have been validated, subsequent
packets are validated by digital signatures and the autokey sequence.
The association is now proventic with respect to the downstratum
trusted host, but is not yet selectable to discipline the system
clock. The associations accumulate time values and the mitigation
algorithms continue in the usual way. When these algorithms have
culled the falsetickers and cluster outlyers and at least three
survivors remain, the system clock has been synchronized to a
proventic source.
The time values for truechimer sources form a proventic partial
ordering relative to the applicable signature timestamps. This
raises the interesting issue of how to mitigate between the
timestamps of different associations. It might happen, for instance,
that the timestamp of some Autokey message is ahead of the system
clock by some presumably small amount. For this reason, timestamp
comparisons between different associations and between associations
and the system clock are avoided, except in the NTP intersection and
clustering algorithms and when determining whether a certificate has
expired.
6. NTP Secure Groups
NTP secure groups are used to define cryptographic compartments and NTP secure groups are used to define cryptographic compartments and
security hierarchies. A secure group consists of a number of hosts security hierarchies. A secure group consists of a number of hosts
dynamically assembled as a forest with roots the trusted hosts (THs) dynamically assembled as a forest with roots the trusted hosts (THs)
at the lowest stratum of the group. The THs do not have to be, but at the lowest stratum of the group. The THs do not have to be, but
often are, primary (stratum 1) servers. A trusted authority (TA), often are, primary (stratum 1) servers. A trusted authority (TA),
not necessarily a group host, generates private identity keys for not necessarily a group host, generates private identity keys for
servers and public identity keys for clients at the leaves of the servers and public identity keys for clients at the leaves of the
forest. The TA deploys the server keys to the THs and other forest. The TA deploys the server keys to the THs and other
designated servers using secure means and posts the client keys on a designated servers using secure means and posts the client keys on a
skipping to change at page 14, line 16 skipping to change at page 16, line 50
Stratum 3 Stratum 3
Figure 5: NTP Secure Groups Figure 5: NTP Secure Groups
The steps in hiking the certificate trails and verifying identity are The steps in hiking the certificate trails and verifying identity are
as follows. Note the step number in the description matches the step as follows. Note the step number in the description matches the step
number in the figure. number in the figure.
1. The girls start by loading the host key, sign key, self-signed 1. The girls start by loading the host key, sign key, self-signed
certificate and group key. Each client and server acting as a certificate and group key. Each client and server acting as a
client They starts the Autokey protocol by retrieving the server client starts the Autokey protocol by retrieving the server host
host name and digest/signature. This is done using the ASSOC name and digest/signature. This is done using the ASSOC exchange
exchange described later. described later.
2. They continue to load certificates recursively until a self- 2. They continue to load certificates recursively until a self-
signed trusted certificate is found. Brenda and Denise signed trusted certificate is found. Brenda and Denise
immediately find trusted certificates for Alice and Carol, immediately find trusted certificates for Alice and Carol,
respectively, but Eileen will loop because neither Brenda nor respectively, but Eileen will loop because neither Brenda nor
Denise have their own certificates signed by either Alice or Denise have their own certificates signed by either Alice or
Carol. This is done using the CERT exchange described later. Carol. This is done using the CERT exchange described later.
3. Brenda and Denise continue with the selected identity schemes to 3. Brenda and Denise continue with the selected identity schemes to
verify that Alice and Carol have the correct group key previously verify that Alice and Carol have the correct group key previously
skipping to change at page 15, line 39 skipping to change at page 18, line 39
belong to national standards laboratories and their server keys are belong to national standards laboratories and their server keys are
used to confirm identity between members of each group. Carol is a used to confirm identity between members of each group. Carol is a
prominent corporation receiving standards products and requiring prominent corporation receiving standards products and requiring
cryptographic authentication. Perhaps under contract, host X cryptographic authentication. Perhaps under contract, host X
belonging to Carol has client keys for both Alice and Helen and belonging to Carol has client keys for both Alice and Helen and
server keys for Carol. The Autokey protocol operates for each group server keys for Carol. The Autokey protocol operates for each group
separately while preserving security separation. Host X can prove separately while preserving security separation. Host X can prove
identity in Carol to clients Y and Z, but cannot prove to anybody identity in Carol to clients Y and Z, but cannot prove to anybody
that it belongs to either Alice or Helen. that it belongs to either Alice or Helen.
6. Identity Schemes 7. Identity Schemes
A digital signature scheme provides secure server authentication, but A digital signature scheme provides secure server authentication, but
it does not provide protection against masquerade, unless the server it does not provide protection against masquerade, unless the server
identity is verified by other means. The PKI model requires a server identity is verified by other means. The PKI model requires a server
to prove identity to the client by a certificate trail, but to prove identity to the client by a certificate trail, but
independent means such as a driver's license are required for a CA to independent means such as a driver's license are required for a CA to
sign the server certificate. While Autokey supports this model by sign the server certificate. While Autokey supports this model by
default, in a hierarchical ad-hoc network, especially with server default, in a hierarchical ad-hoc network, especially with server
discovery schemes like NTP Manycast, proving identity at each rest discovery schemes like NTP Manycast, proving identity at each rest
stop on the trail must be an intrinsic capability of Autokey itself. stop on the trail must be an intrinsic capability of Autokey itself.
skipping to change at page 16, line 30 skipping to change at page 19, line 30
3. The scheme should allow designated servers to prove identity to 3. The scheme should allow designated servers to prove identity to
designated clients, but not allow clients acting as servers to designated clients, but not allow clients acting as servers to
prove identity to dependent clients. prove identity to dependent clients.
4. To the geatest extent possible, the scheme should represent a 4. To the geatest extent possible, the scheme should represent a
zero-knowledge proof; that is, the client should be able to zero-knowledge proof; that is, the client should be able to
verify the server has the correct group key, but without knowing verify the server has the correct group key, but without knowing
the key itself. the key itself.
There are five schemes proposed to prove identity: (1) private There are five schemes now implemented in the NTPv4 reference
certificate (PC), (2) trusted certificate (TC), (3) a modified implementation to prove identity: (1) private certificate (PC), (2)
Schnorr algorithm (IFF aka Identify Friendly or Foe), (4) a modified trusted certificate (TC), (3) a modified Schnorr algorithm (IFF aka
Guillou-Quisquater algorithm (GQ), and (5) a modified Mu-Varadharajan Identify Friendly or Foe), (4) a modified Guillou-Quisquater
algorithm (MV). Not all of these provide the same level of algorithm (GQ), and (5) a modified Mu-Varadharajan algorithm (MV).
protection and one, TC, provides no protection but is included for Not all of these provide the same level of protection and one, TC,
comparison. Which of these is is to be used must be specified in a provides no protection but is included for comparison. Following is
profile for this specification. Following is a brief summary a brief summary description of each; details are given in Appendix B.
description of each; details are given in Appendix B.
The PC scheme involves a private certificate as group key. The The PC scheme involves a private certificate as group key. The
certificate is distributed to all other group members by secure means certificate is distributed to all other group members by secure means
and is never revealed outside the group. In effect, the private and is never revealed outside the group. In effect, the private
certificate is used as a symmetric key. This scheme is used certificate is used as a symmetric key. This scheme is used
primarily for testing and development and is not recommended for primarily for testing and development and is not recommended for
regular use and is not considered further in this memo. regular use and is not considered further in this memo.
All other schemes involve a conventional certificate trail as All other schemes involve a conventional certificate trail as
described in [RFC5280]. This is the default scheme when an identity described in [RFC5280]. This is the default scheme when an identity
skipping to change at page 17, line 17 skipping to change at page 20, line 15
intruder cannot deduce the server key, even after repeated intruder cannot deduce the server key, even after repeated
observations of multiple exchanges. In addition, the MV scheme is observations of multiple exchanges. In addition, the MV scheme is
properly described as a zero-knowledge proof, because the client can properly described as a zero-knowledge proof, because the client can
verify the server has the correct group key without either the server verify the server has the correct group key without either the server
or client knowing its value. These schemes start when the client or client knowing its value. These schemes start when the client
sends a nonce to the server, which then rolls its own nonce, performs sends a nonce to the server, which then rolls its own nonce, performs
a mathematical operation and sends the results to the client. The a mathematical operation and sends the results to the client. The
client performs another mathematical operation and verifies the client performs another mathematical operation and verifies the
results are correct. results are correct.
7. Timestamps and Filestamps 8. Timestamps and Filestamps
While public key signatures provide strong protection against While public key signatures provide strong protection against
misrepresentation of source, computing them is expensive. This misrepresentation of source, computing them is expensive. This
invites the opportunity for an intruder to clog the client or server invites the opportunity for an intruder to clog the client or server
by replaying old messages or originating bogus messages. A client by replaying old messages or originating bogus messages. A client
receiving such messages might be forced to verify what turns out to receiving such messages might be forced to verify what turns out to
be an invalid signature and consume significant processor resources. be an invalid signature and consume significant processor resources.
In order to foil such attacks, every Autokey message carries a In order to foil such attacks, every Autokey message carries a
timestamp in the form of the NTP seconds when it was. If the system timestamp in the form of the NTP seconds when it was created. If the
clock is synchronized to a proventic source, a signature is produced system clock is synchronized to a proventic source, a signature is
with valid (nonzero) timestamp. Otherwise, there is no signature and produced with valid (nonzero) timestamp. Otherwise, there is no
the timestamp is invalid (zero). The protocol detects and discards signature and the timestamp is invalid (zero). The protocol detects
extension fields with old or duplicate timestamps, before any values and discards extension fields with old or duplicate timestamps,
are used or signatures are verified. before any values are used or signatures are verified.
Signatures are computed only when cryptographic values are created or Signatures are computed only when cryptographic values are created or
modified, which is by design not very often. Extension fields modified, which is by design not very often. Extension fields
carrying these signatures are copied to messages as needed, but the carrying these signatures are copied to messages as needed, but the
signatures are not recomputed. There are three signature types: signatures are not recomputed. There are three signature types:
1. Cookie signature/timestamp. The cookie is signed when created by 1. Cookie signature/timestamp. The cookie is signed when created by
the server and sent to the client. the server and sent to the client.
2. Autokey signature/timestamp. The autokey values are signed when 2. Autokey signature/timestamp. The autokey values are signed when
skipping to change at page 18, line 35 skipping to change at page 21, line 34
It is important that filestamps be proventic data; thus, they cannot It is important that filestamps be proventic data; thus, they cannot
be produced unless the producer has been synchronized to a proventic be produced unless the producer has been synchronized to a proventic
source. As such, the filestamps throughout the NTP subnet represent source. As such, the filestamps throughout the NTP subnet represent
a partial ordering of all creation epochs and serve as means to a partial ordering of all creation epochs and serve as means to
expunge old data and insure new data are consistent. As the data are expunge old data and insure new data are consistent. As the data are
forwarded from server to client, the filestamps are preserved, forwarded from server to client, the filestamps are preserved,
including those for certificate and leapseconds values. Packets with including those for certificate and leapseconds values. Packets with
older filestamps are discarded before spending cycles to verify the older filestamps are discarded before spending cycles to verify the
signature. signature.
8. Autokey Protocol Overview
The Autokey protocol includes a number of request/response exchanges
that must be completed in order. In each exchange a client sends a
request message with data and expects a server response message with
data. Requests and responses are contained in extension fields, one
request or response in each field, as described later. An NTP packet
can contain one request message and one or more response messages.
Following is a list of these messages.
o Parameter exchange. The request includes the client host name and
status word; the response includes the server host name and status
word. The status word specifies the digest/signature scheme to
use and the identity schemes supported.
o Certificate exchange. The request includes the subject name of a
certificate; the response consists of a signed certificate with
that subject name. If the issuer name is not the same as the
subject name, it has been signed by a host one step closer to a
trusted host, so certificate retrieval continues for the issuer
name. If it is trusted and self-signed, the trail concludes at
the trusted host. If nontrusted and self-signed, the host
certificate has not yet been signed, so the trail temporarily
loops. Completion of this exchange lights the VAL bit as
described below.
o Identity exchange. The certificate trail is generally not
considered sufficient protection against middleman attacks unless
additional protection such as the proof-of-possession scheme
described in [RFC2875] is available, but this is expensive and
requires servers to retain state. Autokey can use one of the
challenge/response identity schemes described in Appendix B.
Completion of this exchange lights the IFF bit as described below.
o Cookie exchange. The request includes the public key of the. The
response includes the server cookie encrypted with this key. The
client uses this value when constructing the key list. Completion
of this exchange lights the COOK bit as described below.
o Autokey exchange. The request includes either no data or the
autokey values in symmetric modes. The response includes the
autokey values of the server. These values are used to verify the
autokey sequence. Completion of this exchange lights the AUT bit
as described below.
o Sign exchange. This exchange is executed only when the client has
synchronized to a proventic source. The request includes the
self-signed client certificate. The server acting as CA
interprets the certificate as a X.509v3 certificate request. It
extracts the subject, issuer, and extension fields, builds a new
certificate with these data along with its own serial number and
expiration time, then signs it using its own public key and
includes it in the response. The client uses the signed
certificate in its own role as server for dependent clients.
Completion of this exchange lights the SIGN bit as described
below.
o Leapseconds exchange. This exchange is executed only when the
client has synchronized to a proventic source. This exchange
occurs when the server has the leapseconds values, as indicated in
the host status word. If so, the client requests the values and
compares them with its own values, if available. If the server
values are newer than the client values, the client replaces its
own with the server values. The client, acting as server, can now
provide the most recent values to its dependent clients. In
symmetric mode, this results in both peers having the newest
values. Completion of this exchange lights the LPT bit as
described below.
Once the certificates and identity have been validated, subsequent
packets are validated by digital signatures and the autokey sequence.
The association is now proventic with respect to the downstratum
trusted host, but is not yet selectable to discipline the system
clock. The associations accumulate time values and the mitigation
algorithms continue in the usual way. When these algorithms have
culled the falsetickers and cluster outlyers and at least three
survivors remain, the system clock has been synchronized to a
proventic source.
The time values for truechimer sources form a proventic partial
ordering relative to the applicable signature timestamps. This
raises the interesting issue of how to mitigate between the
timestamps of different associations. It might happen, for instance,
that the timestamp of some Autokey message is ahead of the system
clock by some presumably small amount. For this reason, timestamp
comparisons between different associations and between associations
and the system clock are avoided, except in the NTP intersection and
clustering algorithms and when determining whether a certificate has
expired.
9. Autokey Operations 9. Autokey Operations
The NTP protocol has three principal modes of operation: client/ The NTP protocol has three principal modes of operation: client/
server, symmetric and broadcast and each has its own Autokey program, server, symmetric and broadcast and each has its own Autokey program,
or dance. Autokey choreography is designed to be nonintrusive and to or dance. Autokey choreography is designed to be nonintrusive and to
require no additional packets other than for regular NTP operations. require no additional packets other than for regular NTP operations.
The NTP and Autokey protocols operate simultaneously and The NTP and Autokey protocols operate simultaneously and
independently. When the dance is complete, subsequent packets are independently. When the dance is complete, subsequent packets are
validated by the autokey sequence and thus considered proventic as validated by the autokey sequence and thus considered proventic as
well. Autokey assumes NTP clients poll servers at a relatively low well. Autokey assumes NTP clients poll servers at a relatively low
skipping to change at page 23, line 35 skipping to change at page 24, line 35
/ Signature \ / Signature \
\ / \ /
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
\ / \ /
/ Padding (if needed) \ / Padding (if needed) \
\ / \ /
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Figure 7: NTPv4 Extension Field Format Figure 7: NTPv4 Extension Field Format
The Value and Signature fields are zero-padded to a 4-octet boundary. While each extension field is zero-padded to a 4-octet (word)
The Length field covers the entire extension field including the boundary, the entire extension is not word-aligned. The Length field
padding fields. While the minimum field length is 8 octets, a covers the entire extension field, including the Length and Padding
maximum field length remains to be established. fields. While the minimum field length is 8 octets, a maximum field
length remains to be established. The reference implementation
discards any packet with a field length more than 1024 octets.
One or more extension fields follow the NTP packet header and the One or more extension fields follow the NTP packet header and the
last followed by the MAC. The extension field parser initializes a last followed by the MAC. The extension field parser initializes a
pointer to the first octet beyond the NTP packet header and pointer to the first octet beyond the NTP packet header and
calculates the number of octets remaining to the end of the packet. calculates the number of octets remaining to the end of the packet.
If this value is 20 (128-bit digest plus 4-octet key ID) or 22 (160- If the remaining length is 20 (128-bit digest plus 4-octet key ID) or
bit digest plus 4-octet key ID), the remaining data are the MAC and 22 (160-bit digest plus 4-octet key ID), the remaining data are the
parsing is complete. If greater than 22 an extension field is MAC and parsing is complete. If the remaining length is greater than
present. If the length is less than 8 or not a multiple of 4, a 22 an extension field is present. If the remaining length is less
format error has occurred and the packet is discarded; otherwise, the than 8 or not a multiple of 4, a format error has occurred and the
parser increments the pointer by the extension field length and then packet is discarded; otherwise, the parser increments the pointer by
uses the same rules as above to determine whether a MAC is present or the extension field length and then uses the same rules as above to
another extension field. determine whether a MAC is present or another extension field.
In Autokey the 8-bit Field Type field is interpreted as the version In Autokey the 8-bit Field Type field is interpreted as the version
number, currently 2. For future versions values 1-7 have been number, currently 2. For future versions values 1-7 have been
reserved for Autokey; other values may be assigned for other reserved for Autokey; other values may be assigned for other
applications. The 6-bit Code field specifies the request or response applications. The 6-bit Code field specifies the request or response
operation. There are two flag bits: bit 0 is the Response Flag (R) operation. There are two flag bits: bit 0 is the Response Flag (R)
and bit 1 is the Error Flag (E); the Reserved field is unused and and bit 1 is the Error Flag (E); the Reserved field is unused and
should be set to 0. The remaining fields will be described later. should be set to 0. The remaining fields will be described later.
In the most common protocol operations, a client sends a request to a In the most common protocol operations, a client sends a request to a
skipping to change at page 24, line 30 skipping to change at page 25, line 31
Association ID field to the client association ID which the servert Association ID field to the client association ID which the servert
returns for verification. If the two values do not match, the returns for verification. If the two values do not match, the
response is discarded as if never sent. If the R bit is lit, the response is discarded as if never sent. If the R bit is lit, the
Association ID field is set the the server association ID obtained in Association ID field is set the the server association ID obtained in
the initial protocol exchange. If the Association ID field does not the initial protocol exchange. If the Association ID field does not
match any mobilized association ID, the request is discarded as if match any mobilized association ID, the request is discarded as if
never sent. never sent.
In some cases not all fields may be present. For requests, until a In some cases not all fields may be present. For requests, until a
client has synchronized to a proventic source, signatures are not client has synchronized to a proventic source, signatures are not
valid. In such cases the Timestamp and Signature Length fields are valid. In such cases the Timestamp field and Signature Length field
zero and the Signature field is absent. Some request and error (which specifies the length of the Signature) are zero and the
response messages carry no value or signature fields, so in these Signature field is absent. Some request and error response messages
messages only the first two words (8 octests) are present. carry no value or signature fields, so in these messages only the
first two words (8 octests) are present.
The Timestamp and Filestamp words carry the seconds field of an NTP The Timestamp and Filestamp words carry the seconds field of an NTP
timestamp. The timestamp establishes the signature epoch of the data timestamp. The timestamp establishes the signature epoch of the data
field in the message, while the filestamp establishes the generation field in the message, while the filestamp establishes the generation
epoch of the file that ultimately produced the data that is signed. epoch of the file that ultimately produced the data that is signed.
A signature and timestamp are valid only when the signing host is A signature and timestamp are valid only when the signing host is
synchronized to a proventic source; otherwise, the timestamp is zero. synchronized to a proventic source; otherwise, the timestamp is zero.
A cryptographic data file can only be generated if a signature is A cryptographic data file can only be generated if a signature is
possible; otherwise, the filestamp is zero, except in the ASSOC possible; otherwise, the filestamp is zero, except in the ASSOC
response message, where it contains the server status word. response message, where it contains the server status word.
As in all other TCP/IP protocol designs, all data are sent in network As in all other TCP/IP protocol designs, all data are sent in network
byte order. Unless specified otherwise in the descriptions to byte order. Unless specified otherwise in the descriptions to
follow, the data referred to are stored in the Value field. follow, the data referred to are stored in the Value field. The
Value Length field specifies the length of the data in the Value
field.
11. No-Operation 10.1. No-Operation
A No-operation request (Code 0) does nothing except return an empty A No-operation request (Code 0) does nothing except return an empty
response which can be used as a crypto-ping. response which can be used as a crypto-ping.
12. Association Message (ASSOC) 10.2. Association Message (ASSOC)
An Association Message (Code 1) is used in the parameter exchange to An Association Message (Code 1) is used in the parameter exchange to
obtain the host name and status word. The request contains the obtain the host name and status word. The request contains the
client status word in the Filestamp field and the Autokey host name client status word in the Filestamp field and the Autokey host name
in the Value field. The response contains the server status word in in the Value field. The response contains the server status word in
the Filestamp field and the Autokey host name in the Value field. the Filestamp field and the Autokey host name in the Value field.
The Autokey host name is not necessarily the DNS host name. A valid The Autokey host name is not necessarily the DNS host name. A valid
response lights the ENAB bit and possibly others in the association response lights the ENAB bit and possibly others in the association
status word. status word.
When multiple identity schemes are supported, the host status word When multiple identity schemes are supported, the host status word
determine which ones are available. In server and symmetric modes determine which ones are available. In server and symmetric modes
the response status word contains bits corresponding to the supported the response status word contains bits corresponding to the supported
schemes. In all modes the scheme is selected based on the client schemes. In all modes the scheme is selected based on the client
identity parameters which are loaded at startup. identity parameters which are loaded at startup.
13. Certificate Message (CERT) 10.3. Certificate Message (CERT)
A Certificate Message (Code 2) is used in the certificate exchange to A Certificate Message (Code 2) is used in the certificate exchange to
obtain a certificate by subject name. The request contains the obtain a certificate by subject name. The request contains the
subject name; the response contains the certificate encoded in X.509 subject name; the response contains the certificate encoded in X.509
format with ASN.1 syntax as described in Appendix H. format with ASN.1 syntax as described in Appendix H.
If the subject name in the response does not match the issuer name, If the subject name in the response does not match the issuer name,
the exchange continues with the issuer name replacing the subject the exchange continues with the issuer name replacing the subject
name in the request. The exchange continues until a trusted, self- name in the request. The exchange continues until a trusted, self-
signed certificate is found and lights the CERT bit in the signed certificate is found and lights the CERT bit in the
association status word. association status word.
14. Cookie Message (COOKIE) 10.4. Cookie Message (COOKIE)
The Cookie Message (Code 3) is used in server and symmetric modes to The Cookie Message (Code 3) is used in server and symmetric modes to
obtain the server cookie. The request contains the host public key obtain the server cookie. The request contains the host public key
encoded with ASN.1 syntax as described in Appendix H. The response encoded with ASN.1 syntax as described in Appendix H. The response
contains the cookie encrypted by the public key in the request. A contains the cookie encrypted by the public key in the request. A
valid response lights the COOKIE bit in the association status word. valid response lights the COOKIE bit in the association status word.
15. Autokey Message (AUTO) 10.5. Autokey Message (AUTO)
The Autokey Message (Code 4) is used to obtain the autokey values. The Autokey Message (Code 4) is used to obtain the autokey values.
The request contains no value for a client or the autokey values for The request contains no value for a client or the autokey values for
a symmetric peer. The response contains two 32-bit words, the first a symmetric peer. The response contains two 32-bit words, the first
is the final key ID, while the second is the index of the final key is the final key ID, while the second is the index of the final key
ID. A valid response lights the AUTO bit in the association status ID. A valid response lights the AUTO bit in the association status
word. word.
16. Leapseconds Values Message (LEAP) 10.6. Leapseconds Values Message (LEAP)
The Leapseconds Values Message (Cpde 5) is used to obtain the The Leapseconds Values Message (Cpde 5) is used to obtain the
leapseconds values as parsed from the leapseconds table from NIST. leapseconds values as parsed from the leapseconds table from NIST.
The request contains no values. The response contains three 32-bit The request contains no values. The response contains three 32-bit
integers: first the NTP seconds of the latest leap event followed by integers: first the NTP seconds of the latest leap event followed by
the NTP seconds when the latest NIST table expires and then the TAI the NTP seconds when the latest NIST table expires and then the TAI
offset following the leap event. A valid response lights the LEAP offset following the leap event. A valid response lights the LEAP
bit in the association status word. bit in the association status word.
17. Sign Message (SIGN) 10.7. Sign Message (SIGN)
The Sign Message (Code 6) requests the server to sign and return a The Sign Message (Code 6) requests the server to sign and return a
certificate presented in the request. The request contains the certificate presented in the request. The request contains the
client certificate encoded in X.509 format with ASN.1 syntax as client certificate encoded in X.509 format with ASN.1 syntax as
described in Appendix H. The response contains the client described in Appendix H. The response contains the client
certificate signed by the server private key. A valid response certificate signed by the server private key. A valid response
lights the SIGN bit in the association status word. lights the SIGN bit in the association status word.
18. Identity Messages (IFF, GQ, MV) 10.8. Identity Messages (IFF, GQ, MV)
The Identity Messages (Code 7 (IFF), 8 (GQ), or 9 (MV)) contains the The Identity Messages (Code 7 (IFF), 8 (GQ), or 9 (MV)) contains the
client challenge, usually a 160- or 512-bit nonce. The response client challenge, usually a 160- or 512-bit nonce. The response
contains the result of the mathematical operation defined in contains the result of the mathematical operation defined in
Appendix B. The Response is encoded in ASN.1 syntax as described in Appendix B. The Response is encoded in ASN.1 syntax as described in
Appendix H. A valid response lights the VRFY bit in the association Appendix H. A valid response lights the VRFY bit in the association
status word. status word.
19. Autokey State Machine 11. Autokey State Machine
This section describes the formal model of the Autokey state machine, This section describes the formal model of the Autokey state machine,
its state variables and the state transition functions. its state variables and the state transition functions.
20. Status Word 11.1. Status Word
The server implements a host status word, while each client The server implements a host status word, while each client
implements an association status word. These words have the format implements an association status word. These words have the format
and content shown in Figure 8. The low order 16 bits of the status and content shown in Figure 8. The low order 16 bits of the status
word define the state of the Autokey dance, while the high order 16 word define the state of the Autokey dance, while the high order 16
bits specify the OID for one of the message digest/signature bits specify the Numerical Identifier (NID) as generated by the
encryption schemes defined in [RFC3279]. Bits 24-31 are reserved for OpenSSL library of the OID for one of the message digest/signature
server use, while bits 16-23 are reserved for client use. In the encryption schemes defined in [RFC3279]. The NID values for the
host portion bits 24-27 specify the available identity schemes, while digest/signature algorithms defined in RFC 3279 are as follows:
bits 28-31 specify the server capabilities. There are two additional
bits implemented separately. +------------------------+----------------------+-----+
| Algorithm | OID | NID |
+------------------------+----------------------+-----+
| pkcs-1 | 1.2.840.113549.1.1 | 2 |
| md2 | 1.2.840.113549.2.2 | 3 |
| md5 | 1.2.840.113549.2.5 | 4 |
| rsaEncryption | 1.2.840.113549.1.1.1 | 6 |
| md2WithRSAEncryption | 1.2.840.113549.1.1.2 | 7 |
| md5WithRSAEncryption | 1.2.840.113549.1.1.4 | 8 |
| id-sha1 | 1.3.14.3.2.26 | 64 |
| sha-1WithRSAEncryption | 1.2.840.113549.1.1.5 | 65 |
| id-dsa-wth-sha1 | 1.2.840.10040.4.3 | 113 |
| id-dsa | 1.2.840.10040.4.1 | 116 |
+------------------------+----------------------+-----+
Bits 24-31 are reserved for server use, while bits 16-23 are reserved
for client use. In the host portion bits 24-27 specify the available
identity schemes, while bits 28-31 specify the server capabilities.
There are two additional bits implemented separately.
1 2 3 1 2 3
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 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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Digest / Signature NID | Client | Ident | Host | | Digest / Signature NID | Client | Ident | Host |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Figure 8: Status Word Figure 8: Status Word
The host status word is included in the ASSOC request and response The host status word is included in the ASSOC request and response
skipping to change at page 27, line 36 skipping to change at page 28, line 49
The host status bits are defined as follows: The host status bits are defined as follows:
o ENAB (31) Lit if the server implements the Autokey protocol. o ENAB (31) Lit if the server implements the Autokey protocol.
o LVAL (30) Lit if the server has installed leapseconds values, o LVAL (30) Lit if the server has installed leapseconds values,
either from the NIST leapseconds file or from another server. either from the NIST leapseconds file or from another server.
o Bits (28-29) are reserved - always dark. o Bits (28-29) are reserved - always dark.
o Bits 24-27 select which server identity schemes are available. o Bits 24-27 select which server identity schemes are available.
While specific coding for various schemes is yet to be determined While specific coding for various schemes is yet to be determined,
by profile, the schemes described in Appendix B include the the schemes available in the reference implementation and
following: described in Appendix B include the following:
* none - Trusted Certificate (TC) Scheme (default). * none - Trusted Certificate (TC) Scheme (default).
* PC (27) Private Certificate Scheme. * PC (27) Private Certificate Scheme.
* IFF (26) Schnorr aka Identify-Friendly-or-Foe Scheme. * IFF (26) Schnorr aka Identify-Friendly-or-Foe Scheme.
* GQ (25) Guillard-Quisquater Scheme. * GQ (25) Guillard-Quisquater Scheme.
* MV (24) Mu-Varadharajan Scheme. * MV (24) Mu-Varadharajan Scheme.
skipping to change at page 28, line 44 skipping to change at page 30, line 5
o Bit 16 is reserved - always dark. o Bit 16 is reserved - always dark.
There are three additional bits: LIST, SYNC and PEER not included in There are three additional bits: LIST, SYNC and PEER not included in
the association status word. LIST is lit when the key list is the association status word. LIST is lit when the key list is
regenerated and dim when the autokey values have been transmitted. regenerated and dim when the autokey values have been transmitted.
This is necessary to avoid livelock under some conditions. SYNC is This is necessary to avoid livelock under some conditions. SYNC is
lit when the client has synchronized to a proventic source and never lit when the client has synchronized to a proventic source and never
dim after that. PEER is lit when the server has synchronized, as dim after that. PEER is lit when the server has synchronized, as
indicated in the NTP header, and never dim after that. indicated in the NTP header, and never dim after that.
21. Host State Variables 11.2. Host State Variables
Following is a list of host state variables. Following is a list of host state variables.
Host Name - The name of the host, by default the string returned by Host Name - The name of the host, by default the string returned by
the Unix gethostname() library function. the Unix gethostname() library function. In the reference
implementation this is a configurable value.
Host Status Word - This word is initialized when the host first Host Status Word - This word is initialized when the host first
starts up. The format is described above. starts up. The format is described above.
Host Key - The RSA public/private key pair used to encrypt/decrypt Host Key - The RSA public/private key pair used to encrypt/decrypt
cookies. This is also the default sign key. cookies. This is also the default sign key.
Sign Key - The RSA or DSA public/private key pair used to encrypt/ Sign Key - The RSA or DSA public/private key pair used to encrypt/
decrypt signatures when the host key is not used for this purpose. decrypt signatures when the host key is not used for this purpose.
skipping to change at page 30, line 41 skipping to change at page 32, line 5
Host Name Values. This is used to send ASSOC request and response Host Name Values. This is used to send ASSOC request and response
messages. It contains the host status word and host name. messages. It contains the host status word and host name.
Public Key Values - This is used to send the COOKIE request message. Public Key Values - This is used to send the COOKIE request message.
It contains the public encryption key used for the COOKIE response It contains the public encryption key used for the COOKIE response
message. message.
Leapseconds Values. This is used to send the LEAP response message. Leapseconds Values. This is used to send the LEAP response message.
In contains the leapseconds values in the LEAP message description. In contains the leapseconds values in the LEAP message description.
22. Client State Variables (all modes) 11.3. Client State Variables (all modes)
Following is a list of state variables used by the various dances in Following is a list of state variables used by the various dances in
all modes. all modes.
Association ID - The association ID used in responses. It is Association ID - The association ID used in responses. It is
assigned when the association is mobilized. assigned when the association is mobilized.
Association Status Word - The status word copied from the ASSOC Association Status Word - The status word copied from the ASSOC
response; subsequently modified by the state machine. response; subsequently modified by the state machine.
skipping to change at page 31, line 37 skipping to change at page 32, line 48
Send Autokey Values - The autokey values with signature and Send Autokey Values - The autokey values with signature and
timestamps. timestamps.
Key List - A sequence of key IDs starting with the autokey seed and Key List - A sequence of key IDs starting with the autokey seed and
each pointing to the next. It is computed, timestamped and signed at each pointing to the next. It is computed, timestamped and signed at
the next poll opportunity when the key list becomes empty. the next poll opportunity when the key list becomes empty.
Current Key Number - The index of the entry on the Key List to be Current Key Number - The index of the entry on the Key List to be
used at the next poll opportunity. used at the next poll opportunity.
23. Protocol State Transitions 11.4. Protocol State Transitions
The protocol state machine is very simple but robust. The state is The protocol state machine is very simple but robust. The state is
determined by the client status word bits defined above. The state determined by the client status word bits defined above. The state
transitions of the three dances are shown below. The capitalized transitions of the three dances are shown below. The capitalized
truth values represent the client status bits. All bits are truth values represent the client status bits. All bits are
initialized dark and are lit upon the arrival of a specific response initialized dark and are lit upon the arrival of a specific response
message as detailed above. message as detailed above.
24. Server Dance 11.4.1. Server Dance
The server dance begins when the client sends an ASSOC request to the The server dance begins when the client sends an ASSOC request to the
server. The clock is updated when PREV is lit and the dance ends server. The clock is updated when PREV is lit and the dance ends
when LEAP is lit. In this dance the autokey values are not used, so when LEAP is lit. In this dance the autokey values are not used, so
an autokey exchange is not necessary. Note that the SIGN and LEAP an autokey exchange is not necessary. Note that the SIGN and LEAP
requests are not issued until the client has synchronized to a requests are not issued until the client has synchronized to a
proventic source. Subsequent packets without extension fields are proventic source. Subsequent packets without extension fields are
validated by the autokey sequence. This example and others assumes validated by the autokey sequence. This example and others assumes
the IFF identity scheme has been selected in the parameter exchange.. the IFF identity scheme has been selected in the parameter exchange..
1 while (1) { 1 while (1) {
2 wait_for_next_poll; 2 wait_for_next_poll;
3 make_NTP_header; 3 make_NTP_header;
4 if (response_ready) 4 if (response_ready)
5 send_response; 5 send_response;
6 if (!ENB) /* parameter exchange */ 6 if (!ENB) /* parameter exchange */
7 ASSOC_request; 7 ASSOC_request;
8 else if (!CERT) /* certificate exchange */ 8 else if (!CERT) /* certificate exchange */
9 CERT_request(Host_Name); 9 CERT_request(Host_Name);
10 else if (!IFF) /* identity exchange */ 10 else if (!IFF) /* identity exchange */
11 IFF_challenge; 11 IFF_challenge;
12 else if (!COOK) /* cookie exchange */ 12 else if (!COOK) /* cookie exchange */
13 COOKIE_request; 13 COOKIE_request;
14 else if (!SYNC) /* wait for synchronization */ 14 else if (!SYNC) /* wait for synchronization */
15 continue; 15 continue;
16 else if (!SIGN) /* sign exchange */ 16 else if (!SIGN) /* sign exchange */
17 SIGN_request(Host_Certificate); 17 SIGN_request(Host_Certificate);
18 else if (!LEAP) /* leapsecond values exchange */ 18 else if (!LEAP) /* leapsecond values exchange */
19 LEAP_request; 19 LEAP_request;
20 send packet; 20 send packet;
21 } 21 }
Figure 9: Server Dance Figure 9: Server Dance
If the server refreshes the private seed, the cookie becomes invalid. If the server refreshes the private seed, the cookie becomes invalid.
The server responds to an invalid cookie with a crypto_NAK message, The server responds to an invalid cookie with a crypto_NAK message,
which causes the client to restart the protocol from the beginning. which causes the client to restart the protocol from the beginning.
25. Broadcast Dance 11.4.2. Broadcast Dance
The broadcast dance is similar to the server dance with the cookie The broadcast dance is similar to the server dance with the cookie
exchange replaced by the autokey values exchange. The broadcast exchange replaced by the autokey values exchange. The broadcast
dance begins when the client receives a broadcast packet including an dance begins when the client receives a broadcast packet including an
ASSOC response with the server association ID. This mobilizes a ASSOC response with the server association ID. This mobilizes a
client association in order to proventicate the source and calibrate client association in order to proventicate the source and calibrate
the propagation delay. The dance ends when the LEAP bit is lit, the propagation delay. The dance ends when the LEAP bit is lit,
after which the client sends no further packets. Normally, the after which the client sends no further packets. Normally, the
broadcast server includes an ASSOC response in each transmitted broadcast server includes an ASSOC response in each transmitted
packet. However, when the server generates a new key list, it packet. However, when the server generates a new key list, it
skipping to change at page 33, line 18 skipping to change at page 34, line 26
dance ends when LEAP is lit. Note that the SIGN and LEAP requests dance ends when LEAP is lit. Note that the SIGN and LEAP requests
are not issued until the client has synchronized to a proventic are not issued until the client has synchronized to a proventic
source. Subsequent packets without extension fields are validated by source. Subsequent packets without extension fields are validated by
the autokey sequence. the autokey sequence.
1 while (1) { 1 while (1) {
2 wait_for_next_poll; 2 wait_for_next_poll;
3 make_NTP_header; 3 make_NTP_header;
4 if (response_ready) 4 if (response_ready)
5 send_response; 5 send_response;
6 if (!ENB) /* parameters exchange */ 6 if (!ENB) /* parameters exchange */
7 ASSOC_request; 7 ASSOC_request;
8 else if (!CERT) /* certificate exchange */ 8 else if (!CERT) /* certificate exchange */
9 CERT_request(Host_Name); 9 CERT_request(Host_Name);
10 else if (!IFF) /* identity exchange */ 10 else if (!IFF) /* identity exchange */
11 IFF_challenge; 11 IFF_challenge;
12 else if (!AUT) /* autokey values exchange */ 12 else if (!AUT) /* autokey values exchange */
13 AUTO_request; 13 AUTO_request;
14 else if (!SYNC) /* wait for synchronization */ 14 else if (!SYNC) /* wait for synchronization */
15 continue; 15 continue;
16 else if (!SIGN) /* sign exchange */ 16 else if (!SIGN) /* sign exchange */
17 SIGN_request(Host_Certificate); 17 SIGN_request(Host_Certificate);
18 else if (!LEAP) /* leapsecond values exchange */ 18 else if (!LEAP) /* leapsecond values exchange */
19 LEAP_request; 19 LEAP_request;
20 send NTP_packet; 20 send NTP_packet;
21 } 21 }
Figure 10: Server Dance Figure 10: Broadcast Dance
If a packet is lost and the autokey sequence is broken, the client If a packet is lost and the autokey sequence is broken, the client
hashes the current autokey until either it matches the previous hashes the current autokey until either it matches the previous
autokey or the number of hashes exceeds the count given in the autokey or the number of hashes exceeds the count given in the
autokey values. If the latter, the client sends an AUTO request to autokey values. If the latter, the client sends an AUTO request to
retrieve the autokey values. If the client receives a crypto-NAK retrieve the autokey values. If the client receives a crypto-NAK
during the dance, or if the association ID changes, the client during the dance, or if the association ID changes, the client
restarts the protocol from the beginning. restarts the protocol from the beginning.
26. Symmetric Dance 11.4.3. Symmetric Dance
The symmetric dance is intricately choreographed. It begins when the The symmetric dance is intricately choreographed. It begins when the
active peer sends an ASSOC request to the passive peer. The passive active peer sends an ASSOC request to the passive peer. The passive
peer mobilizes an association and both peers step a three-way dance peer mobilizes an association and both peers step a three-way dance
where each peer completes a parameter exchange with the other. Until where each peer completes a parameter exchange with the other. Until
one of the peers has synchronized to a proventic source (which could one of the peers has synchronized to a proventic source (which could
be the other peer) and can sign messages, the other peer loops be the other peer) and can sign messages, the other peer loops
waiting for a valid timestamp in the ensuing CERT response. waiting for a valid timestamp in the ensuing CERT response.
1 while (1) { 1 while (1) {
2 wait_for_next_poll; 2 wait_for_next_poll;
3 make_NTP_header; 3 make_NTP_header;
4 if (!ENB) /* parameters exchange */ 4 if (!ENB) /* parameters exchange */
5 ASSOC_request; 5 ASSOC_request;
6 else if (!CERT) /* certificate exchange */ 6 else if (!CERT) /* certificate exchange */
7 CERT_request(Host_Name); 7 CERT_request(Host_Name);
8 else if (!IFF) /* identity exchange */ 8 else if (!IFF) /* identity exchange */
9 IFF_challenge; 9 IFF_challenge;
10 else if (!COOK && PEER) /* cookie exchange */ 10 else if (!COOK && PEER) /* cookie exchange */
11 COOKIE_request); 11 COOKIE_request);
12 else if (!AUTO) /* autokey values exchange */ 12 else if (!AUTO) /* autokey values exchange */
13 AUTO_request; 13 AUTO_request;
14 else if (LIST) /* autokey values response */ 14 else if (LIST) /* autokey values response */
15 AUTO_response; 15 AUTO_response;
16 else if (!SYNC) /* wait for synchronization */ 16 else if (!SYNC) /* wait for synchronization */
17 continue; 17 continue;
18 else if (!SIGN) /* sign exchange */ 18 else if (!SIGN) /* sign exchange */
19 SIGN_request; 19 SIGN_request;
20 else if (!LEAP) /* leapsecond values exchange */ 20 else if (!LEAP) /* leapsecond values exchange */
21 LEAP_request; 21 LEAP_request;
22 send NTP_packet; 22 send NTP_packet;
23 } 23 }
Figure 11: Symmetric Dance Figure 11: Symmetric Dance
Once a peer has synchronized to a proventic source, it includes Once a peer has synchronized to a proventic source, it includes
timestamped signatures in its messages. The other peer, which has timestamped signatures in its messages. The other peer, which has
been stalled waiting for valid timestamps, now mates the dance. It been stalled waiting for valid timestamps, now mates the dance. It
retrives the now nonzero cookie using a cookie exchange and then the retrives the now nonzero cookie using a cookie exchange and then the
updated autokey values using an autokey exchange. updated autokey values using an autokey exchange.
As in the broadcast dance, if a packet is lost and the autokey As in the broadcast dance, if a packet is lost and the autokey
sequence broken, the peer hashes the current autokey until either it sequence broken, the peer hashes the current autokey until either it
matches the previous autokey or the number of hashes exceeds the matches the previous autokey or the number of hashes exceeds the
count given in the autokey values. If the latter, the client sends count given in the autokey values. If the latter, the client sends
an AUTO request to retrive the autokey values. If the peer receives an AUTO request to retrive the autokey values. If the peer receives
a crypto-NAK during the dance, or if the association ID changes, the a crypto-NAK during the dance, or if the association ID changes, the
peer restarts the protocol from the beginning. peer restarts the protocol from the beginning.
27. Error Recovery 11.5. Error Recovery
The Autokey protocol state machine includes provisions for various The Autokey protocol state machine includes provisions for various
kinds of error conditions that can arise due to missing files, kinds of error conditions that can arise due to missing files,
corrupted data, protocol violations and packet loss or misorder, not corrupted data, protocol violations and packet loss or misorder, not
to mention hostile intrusion. This section describes how the to mention hostile intrusion. This section describes how the
protocol responds to reachability and timeout events which can occur protocol responds to reachability and timeout events which can occur
due to such errors. due to such errors.
A persistent NTP association is mobilized by an entry in the A persistent NTP association is mobilized by an entry in the
configuration file, while an ephemeral association is mobilized upon configuration file, while an ephemeral association is mobilized upon
skipping to change at page 36, line 4 skipping to change at page 37, line 10
There are special cases designed to quickly respond to broken There are special cases designed to quickly respond to broken
associations, such as when a server restarts or refreshes keys. associations, such as when a server restarts or refreshes keys.
Since the client cookie is invalidated, the server rejects the next Since the client cookie is invalidated, the server rejects the next
client request and returns a crypto-NAK packet. Since the crypto-NAK client request and returns a crypto-NAK packet. Since the crypto-NAK
has no MAC, the problem for the client is to determine whether it is has no MAC, the problem for the client is to determine whether it is
legitimate or the result of intruder mischief. In order to reduce legitimate or the result of intruder mischief. In order to reduce
the vulnerability in such cases, the crypto-NAK, as well as all the vulnerability in such cases, the crypto-NAK, as well as all
responses, is believed only if the result of a previous packet sent responses, is believed only if the result of a previous packet sent
by the client and not a replay, as confirmed by the NTP on-wire by the client and not a replay, as confirmed by the NTP on-wire
protocol. While this defense can be easily circumvented by a protocol. While this defense can be easily circumvented by a man-in-
middleman, it does deflect other kinds of intruder warfare. the-middle, it does deflect other kinds of intruder warfare.
There are a number of situations where some event happens that causes There are a number of situations where some event happens that causes
the remaining autokeys on the key list to become invalid. When one the remaining autokeys on the key list to become invalid. When one
of these situations happens, the key list and associated autokeys in of these situations happens, the key list and associated autokeys in
the key cache are purged. A new key list, signature and timestamp the key cache are purged. A new key list, signature and timestamp
are generated when the next NTP message is sent, assuming there is are generated when the next NTP message is sent, assuming there is
one. Following is a list of these situations: one. Following is a list of these situations:
1. When the cookie value changes for any reason. 1. When the cookie value changes for any reason.
2. When the poll interval is changed. In this case the calculated 2. When the poll interval is changed. In this case the calculated
expiration times for the keys become invalid. expiration times for the keys become invalid.
3. If a problem is detected when an entry is fetched from the key 3. If a problem is detected when an entry is fetched from the key
list. This could happen if the key was marked non-trusted or list. This could happen if the key was marked non-trusted or
timed out, either of which implies a software bug. timed out, either of which implies a software bug.
28. Security Considerations 12. Security Considerations
This section discusses the most obvious security vulnerabilities in This section discusses the most obvious security vulnerabilities in
the various Autokey dances. In the following discussion the the various Autokey dances. In the following discussion the
cryptographic algorithms and private values themselves are assumed cryptographic algorithms and private values themselves are assumed
secure; that is, a brute force cryptanalytic attack will not reveal secure; that is, a brute force cryptanalytic attack will not reveal
the host private key, sign private key, cookie value, identity the host private key, sign private key, cookie value, identity
parameters, server seed or autokey seed. In addition, an intruder parameters, server seed or autokey seed. In addition, an intruder
will not be able to predict random generator values. will not be able to predict random generator values.
29. Protocol Vulnerability 12.1. Protocol Vulnerability
While the protocol has not been subjected to a formal analysis, a few While the protocol has not been subjected to a formal analysis, a few
preliminary assertions can be made. In the client/server and preliminary assertions can be made. In the client/server and
symmetric dances the underlying NTP on-wire protocol is resistant to symmetric dances the underlying NTP on-wire protocol is resistant to
lost, duplicate and bogus packets, even if the clock is not lost, duplicate and bogus packets, even if the clock is not
synchronized, so the protocol is not vulnerable to a wiretapper synchronized, so the protocol is not vulnerable to a wiretapper
attack. The on-wire protocol is resistant to replays of both the attack. The on-wire protocol is resistant to replays of both the
client request packet and the server reply packet. A middleman client request packet and the server reply packet. A man-in-the-
attack, even if it could simulate a valid cookie, could not prove middle attack, even if it could simulate a valid cookie, could not
identity. prove identity.
In the broadcast dance the client begins with a volley in client/ In the broadcast dance the client begins with a volley in client/
server mode to obtain the autokey values and signature, so has the server mode to obtain the autokey values and signature, so has the
same protection as in that mode. When continuing in receive-only same protection as in that mode. When continuing in receive-only
mode, a wiretapper cannot produce a key list with valid signed mode, a wiretapper cannot produce a key list with valid signed
autokey values. If it replays an old packet, the client will reject autokey values. If it replays an old packet, the client will reject
it by the timestamp check. The most it can do is manufacture a it by the timestamp check. The most it can do is manufacture a
future packet causing clients to repeat the autokey hash operations future packet causing clients to repeat the autokey hash operations
until exceeding the maximum key number. If this happens the until exceeding the maximum key number. If this happens the
broadcast client temporarily reverts to client mode to refresh the broadcast client temporarily reverts to client mode to refresh the
autokey values. autokey values.
By assumption, a middleman attacker that intercepts a packet cannot By assumption, a man-in-the-middle attacker that intercepts a packet
break the wire or delay an intercepted packet. If this assumption is cannot break the wire or delay an intercepted packet. If this
removed, the middleman could intercept a broadcast packet and replace assumption is removed, the middleman could intercept a broadcast
the data and message digest without detection by the clients. packet and replace the data and message digest without detection by
the clients.
As mentioned previously in this memo, the TC identity scheme is As mentioned previously in this memo, the TC identity scheme is
vulnerable to a middleman attack where an intruder could create a vulnerable to a man-in-the-middle attack where an intruder could
bogus certificate trail. To foil this kind of attack, either the PC, create a bogus certificate trail. To foil this kind of attack,
IFF, GQ or MV identity schemes must be used. either the PC, IFF, GQ or MV identity schemes must be used.
A client instantiates cryptographic variables only if the server is A client instantiates cryptographic variables only if the server is
synchronized to a proventic source. A server does not sign values or synchronized to a proventic source. A server does not sign values or
generate cryptographic data files unless synchronized to a proventic generate cryptographic data files unless synchronized to a proventic
source. This raises an interesting issue: how does a client generate source. This raises an interesting issue: how does a client generate
proventic cryptographic files before it has ever been synchronized to proventic cryptographic files before it has ever been synchronized to
a proventic source? [Who shaves the barber if the barber shaves a proventic source? [Who shaves the barber if the barber shaves
everybody in town who does not shave himself?] In principle, this everybody in town who does not shave himself?] In principle, this
paradox is resolved by assuming the primary (stratum 1) servers are paradox is resolved by assuming the primary (stratum 1) servers are
proventicated by external phenomenological means. proventicated by external phenomenological means.
30. Clogging Vulnerability 12.2. Clogging Vulnerability
A self-induced clogging incident cannot happen, since signatures are A self-induced clogging incident cannot happen, since signatures are
computed only when the data have changed and the data do not change computed only when the data have changed and the data do not change
very often. For instance, the autokey values are signed only when very often. For instance, the autokey values are signed only when
the key list is regenerated, which happens about once an hour, while the key list is regenerated, which happens about once an hour, while
the public values are signed only when one of them is updated during the public values are signed only when one of them is updated during
a dance or the server seed is refreshed, which happens about once per a dance or the server seed is refreshed, which happens about once per
day. day.
There are two clogging vulnerabilities exposed in the protocol There are two clogging vulnerabilities exposed in the protocol
skipping to change at page 38, line 11 skipping to change at page 39, line 16
In client/server and peer dances an encryption hazard exists when a In client/server and peer dances an encryption hazard exists when a
wiretapper replays prior cookie request messages at speed. There is wiretapper replays prior cookie request messages at speed. There is
no obvious way to deflect such attacks, as the server retains no no obvious way to deflect such attacks, as the server retains no
state between requests. Replays of cookie request or response state between requests. Replays of cookie request or response
messages are detected and discarded by the client on-wire protocol. messages are detected and discarded by the client on-wire protocol.
In broadcast mode a client a decryption hazard exists when a In broadcast mode a client a decryption hazard exists when a
wiretapper replays autokey response messages at speed. Once wiretapper replays autokey response messages at speed. Once
synchronized to a proventic source, a legitimate extension field with synchronized to a proventic source, a legitimate extension field with
timestamp the same as or earlier than the most recently received of timestamp the same as or earlier than the most recently received of
that type is immediately discarded. This foils a middleman cut-and- that type is immediately discarded. This foils a man-in-the-middle
paste attack using an earlier response, for example. A legitimate cut-and-paste attack using an earlier response, for example. A
extension field with timestamp in the future is unlikely, as that legitimate extension field with timestamp in the future is unlikely,
would require predicting the autokey sequence. However, this causes as that would require predicting the autokey sequence. However, this
the client to refresh and verify the autokey values and signature. causes the client to refresh and verify the autokey values and
signature.
A determined attacker can destabilize the on-wire protocol or an A determined attacker can destabilize the on-wire protocol or an
Autokey dance in various ways by replaying old messages before the Autokey dance in various ways by replaying old messages before the
client or peer has synchronized for the first time. For instance, client or peer has synchronized for the first time. For instance,
replaying an old symmetric mode message before the peers have replaying an old symmetric mode message before the peers have
synchronize will prevent the peers from ever synchronizing. synchronize will prevent the peers from ever synchronizing.
Replaying out of order Autokey messages in any mode during a dance Replaying out of order Autokey messages in any mode during a dance
could prevent the dance from ever completing. There is nothing new could prevent the dance from ever completing. There is nothing new
in these kinds of attack; a similar vulnerabily even exists in TCP. in these kinds of attack; a similar vulnerabily even exists in TCP.
31. IANA Considerations 13. IANA Considerations
This document has no IANA Actions. This document has no IANA Actions.
32. References 14. References
32.1. Normative References 14.1. Normative References
[I-D.ietf-ntp-ntpv4-proto] [I-D.ietf-ntp-ntpv4-proto]
Burbank, J., "Network Time Protocol Version 4 Protocol And Kasch, W., Mills, D., and J. Burbank, "Network Time
Algorithms Specification", draft-ietf-ntp-ntpv4-proto-11 Protocol Version 4 Protocol And Algorithms Specification",
(work in progress), September 2008. draft-ietf-ntp-ntpv4-proto-13 (work in progress),
October 2009.
32.2. Informative References 14.2. Informative References
[DASBUCH] Mills, D., "Computer Network Time Synchronization - the [DASBUCH] Mills, D., "Computer Network Time Synchronization - the
Network Time Protocol", 2006. Network Time Protocol", 2006.
[GUILLOU] Guillou, L. and J. Quisquatar, "A "paradoxical" identity- [GUILLOU] Guillou, L. and J. Quisquatar, "A "paradoxical" identity-
based signature scheme resulting from zero-knowledge", based signature scheme resulting from zero-knowledge",
1990. 1990.
[MV] Mu, Y. and V. Varadharajan, "Robust and secure [MV] Mu, Y. and V. Varadharajan, "Robust and secure
broadcasting", 2001. broadcasting", 2001.
skipping to change at page 41, line 12 skipping to change at page 42, line 18
not be used to verify signatures if t --> B or E --> t, where t not be used to verify signatures if t --> B or E --> t, where t
is the current proventic time. Note that the public key is the current proventic time. Note that the public key
previously extracted from the certificate continues to be valid previously extracted from the certificate continues to be valid
for an indefinite time. This raises the interesting possibility for an indefinite time. This raises the interesting possibility
where a truechimer server with expired certificate or a where a truechimer server with expired certificate or a
falseticker with valid certificate are not detected until the falseticker with valid certificate are not detected until the
client has synchronized to a proventic source. client has synchronized to a proventic source.
Appendix B. Identity Schemes Appendix B. Identity Schemes
There are five identity schemes to be selected by profile: (1) There are five identity schemes in the NTPv4 reference
private certificate (PC), (2) trusted certificate (TC), (3) a implementation: (1) private certificate (PC), (2) trusted certificate
modified Schnorr algorithm (IFF - Identify Friend or Foe), (4) a (TC), (3) a modified Schnorr algorithm (IFF - Identify Friend or
modified Guillou-Quisquater algorithm (GQ), and (5) a modified Mu- Foe), (4) a modified Guillou-Quisquater algorithm (GQ), and (5) a
Varadharajan algorithm (MV). modified Mu-Varadharajan algorithm (MV).
The PC scheme is intended for testing and development and not The PC scheme is intended for testing and development and not
recommended for general use. The TC scheme uses a certificate trail, recommended for general use. The TC scheme uses a certificate trail,
but not an identity scheme. The IFF, GQ and MV identity schemes use but not an identity scheme. The IFF, GQ and MV identity schemes use
a cryptographically strong challenge-response exchange where an a cryptographically strong challenge-response exchange where an
intruder cannot learn the group key, even after repeated observations intruder cannot learn the group key, even after repeated observations
of multiple exchanges. These schemes begin when the client sends a of multiple exchanges. These schemes begin when the client sends a
nonce to the server, which then rolls its own nonce, performs a nonce to the server, which then rolls its own nonce, performs a
mathematical operation and sends the results to the client. The mathematical operation and sends the results to the client. The
client performs a second mathematical operation to prove the server client performs a second mathematical operation to prove the server
skipping to change at page 49, line 24 skipping to change at page 50, line 24
prime) to Alice. prime) to Alice.
3. Alice computes the session decryption key E^-1 = (g-bar-prime)^x- 3. Alice computes the session decryption key E^-1 = (g-bar-prime)^x-
hat_j (g-hat-prime)^x-bar_j mod p and verifies that r = E^-1 x. hat_j (g-hat-prime)^x-bar_j mod p and verifies that r = E^-1 x.
Appendix H. ASN.1 Encoding Rules Appendix H. ASN.1 Encoding Rules
Certain value fields in request and response messages contain data Certain value fields in request and response messages contain data
encoded in ASN.1 distinguished encoding rules (DER). The BNF grammar encoded in ASN.1 distinguished encoding rules (DER). The BNF grammar
for each encoding rule is given below along with the OpenSSL routine for each encoding rule is given below along with the OpenSSL routine
used for the encoding. The object identifiers for the encryption used for the encoding in the reference implementation. The object
algorithms and message digest/signature encryption schemes are identifiers for the encryption algorithms and message digest/
specified in [RFC3279]. The particular algorithms required for signature encryption schemes are specified in [RFC3279]. The
conformance are not specified in this memo. particular algorithms required for conformance are not specified in
this memo.
Appendix I. COOKIE request, IFF response, GQ response, MV response Appendix I. COOKIE request, IFF response, GQ response, MV response
The value field of the COOKIE request message contains a sequence of The value field of the COOKIE request message contains a sequence of
two integers (n, e) encoded by the i2d_RSAPublicKey() routine in the two integers (n, e) encoded by the i2d_RSAPublicKey() routine in the
OpenSSL distribution. In the request, n is the RSA modulus in bits OpenSSL distribution. In the request, n is the RSA modulus in bits
and e is the public exponent. and e is the public exponent.
RSAPublicKey ::= SEQUENCE { RSAPublicKey ::= SEQUENCE {
n ::= INTEGER, n ::= INTEGER,
skipping to change at page 51, line 16 skipping to change at page 52, line 16
tbsCertificate TBSCertificate, tbsCertificate TBSCertificate,
signatureAlgorithm AlgorithmIdentifier, signatureAlgorithm AlgorithmIdentifier,
signatureValue BIT STRING signatureValue BIT STRING
} }
The signatureAlgorithm is the object identifier of the message The signatureAlgorithm is the object identifier of the message
digest/signature encryption scheme used to sign the certificate. The digest/signature encryption scheme used to sign the certificate. The
signatureValue is computed by the certificate issuer using this signatureValue is computed by the certificate issuer using this
algorithm and the issuer private key. algorithm and the issuer private key.
TBSCertificate ::= SEQUENCE { TBSCertificate ::= SEQUENCE {
version EXPLICIT v3(2), version EXPLICIT v3(2),
serialNumber CertificateSerialNumber, serialNumber CertificateSerialNumber,
signature AlgorithmIdentifier, signature AlgorithmIdentifier,
issuer Name, issuer Name,
validity Validity, validity Validity,
subject Name, subject Name,
subjectPublicKeyInfo SubjectPublicKeyInfo, subjectPublicKeyInfo SubjectPublicKeyInfo,
extensions EXPLICIT Extensions (OPTIONAL) extensions EXPLICIT Extensions OPTIONAL
} }
The serialNumber is an integer guaranteed to be unique for the The serialNumber is an integer guaranteed to be unique for the
generating host. The signature is the object identifier of the generating host. The reference implementation uses the NTP seconds
message digest/signature encryption scheme used to sign the when the certificate was generated. The signature is the object
certificate. It must be identical to the signatureAlgorithm. identifier of the message digest/signature encryption scheme used to
sign the certificate. It must be identical to the
signatureAlgorithm.
CertificateSerialNumber CertificateSerialNumber
SET { ::= INTEGER SET { ::= INTEGER
Validity ::= SEQUENCE { Validity ::= SEQUENCE {
notBefore UTCTime, notBefore UTCTime,
notAfter UTCTime notAfter UTCTime
} }
} }
The notBefore and notAfter define the period of validity as defined The notBefore and notAfter define the period of validity as defined
skipping to change at page 52, line 21 skipping to change at page 53, line 21
SET { SET {
Name ::= SEQUENCE { Name ::= SEQUENCE {
OBJECT IDENTIFIER commonName OBJECT IDENTIFIER commonName
PrintableString HostName PrintableString HostName
} }
} }
For trusted host certificates the subject and issuer HostName is the For trusted host certificates the subject and issuer HostName is the
NTP name of the group, while for all other host certificates the NTP name of the group, while for all other host certificates the
subject and issuer HostName is the NTP name of the host. If these subject and issuer HostName is the NTP name of the host. In the
names are not explicitly specified, they default to the string reference implementation if these names are not explicitly specified,
returned by the Unix gethostname() routine (trailing NUL removed). they default to the string returned by the Unix gethostname() routine
For other than self-signed certificates, the issuer HostName is the (trailing NUL removed). For other than self-signed certificates, the
unique DNS name of the host signing the certificate. issuer HostName is the unique DNS name of the host signing the
certificate.
Authors' Addresses Authors' Addresses
Brian Haberman (editor) Brian Haberman (editor)
The Johns Hopkins University Applied Physics Laboratory The Johns Hopkins University Applied Physics Laboratory
11100 Johns Hopkins Road 11100 Johns Hopkins Road
Laurel, MD 20723-6099 Laurel, MD 20723-6099
US US
Phone: +1 443 778 1319 Phone: +1 443 778 1319
 End of changes. 76 change blocks. 
332 lines changed or deleted 382 lines changed or added

This html diff was produced by rfcdiff 1.37a. The latest version is available from http://tools.ietf.org/tools/rfcdiff/