]> git.ipfire.org Git - thirdparty/chrony.git/commit
ntp: drop support for long NTPv4 MACs
authorMiroslav Lichvar <mlichvar@redhat.com>
Thu, 10 Sep 2020 08:22:27 +0000 (10:22 +0200)
committerMiroslav Lichvar <mlichvar@redhat.com>
Thu, 10 Sep 2020 11:31:57 +0000 (13:31 +0200)
commitfdfcabd79bd3a6a8377e7d5f608d79d6a1ba4313
tree3a4ea4b46edcda95f1d8031fe1079f5d41da248c
parent2bb88b45c621368513a76686d7adf48298c1d057
ntp: drop support for long NTPv4 MACs

Don't accept NTPv4 packets which have a MAC longer than 24 octets to
strictly follow RFC 7822, which specifies the maximum length of a MAC
and the minimum length of the last extension field to avoid an ambiguity
in parsing of the packet.

This removes an ugly hack that was needed to accept packets that
contained one or more extension fields without a MAC, before RFC 7822
was written and NTP implementations started using truncated MACs.

The long MACs were used by chrony in versions 2.x when configured to
authenticate a server or peer with a key using a 256-bit or longer hash
(e.g. SHA256). For compatibility with chrony >= 4.0, these clients/peers
will need to have "version 3" added to the server/peer line in
chrony.conf.
ntp_auth.c
ntp_core.c
test/unit/ntp_core.c