NTS-KE seerver copy bug

Hal Murray hmurray at megapathdsl.net
Wed Oct 30 11:19:31 UTC 2019


> Would you please post a filename and line range(s) for me to look at?

You need the draft RFC in one hand.  You also need the NTP extension specs - 
RFC 7822.  They are similar, but different in the way the length is 
interpreted.

git log -p 7fb3de6ee9a88cda7910f697a6002dc3e78f5a7b
will show you the details of the fix.

I think the hostname is the only text string in NTS-KE.  The problem was not 
length but missing NUL when turning it into a c string.

The low level worker routines are in nts.c.  The names dealing with the length 
differences have ke+_ or ex_ prefixes.  Maybe we should add a low level 
routine to handle strings.

There are 3 pairs of pack/unpack code.

The high level code that packs a KE request is in nts_client.c, the unpack is 
in nts_server.c
The pack/unpack roles are reversed for the KE response.
The packing/unpacking for cookies is in nts_cookie.c

all in ntpd/

At the top of the loop that scans the KE-response, there is code inside an if 
(0) that prints out the type and length of each chunk.  It's superverbose, but 
occasionally very handy for debugging.


-- 
These are my opinions.  I hate spam.





More information about the devel mailing list