<?xml version='1.0'?>
<!DOCTYPE rfc SYSTEM 'rfc2629.dtd' [
<!ENTITY rfc2119 PUBLIC '' 'http://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.2119.xml'>
<!ENTITY rfc5905 PUBLIC '' 'http://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.5905.xml'>
<!ENTITY rfc7384 PUBLIC '' 'http://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.7384.xml'>
<!ENTITY rfc7822 PUBLIC '' 'http://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.7822.xml'>
]>
<rfc docName="draft-dfranke-ntp-keyid0-00"
     category="std"
     xml:lang="en">
  <front>
    <title abbrev="Processing Expectations for NTP keyid 0">
      Clarifying Processing Expectations for Packets with keyid 0 in the Network Time Protocol Version 4
    </title>
    <author fullname="Daniel Fox Franke" initials="D" surname="Franke">
      <organization abbrev="Akamai">Akamai Technologies, Inc.</organization>
      <address>
        <postal>
          <street>150 Broadway</street>
          <city>Cambridge</city>
          <region>MA</region>
          <code>02142</code>
          <country>United States</country>
        </postal>
        <email>dafranke@akamai.com</email>
        <uri>https://www.dfranke.us</uri>
      </address>
    </author>
    <date year="2016" month="June" day="22"/>
    <area>Internet</area>
    <workgroup>Network Time Protocol Working Group</workgroup>
    <abstract>
      <t>
        This memo clarifies that when a Network Time Protocol Version
        4 packet has a keyid field of zero, the MAC is present solely
        to satisfy certain syntactic constraints, and is to be
        ignored.
      </t>
    </abstract>
  </front>
  <middle>
    <section title="Introduction">
      <t>
        A Network Time Protocol Version 4 (NTPv4) packet consists of
        48 octets of required fields, followed by zero or more
        extension fields, possibly followed by a keyid field and a
        MAC. <xref target="RFC5905">RFC&nbsp;5905</xref> (section 7.5)
        specifies that the MAC &quot;is always present when an
        extension field is present&quot;. <xref
        target="RFC7822">RFC&nbsp;7822</xref> relaxes this requirement
        by permitting the keyid and MAC fields to be omitted, provided
        that the last extension field has a length of at least 28
        octets. This minimum length requirement is necessary to
        prevent syntactic ambiguity.
      </t>
      <t>
        Neither RFC 5905 nor RFC 7822 provides any clear guidance on
        what to do when it is necessary to construct a packet which
        contains at least one extension field but none with a length
        of 28 octets or more, and no key has been agreed which could
        be used to compute a valid MAC.  This memo resolves this
        situation by codifying the convention, already observed by the
        RFC 5905 reference implementation and other existing
        implementations, that a keyid field of zero is a dummy value
        indicating that the MAC field is to be ignored.
      </t>
    </section>
    <section title="Requirements Terminology">
      <t>
      The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL
      NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and
      "OPTIONAL" in this document are to be interpreted as described
      in <xref target="RFC2119">RFC&nbsp;2119</xref>.
      </t>
    </section>
    <section title="Processing Expectations">
      <t>
      In an NTPv4 packet, a keyid field with a value of zero denotes
      that the keyid field and the MAC field which follows it have
      been inserted solely to satisfy a syntactic requirement for the
      presence of a MAC field. Implementations which receive such a
      packet MUST process it in the same manner that they would if the
      keyid and MAC fields were omitted (supposing this were
      syntactically possible). In particular, implementations MUST NOT
      attempt to verify the MAC, and MUST NOT respond to the sender
      with a crypto-NAK.
      </t>
    </section>
    <section title="Security Considerations">
      <t>
        The security considerations of time protocols in general are
        discussed in <xref target="RFC7384">RFC&nbsp;7384</xref>, and
        the security considerations of NTP are discussed in <xref
        target="RFC5905">RFC&nbsp;5905</xref>.
      </t>
      <t>
        Legacy MAC fields containing dummy values do not contribute
        any information regarding the authenticity or inauthenticity
        of an NTP packet. NTP packets with dummy MAC fields MAY prove
        their authenticity by other mechanisms, e.g. <xref
        target="draft-mayer-ntp-mac-extension-field"/>. See the
        previously-cited RFC 7384 and RFC 5905 for discussion of the
        security considerations surrounding accepting unauthenticated
        time packets.
      </t>
      <t>
        Whenever two cooperating principals have conflicting processing
        expectations for a similar message, &quot;confused deputy&quot;
        vulnerabilities may arise <xref
        target="confused-deputy"/>. Without speculating as to any
        specifics as to how this class of vulnerability could arise from
        this instance of confusion, by making the processing
        expectations clear we preclude the possibility of it doing so.
      </t>
    </section>
    <section title="IANA Considerations"><t>None.</t></section>
  </middle>
  <back>
    <references title="Normative References">
      &rfc2119;
      &rfc5905;
      &rfc7822;
    </references>
    <references title="Informative References">
      &rfc7384;
      <reference anchor="confused-deputy">
        <front>
          <title>
            The Confused Deputy: (or why capabilities might have been invented)
          </title>
          <author fullname="Norm Hardy" initials="N" surname="Hardy">
            <organization>Key Logic</organization>
          </author>
          <date year="1988" month="October"/>
        </front>
        <seriesInfo name="ACM SIGOPS Operating Systems Review" value="Volume 22 Issue 4, pp. 36&ndash;38"/>
      </reference>
      <reference anchor="draft-mayer-ntp-mac-extension-field"
                 target="https://datatracker.ietf.org/doc/draft-mayer-ntp-mac-extension-field/">
        <front>
          <title>
            The Network Time Protocol Version 4 (NTPv4) MAC Extension Field
          </title>
          <author fullname="Danny Mayer" initials="D" surname="Mayer"/>
          <author fullname="Harlan Stenn" initials="H" surname="Stenn"/>
          <date year="2016" month="March" day="14"/>
        </front>
        <annotation>Work in progress.</annotation>
      </reference>
    </references>
  </back>
</rfc>
