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

dieter.sibold@ptb.de Mon, 07 March 2016 19:01 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 92CF11CD906 for <ietfarch-ntp-archives-ahFae6za@ietfc.amsl.com>; Mon, 7 Mar 2016 11:01:29 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -5.019
X-Spam-Level:
X-Spam-Status: No, score=-5.019 tagged_above=-999 required=5 tests=[HEADER_FROM_DIFFERENT_DOMAINS=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, 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 WVnfmfou0Ugk for <ietfarch-ntp-archives-ahFae6za@ietfc.amsl.com>; Mon, 7 Mar 2016 11:01:27 -0800 (PST)
Received: from lists.ntp.org (lists.ntp.org [149.20.68.7]) by ietfc.amsl.com (Postfix) with ESMTP id 3473F1CD908 for <ntp-archives-ahFae6za@lists.ietf.org>; Mon, 7 Mar 2016 11:01:27 -0800 (PST)
Received: from lists.ntp.org (lists.ntp.org [149.20.68.7]) by lists.ntp.org (Postfix) with ESMTP id 268F186DB31 for <ntp-archives-ahFae6za@lists.ietf.org>; Mon, 7 Mar 2016 19:01:27 +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 D242886D60E; Mon, 7 Mar 2016 17:08:38 +0000 (UTC)
Received: from mx1.bs.ptb.de ([192.53.103.120]) by mail1.ntp.org with esmtps (TLSv1:AES256-SHA:256) (Exim 4.77 (FreeBSD)) (envelope-from <dieter.sibold@ptb.de>) id 1acydx-000IMY-Nv; Mon, 07 Mar 2016 17:08:38 +0000
Received: from smtp-hub.bs.ptb.de (smtpint01.bs.ptb.de [141.25.87.32]) by mx1.bs.ptb.de with ESMTP id u27H8Ihv012953-u27H8Ihx012953 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=FAIL); Mon, 7 Mar 2016 18:08:18 +0100
Received: from rose.bs.ptb.de (rose.bs.ptb.de [141.25.85.201]) by smtp-hub.bs.ptb.de (Postfix) with ESMTP id CD468351D7; Mon, 7 Mar 2016 18:08:18 +0100 (CET)
In-Reply-To: <20160307131625.GA3209@localhost>
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>
To: Miroslav Lichvar <mlichvar@redhat.com>
MIME-Version: 1.0
Message-ID: <OFD1361D67.E13510CC-ONC1257F6F.005BF6CC-C1257F6F.005E2416@ptb.de>
From: dieter.sibold@ptb.de
Date: Mon, 07 Mar 2016 18:08:16 +0100
X-SA-Exim-Connect-IP: 192.53.103.120
X-SA-Exim-Rcpt-To: stenn@ntp.org, ntpwg@lists.ntp.org, ntpwg-bounces+dieter.sibold=ptb.de@lists.ntp.org
X-SA-Exim-Mail-From: dieter.sibold@ptb.de
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>
Cc: "'ntpwg@lists.ntp.org'" <ntpwg@lists.ntp.org>, "Karen ODonoghue (odonoghue@isoc.org)" <odonoghue@isoc.org>, ntpwg <ntpwg-bounces+dieter.sibold=ptb.de@lists.ntp.org>, Suresh Krishnan <suresh.krishnan@ericsson.com>
Content-Type: multipart/mixed; boundary="===============5254277575176808951=="
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>

E-Mail: dieter.sibold@ptb.de


"ntpwg" <ntpwg-bounces+dieter.sibold=ptb.de@lists.ntp.org> schrieb am 
07.03.2016 14:16:25:

> Von: Miroslav Lichvar <mlichvar@redhat.com>
> An: Harlan Stenn <stenn@ntp.org>
> Kopie: "'ntpwg@lists.ntp.org'" <ntpwg@lists.ntp.org>, "Karen 
> ODonoghue \(odonoghue@isoc.org\)" <odonoghue@isoc.org>, Suresh 
> Krishnan <suresh.krishnan@ericsson.com>
> Datum: 07.03.2016 14:40
> Betreff: Re: [ntpwg] The next step of draft-ietf-ntp-checksum-trailer
> Gesendet von: "ntpwg" <ntpwg-bounces+dieter.sibold=ptb.de@lists.ntp.org>
> 
> 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.
> 
> > Tal wrrote Errata 3627 (or whatever) and removed that requirement.
> 
> Yes, but why is that a problem?
> 
> > 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.


Harlan, I do not agree that you need to protect the association and key 
exchange of NTS. The goal of the first exchanged messages of NTS is to 
securely authenticate the server and exchange the cookie. And yes, tough 
these messages are piggybacked on NTP messages, they do not protect NTP's 
time stamps. However the NTS messages in itself and especially the cookie 
exchange message are cryptographically protected. A client has the choice 
to trust or not to trust the time stamps exchanged during the association 
and cookie exchange.  After the cookie is being exchanged all following 
time requests and responses are of course protected by a MAC. So, a client 
always has the option only to trust the authenticated time stamps. I don't 
see that anyone want to distribute manually symmetric keys only for the 
purpose to protect the first three message exchanges of NTS. And if you 
are in a situation in which you can exchange symmetric keys with your 
customers you don't need to apply NTS. But in most cases, distribution of 
symmetric keys are realistically not an option.


> 
> > 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? 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.
> Normally, the client will require all fields to be covered by MAC if
> authentication is enabled.
> 
> > > > - 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 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.
> 
> > 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.
> 
> > >> - a MAC consists of a 4-byte keyid and a payload.  If there is no
> > >> autokey extension field, the keyid MUST be <65535, and we SHOULD 
have
> > > 
> > > Isn't that restriction for keyid just for the autokey RFC? There are
> > > NTP implementations that allow any keyid with symmetric keys.
> > 
> > Originally:
> > 
> > - any extension field meant there MUST be a MAC.
> > - the only defined extention field as been autokey.
> > - if no extension field was present, then no autokey, and a MAC meant
> >   symmetric key was being used.  keyid < 65535.
> > - if an extension field was present, the autokey was being used, there
> >   MUST be a MAC, and  keyid > 65535.
> 
> That applies to the reference implementation, but not necessarily for
> other NTPv4 implementations. They can parse extension fields, but they
> don't have to know anything about autokey and can authenticate with
> MACs using key IDs above 65535.
> 
> -- 
> Miroslav Lichvar
> _______________________________________________
> ntpwg mailing list
> ntpwg@lists.ntp.org
> http://lists.ntp.org/listinfo/ntpwg
_______________________________________________
ntpwg mailing list
ntpwg@lists.ntp.org
http://lists.ntp.org/listinfo/ntpwg