idnits 2.17.1 draft-stenn-ntp-mac-last-ef-01.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- ** The abstract seems to contain references ([RFC5905], [RFC1305]), which it shouldn't. Please replace those with straight textual mentions of the documents in question. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year -- The document date (November 29, 2017) is 2340 days in the past. Is this intentional? Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) == Missing Reference: 'COMP' is mentioned on line 239, but not defined == Missing Reference: 'DISCUSS' is mentioned on line 241, but not defined ** Obsolete normative reference: RFC 1305 (Obsoleted by RFC 5905) ** Downref: Normative reference to an Informational RFC: RFC 7384 Summary: 3 errors (**), 0 flaws (~~), 3 warnings (==), 1 comment (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 Internet Engineering Task Force H. Stenn 3 Internet-Draft D. Mayer 4 Intended status: Standards Track Network Time Foundation 5 Expires: June 2, 2018 November 29, 2017 7 Network Time Protocol MAC/Last Extension Fields 8 draft-stenn-ntp-mac-last-ef-01 10 Abstract 12 NTPv4 is defined by RFC 5905 [RFC5905], and it and earlier versions 13 of the NTP Protocol have supported symmetric private key Message 14 Authentication Code (MAC) authentication. MACs were first described 15 in Appendix C of RFC 1305 [RFC1305] and are further described in RFC 16 5905 [RFC5905]. As the number of Extension Fields grows there is an 17 increasing chance of a parsing ambiguity when deciding if the "next" 18 set of data is an Extension Field or a legacy MAC. This proposal 19 defines two new Extension Fields to avoid this ambiguity. One, LAST- 20 EF, is used to signifiy that it is the last Extension Field in the 21 packet. If the LAST-EF is present, any subsequent data MUST be 22 considered to be a legacy MAC. The other, MAC-EF, allows one or more 23 MACs to be encapsulated in an Extension Field. If all parties in an 24 association support MAC-EF, the use of a legacy MAC may be avoided. 26 Status of This Memo 28 This Internet-Draft is submitted in full conformance with the 29 provisions of BCP 78 and BCP 79. 31 Internet-Drafts are working documents of the Internet Engineering 32 Task Force (IETF). Note that other groups may also distribute 33 working documents as Internet-Drafts. The list of current Internet- 34 Drafts is at https://datatracker.ietf.org/drafts/current/. 36 Internet-Drafts are draft documents valid for a maximum of six months 37 and may be updated, replaced, or obsoleted by other documents at any 38 time. It is inappropriate to use Internet-Drafts as reference 39 material or to cite them other than as "work in progress." 41 This Internet-Draft will expire on June 2, 2018. 43 Copyright Notice 45 Copyright (c) 2017 IETF Trust and the persons identified as the 46 document authors. All rights reserved. 48 This document is subject to BCP 78 and the IETF Trust's Legal 49 Provisions Relating to IETF Documents 50 (https://trustee.ietf.org/license-info) in effect on the date of 51 publication of this document. Please review these documents 52 carefully, as they describe your rights and restrictions with respect 53 to this document. Code Components extracted from this document must 54 include Simplified BSD License text as described in Section 4.e of 55 the Trust Legal Provisions and are provided without warranty as 56 described in the Simplified BSD License. 58 Table of Contents 60 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2 61 1.1. Requirements Language . . . . . . . . . . . . . . . . . . 2 62 2. The Last Extension Field Extension Field - LAST-EF . . . . . 3 63 3. MAC Extension Field . . . . . . . . . . . . . . . . . . . . . 4 64 4. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 5 65 5. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 5 66 6. Security Considerations . . . . . . . . . . . . . . . . . . . 6 67 7. Normative References . . . . . . . . . . . . . . . . . . . . 6 68 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 6 70 1. Introduction 72 NTPv4 is defined by RFC 5905 [RFC5905], and it and earlier versions 73 of the NTP Protocol have supported symmetric private key Message 74 Authentication Code (MAC) authentication. MACs were first described 75 in Appendix C of RFC 1305 [RFC1305] and are further described in RFC 76 5905 [RFC5905]. As the number of Extension Fields grows there is an 77 increasing chance of a parsing ambiguity when deciding if the "next" 78 set of data is an Extension Field or a legacy MAC. This proposal 79 defines two new Extension Fields to avoid this ambiguity. One, LAST- 80 EF, is used to signifiy that it is the last Extension Field in the 81 packet. If the LAST-EF is present, any subsequent data MUST be 82 considered to be a legacy MAC, or if you prefer, any subsequent datat 83 MUST NOT be considered to be an EF. The other, MAC-EF, allows one or 84 more MACs to be encapsulated in an Extension Field. If all parties 85 in an association support MAC-EF, the use of a legacy MAC may be 86 avoided. 88 1.1. Requirements Language 90 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 91 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 92 document are to be interpreted as described in RFC 2119 [RFC2119]. 94 2. The Last Extension Field Extension Field - LAST-EF 96 Now that multiple extension fields are a possibility, additional 97 packet data could be either an Extension Field or a legacy MAC. 98 Having a means to indicate that there are no more Extension Fields in 99 an NTP packet and any subsequent data MUST be something else, almost 100 certainly a legacy MAC, is a valuable facility. 102 0 1 2 3 103 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 104 +---------------+---------------+-------------------------------+ 105 | Field Type | Field Length | 106 +-------------------------------+-------------------------------+ 108 NTP Extension Field: Last Extension Field - LAST-EF 110 Field Type: TBD (Recommendation for IANA: 0x2008 (Last Extension 111 Field, MAC OPTIONAL)) 113 Field Length: 4 115 Payload: None. 117 Example: 119 0 1 2 3 120 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 121 +---------------+---------------+-------------------------------+ 122 | Field Type (0x2008) | Field Length (0x0004) | 123 +-------------------------------+-------------------------------+ 124 | MAC Key ID | 125 +-------------------------------+-------------------------------+ 126 | Sixteen | 127 +-------------------------------+-------------------------------+ 128 | Octets | 129 +-------------------------------+-------------------------------+ 130 | of | 131 +-------------------------------+-------------------------------+ 132 | MAC | 133 +-------------------------------+-------------------------------+ 135 Example: NTP Extension Field: Last Extension Field, followed by a 136 Legacy MAC 138 3. MAC Extension Field 140 Now that multiple extension fields are a possibility, there is a 141 chance that additional packet data could be either an Extension Field 142 or a legacy MAC. There is benefit to encapsulating the MAC in an 143 extension field. By encapsulating the MAC in an EF, we also have the 144 option to include multiple MACs in a packet, which may be of use in 145 broadcast scenarios, for example. 147 0 1 2 3 148 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 149 +---------------+---------------+-------------------------------+ 150 | Field Type | Field Length | 151 +-------------------------------+-------------------------------+ 152 | MAC Count | MAC 1 Length | 153 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 154 | MAC 2 Length | MAC 3 Length | 155 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 156 . MAC 1 Key ID . 157 . +-+-+-+-+-+-+-+-+-+-+-+-. 158 . MAC 1 Key Data | Random Data Padding . 159 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 160 . MAC 2 Key ID . 161 . +-+-+-+-+-+-+-+-+-+-+-+-+-. 162 . MAC 2 Key Data | Random Data Padding . 163 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 164 . MAC 3 Key ID . 165 . +-+-+-+-+-+-+-+-+-+-. 166 . MAC 3 Key Data |Random Data Padding. 167 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 168 | Padding (as needed) | 169 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 171 NTP Extension Field: MAC EF Format 173 Field Type: TBD (Recommendation for IANA: 0x1003 (MAC-EF, MAC 174 INCLUDED), 0x3003 (MAC-EF, MAC OPTIONAL, MAC INCLUDED)) 176 Field Length: As needed. 178 Payload: As described. 180 A Field Type of 0 and a Length of 0 means this extension field is a 181 crypto-NAK, as defined by RFC5905 [RFC5905]. Otherwise, a Field Type 182 value of TBD (0x1003 is suggested) identifies this extension field as 183 a MAC Extension field. The MAC Count is an unsigned 16-bit field, as 184 is each MAC length field. If there are an even number of MACs 185 specified there is an unused 16-bit field which SHOULD be 0x0000 at 186 the end of the set of MAC length values so that the subsequent MAC 187 data is longword (4-octet) aligned. Each MAC SHALL be padded so that 188 any subsequent MAC starts on a 4-octet boundary. 190 A MAC SHOULD NOT be present if there is a crypto-NAK present in the 191 packet. 193 Each MAC within the extension field consists of a 32-bit key 194 identifier which SHOULD be unique to the set of key identifiers in 195 this MAC extension field followed by ((MAC Length) - 4) octets of 196 data, optionally followed by random octets to pad the key data to the 197 length specified earlier in the extension field. That key identifier 198 is a shared secret which defines the algorithm to be used and a 199 cookie or secret to be used in generating the digest. The MAC digest 200 is produced by hashing the data from the beginning of the NTP packet 201 up to but not including the start of the MAC extension field. The 202 calculation of the digest SHOULD be a hash of this data concatenated 203 with the 32-bit keyid (in network-order), and the key. When sending 204 or receiving a key identifier each side needs to agree on the key 205 identifier, algorithm and the cookie or secret used to produce the 206 digest along with the digest lengths. Note that the sender may send 207 more bytes than are required by the digest algorithm. This would be 208 done to make it more difficult for a casual observer to identify the 209 algorithm being used based on the length of the data. The digest 210 data begins immediately after the key ID, and any padding octets 211 SHOULD be random. 213 4. Acknowledgements 215 MAC-EF: The authors gratefully acknowledge Dave Mills for his 216 insightful comments. 218 5. IANA Considerations 220 This memo requests IANA to allocate NTP Extension Field Types: 222 0x0000 crypto-NAK 224 0x1003 MAC-EF, MAC INCLUDED 226 0x3003 MAC-EF, MAC OPTIONAL, MAC INCLUDED 228 0x0008 LAST-EF 230 0x2008 LAST-EF, MAC OPTIONAL 232 6. Security Considerations 234 The security considerations of time protocols in general are 235 discussed in RFC7384 [RFC7384], and the security considerations of 236 NTP are discussed in RFC5905 [RFC5905]. 238 Digests MD5, DES and SHA-1 are considered compromised and should not 239 be used [COMP]. 241 [DISCUSS] Each MAC length should be at least 20 octets long to allow 242 for 4 octets of key ID and at least 16 octets of digest and random 243 padding. For a 128-bit digest, there would be 4 octets of key ID, 16 244 octets of digest, plus any desired octets of random padding. For 245 SHA-256 digests there are 4 octets of key ID, 32 octets digest, plus 246 any desired octets of random padding. Using MAC lengths that include 247 random padding may make it more difficult for an attacker to know 248 which digest algorithms are used. 250 7. Normative References 252 [RFC1305] Mills, D., "Network Time Protocol (Version 3) 253 Specification, Implementation and Analysis", RFC 1305, 254 DOI 10.17487/RFC1305, March 1992, 255 . 257 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 258 Requirement Levels", BCP 14, RFC 2119, 259 DOI 10.17487/RFC2119, March 1997, 260 . 262 [RFC5905] Mills, D., Martin, J., Ed., Burbank, J., and W. Kasch, 263 "Network Time Protocol Version 4: Protocol and Algorithms 264 Specification", RFC 5905, DOI 10.17487/RFC5905, June 2010, 265 . 267 [RFC7384] Mizrahi, T., "Security Requirements of Time Protocols in 268 Packet Switched Networks", RFC 7384, DOI 10.17487/RFC7384, 269 October 2014, . 271 Authors' Addresses 273 Harlan Stenn 274 Network Time Foundation 275 P.O. Box 918 276 Talent, OR 97540 277 US 279 Email: stenn@nwtime.org 280 Danny Mayer 281 Network Time Foundation 282 P.O. Box 918 283 Talent, OR 97540 284 US 286 Email: mayer@ntp.org