Re: [Ntp] Comments after implementing draft-ietf-ntp-roughtime-05

Christer Weinigel <christer@weinigel.se> Wed, 27 April 2022 13:07 UTC

Return-Path: <christer@weinigel.se>
X-Original-To: ntp@ietfa.amsl.com
Delivered-To: ntp@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id DBCE0C420495 for <ntp@ietfa.amsl.com>; Wed, 27 Apr 2022 06:07:04 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.896
X-Spam-Level:
X-Spam-Status: No, score=-1.896 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001, URIBL_DBL_BLOCKED_OPENDNS=0.001, URIBL_ZEN_BLOCKED_OPENDNS=0.001, WEIRD_PORT=0.001] autolearn=ham autolearn_force=no
Received: from mail.ietf.org ([50.223.129.194]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id UGQ0En8w_006 for <ntp@ietfa.amsl.com>; Wed, 27 Apr 2022 06:07:01 -0700 (PDT)
Received: from www.weinigel.se (www.weinigel.se [71.19.158.104]) by ietfa.amsl.com (Postfix) with ESMTP id E40F2C420476 for <ntp@ietf.org>; Wed, 27 Apr 2022 06:06:43 -0700 (PDT)
Received: from mail.weinigel.se (localhost [IPv6:::1]) by www.weinigel.se (Postfix) with ESMTP id DE37B24902; Wed, 27 Apr 2022 15:06:42 +0200 (CEST)
Received: from localhost (localhost [127.0.0.1]) by zoo.weinigel.se (Postfix) with ESMTP id 610C7408C3; Wed, 27 Apr 2022 13:06:42 +0000 (UTC)
Received: from mail.weinigel.se ([127.0.0.1]) by localhost (mail.weinigel.se [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id n9p-hKgfeW-z; Wed, 27 Apr 2022 13:06:39 +0000 (UTC)
Received: from sloth.lab.weinigel.se (gw.lab.weinigel.se [10.20.3.1]) by zoo.weinigel.se (Postfix) with ESMTP id 9ACF74053D; Wed, 27 Apr 2022 13:06:39 +0000 (UTC)
Message-ID: <fbcc9809337ac6d2b0e3b961f7d87cc9919a2a05.camel@weinigel.se>
From: Christer Weinigel <christer@weinigel.se>
To: Stuart Stock <stuart@int08h.com>, "ntp@ietf.org" <ntp@ietf.org>
Date: Wed, 27 Apr 2022 15:06:39 +0200
In-Reply-To: <SN6PR13MB241430673C7F8C15FB7213FFB31C9@SN6PR13MB2414.namprd13.prod.outlook.com>
References: <SN6PR13MB241430673C7F8C15FB7213FFB31C9@SN6PR13MB2414.namprd13.prod.outlook.com>
Content-Type: text/plain; charset="UTF-8"
User-Agent: Evolution 3.38.3-1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Archived-At: <https://mailarchive.ietf.org/arch/msg/ntp/Ivg-FKn0MlHyND_yBO8wLXqkxE0>
Subject: Re: [Ntp] Comments after implementing draft-ietf-ntp-roughtime-05
X-BeenThere: ntp@ietf.org
X-Mailman-Version: 2.1.34
Precedence: list
List-Id: Network Time Protocol <ntp.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/ntp>, <mailto:ntp-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/ntp/>
List-Post: <mailto:ntp@ietf.org>
List-Help: <mailto:ntp-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/ntp>, <mailto:ntp-request@ietf.org?subject=subscribe>
X-List-Received-Date: Wed, 27 Apr 2022 13:07:04 -0000

Hi,

> Hi there. I've recently implemented the draft-05 protocol in
> Roughtime (https://github.com/int08h/roughenough) with two caveats. I
> updated the server `roughtime.int08h.com:2002` to run the draft
> protocol, subject to the caveats below:

Nice.  I have set up a couple of roughtime servers using Marcus
Dansarie's implementation found at
https://github.com/dansarie/roughtimed and am trying to do some
interoperability testing with other implementations and have just taken
a quick look at your implementation.

Regarding your client implementation I see two issues when using
Dansarie's server.

The first is regarding the timestamp format:

In https://www.ietf.org/archive/id/draft-roughtime-aanchal-01.txt the
timestamp was defined as the number of microseconds since the epoch.
In the latest draft

https://www.ietf.org/archive/id/draft-ietf-ntp-roughtime-05.txt

a timestamp is defined this way: "The most significant 3 bytes contain
the integer part of a Modified Julian Date (MJD).  The least
significant 5 bytes is a count of the number of microseconds since
midnight on that day."

As far as I can tell your implementation still uses the old format so
using your client with Dansarie's server will give the wrong time.

./roughenough-client -p 1 sth1.roughtime.netnod.se 2002
Dec 08 4049 15:12:42 +00:00

Second, if I try to enable signature checking I get an error:

./roughenough-client -p 1 -v -d sth2.roughtime.netnod.se 2002 -k
"T/xxX4ERUBAOpt64Z8phWamKsASZxJ0VWuiPm3GS/8g="
Nonce is not present in the response's merkle tree',
src/bin/roughenough-client.rs:261:9

I have not dug down into this, but I guess it is due to you using the
standard SHA512/256 hash algorithm.

Marcus Dansarie has also written a Python implementation of roughtime.
 
https://github.com/dansarie/pyroughtime

His client does work with your server at roughtime.int08h.com when
using the old version of the protocol, but if I try to use the new
version it receives no response.  I have not tried to figure out why
yet, but will try to do that next week.

  /Christer