Re: [ntpwg] The next step of draft-ietf-ntp-checksum-trailer

Danny Mayer <mayer@ntp.org> Tue, 08 March 2016 03:52 UTC

Return-Path: <ntpwg-bounces+ntp-archives-ahfae6za=lists.ietf.org@lists.ntp.org>
X-Original-To: ietfarch-ntp-archives-ahFae6za@ietfc.amsl.com
Delivered-To: ietfarch-ntp-archives-ahFae6za@ietfc.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfc.amsl.com (Postfix) with ESMTP id B70171CDC3B for <ietfarch-ntp-archives-ahFae6za@ietfc.amsl.com>; Mon, 7 Mar 2016 19:52:57 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -6.901
X-Spam-Level:
X-Spam-Status: No, score=-6.901 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_HI=-5, RP_MATCHES_RCVD=-0.001] autolearn=ham autolearn_force=no
Received: from mail.ietf.org ([4.31.198.41]) by localhost (ietfc.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id C2s2-q2SOIHJ for <ietfarch-ntp-archives-ahFae6za@ietfc.amsl.com>; Mon, 7 Mar 2016 19:52:56 -0800 (PST)
Received: from lists.ntp.org (lists.ntp.org [IPv6:2001:4f8:fff7:1::7]) by ietfc.amsl.com (Postfix) with ESMTP id D57011CDC37 for <ntp-archives-ahFae6za@lists.ietf.org>; Mon, 7 Mar 2016 19:52:56 -0800 (PST)
Received: from lists.ntp.org (lists.ntp.org [149.20.68.7]) by lists.ntp.org (Postfix) with ESMTP id 4B47186DB48 for <ntp-archives-ahFae6za@lists.ietf.org>; Tue, 8 Mar 2016 03:52:56 +0000 (UTC)
X-Original-To: ntpwg@lists.ntp.org
Delivered-To: ntpwg@lists.ntp.org
Received: from mail1.ntp.org (mail1.ntp.org [IPv6:2001:4f8:fff7:1::5]) by lists.ntp.org (Postfix) with ESMTP id 1BC5486DAA7 for <ntpwg@lists.ntp.org>; Tue, 8 Mar 2016 03:43:04 +0000 (UTC)
Received: from pool-71-174-223-139.bstnma.east.verizon.net ([71.174.223.139] helo=[10.10.10.102]) by mail1.ntp.org with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.77 (FreeBSD)) (envelope-from <mayer@ntp.org>) id 1ad8Xm-00059q-Dn; Tue, 08 Mar 2016 03:42:53 +0000
References: <4569da98236441699fb26aebb71f90a7@IL-EXCH01.marvell.com> <E1acVNL-000CK8-RW@stenn.ntp.org> <20160307093202.GJ20222@localhost> <E1acsHr-000Dmy-Bf@stenn.ntp.org> <20160307112840.GK20222@localhost> <E1acuOC-000Dwm-SV@stenn.ntp.org> <20160307131625.GA3209@localhost> <E1ad3uf-000EcV-1I@stenn.ntp.org>
To: Harlan Stenn <stenn@ntp.org>, Miroslav Lichvar <mlichvar@redhat.com>
From: Danny Mayer <mayer@ntp.org>
X-Enigmail-Draft-Status: N1110
Organization: NTP
Message-ID: <56DE4A34.1070106@ntp.org>
Date: Mon, 07 Mar 2016 22:42:44 -0500
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0
MIME-Version: 1.0
In-Reply-To: <E1ad3uf-000EcV-1I@stenn.ntp.org>
X-SA-Exim-Connect-IP: 71.174.223.139
X-SA-Exim-Rcpt-To: suresh.krishnan@ericsson.com, odonoghue@isoc.org, ntpwg@lists.ntp.org, mlichvar@redhat.com, stenn@ntp.org
X-SA-Exim-Mail-From: mayer@ntp.org
X-SA-Exim-Version: 4.2
X-SA-Exim-Scanned: Yes (on mail1.ntp.org)
Subject: Re: [ntpwg] The next step of draft-ietf-ntp-checksum-trailer
X-BeenThere: ntpwg@lists.ntp.org
X-Mailman-Version: 2.1.20
Precedence: list
List-Id: IETF Working Group for Network Time Protocol <ntpwg.lists.ntp.org>
List-Unsubscribe: <http://lists.ntp.org/options/ntpwg>, <mailto:ntpwg-request@lists.ntp.org?subject=unsubscribe>
List-Archive: <http://lists.ntp.org/pipermail/ntpwg/>
List-Post: <mailto:ntpwg@lists.ntp.org>
List-Help: <mailto:ntpwg-request@lists.ntp.org?subject=help>
List-Subscribe: <http://lists.ntp.org/listinfo/ntpwg>, <mailto:ntpwg-request@lists.ntp.org?subject=subscribe>
Reply-To: mayer@ntp.org
Cc: "'ntpwg@lists.ntp.org'" <ntpwg@lists.ntp.org>, Suresh Krishnan <suresh.krishnan@ericsson.com>, "Karen ODonoghue (odonoghue@isoc.org)" <odonoghue@isoc.org>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Errors-To: ntpwg-bounces+ntp-archives-ahfae6za=lists.ietf.org@lists.ntp.org
Sender: ntpwg <ntpwg-bounces+ntp-archives-ahfae6za=lists.ietf.org@lists.ntp.org>

On 3/7/2016 5:46 PM, Harlan Stenn wrote:
> Miroslav Lichvar writes:
>> On Mon, Mar 07, 2016 at 12:35:56PM +0000, Harlan Stenn wrote:
>>> Originally, if there was an extension field there MUST be a MAC.
>>
>> Right. That requirement was not necessary and it was later removed.
> 
> Really?  Please say more.  Where can I learn about this?
> 

I recall that there were conflicting statements in RFC5905 (NTPv4) and
RFC5906 (autokey) when we were doing the extension field draft and that
was one of the reasons that we clarified that the MAC was optional in
that draft. Section 7.3 of RFC5905 indicates that the MAC is optional
but elsewhere it seemed to be required. The EF draft makes it clear that
it is optional though any specific extension field may require it. The
draft was meant to remove the ambiguities.

>>> MAC protection is good.  NTS uses a 'single' Field Type, but the first
>>> few packets have no MAC protection.  Therefore, the first few packets of
>>> an NTS exchange arguably MUST have MAC protection outside the NTS
>>> packet
>>
>> With what key would that MAC be generated? Unless I misunderstood how
>> NTS is supposed to work, the first few packets are simply not
>> authenticated and can't be used for anything except initialization of
>> the NTS association.
> 

From what I understand from the NTS architects, the early NTS protocol
are protected by the contents and a MAC is not necessary.

> Symmetric key would be an OK choice here.  Preferably using the "MAC in
> an EF".
> 
>>> We're getting ready to publish a "MAC in an Extension Field", and
>>> arguably this is how it should have been originally done.  So in keeping
>>> with the above logic, there are 2 pieces of information we want to see
>>> for an extension field.  One is "SHOULD or MAY have MAC protection after
>>> this field," and the other is "This extension field provides MAC
>>> protection."
>>
>> What will the receiver of this information do with it?
> 
> Whatever it wants.  This goes to giving the client basic information
> that is useful in deciding what to do in case the client  gets EFs it
> doesn't understand.
> 

If it gets EF's it doesn't understand it makes no difference whether or
not it indicates that it requires a MAC. You can't do anything with it.

>> The client must
>> have its own policy on what extension fields has to be covered with
>> MAC in order to accept the packet. The server can't dictate that.
> 
> Of course.
> 
>> Normally, the client will require all fields to be covered by MAC if
>> authentication is enabled.
> 
> Yes.
> 

If you mean the sender then either it provides a MAC of either style or
it doesn't. The MAC covers all parts of the packet until the MAC which
needs to be the last part of the packet. If it uses an extension field
that requires a MAC, not providing it needs to cause the packet to be
dropped by the receiving server.

> So where is the confusion here?
> 
>>>>> - Use a flag bit in the Field Type that says "My extension field does
>>>>> not require a following MAC."
>>>>
>>>> Meaning the field is not related to authentication?
>>>
>>> Meaning "My extension field does not require a MAC after it".  This is
>>> the "MAY" case as opposed to the "SHOULD" case.  An example of this is
>>> Tal's checksum complement proposal, as currently written.  If ntpd sends
>>> out an unauthenticated packet, the FPGA engine is free to rewrite the
>>> transmit timestamp, but since the OS has already computed a UDP
>>> checksum, if the transmit timestamp in the packet is changed it's almost
>>> certain that a checksum complement will be needed to make sure the
>>> existing UDP checksum will still be correct.  That's what Tal's proposal
>>> is all about, and it's the first time we've seen a proposal for an
>>> extension field where one MUST NOT have a MAC at the end of the packet.
>>
>> Ok, but that information is already included in the specification. The
>> client or server that generates that field needs to know that.
> 
> The >sender< needs to know.  The >recipient< might be running old
> software, current software, or software that's aware of these new EFs.
> 
> This all goes to what happens down the road when a newer sender is
> talking to an older recipient.

Yes. See my previous response.

> If a recipient gets data it does not understand, it may benefit from a
> hint as to what's going on with that unknown EF.
> 

No, it has no way of going on with any unknown EF. If you don't
understand it you can't do anything with it.

>>>> The SHA1 MAC is 24 octets, that's why there is a requirement for the
>>>> last extension field to be at least 28 octets.
>>>
>>> 4 byte keyid plus 24 octets.  So 28 bytes is clearly potentially
>>> ambiguous.
>>
>> A SHA1 MAC has 160 bits for the digest and 32 bit for the key ID.
>> That's 192 bits or 24 octets total.
> 
> OK.  What I remember is hearing that we were seeing 3 sizes of old-style
> MACs, and they were 20, 24, and 28 bytes' long.  I'll see what I can
> find out.

DES is 16, MD5 is 24, SHA1 is 28. Cryto-NAK is 4.
> 
>>> Extension fields of 4, 8, 12, or 16 bytes are also unambiguous.  Why
>>> prohibit these lengths?
>>
>> Because MAC in a packet from an old client could be parsed as one or
>> multiple extension fields.
> 
> An old client will ONLY send autokey.  So this is a non-issue, right?

No. An old client may also send symmetric key, ie only a MAC and no EF.

> 
> It's pretty easy to parse an EF and make sure it's sane.  If the current
> spot in the extended payload parses as a good EF, then one can do a
> quick check on any following data in the payload and get a good idea as
> to what's going on.  At worst, you have a packet that CORRECTLY parses
> as both "a bunch of EFs" and "an old-style MAC in a packet that either
> has no extension field or is an autokey packet".  If only one of those
> interpretations is correct, then we can dance on the head of the
> false-negative or false-positive pin.
> 
> Remember, this is *only* a POTENTIAL problem when mixing new and old
> implementations.  In that case folks may need to administratively
> segregate these machines.  We can certainly solve this problem in NTPv5.
> 

See my previous analysis.

Danny

_______________________________________________
ntpwg mailing list
ntpwg@lists.ntp.org
http://lists.ntp.org/listinfo/ntpwg