]> git.ipfire.org Git - thirdparty/chrony.git/log
thirdparty/chrony.git
4 years agosys_linux: fix build with older kernel headers
Baruch Siach [Thu, 28 Jan 2021 13:11:31 +0000 (15:11 +0200)] 
sys_linux: fix build with older kernel headers

The renameat2 system call was introduced in kernel version 3.15. Fix
build against older headers.

4 years agotest: improve NTS tests
Miroslav Lichvar [Thu, 14 Jan 2021 15:54:04 +0000 (16:54 +0100)] 
test: improve NTS tests

4 years agonts: support servers specified by IP address
Miroslav Lichvar [Thu, 14 Jan 2021 15:31:07 +0000 (16:31 +0100)] 
nts: support servers specified by IP address

Certificates can include IP addresses as alternative names to enable
clients to verify such certificates without knowing the hostname.

Accept an IP address as a name in the NTS-NTP client and modify the
session code to not set the SNI in this case.

4 years agontp: allow replacement of sources specified by IP address
Miroslav Lichvar [Thu, 14 Jan 2021 13:12:54 +0000 (14:12 +0100)] 
ntp: allow replacement of sources specified by IP address

For sources specified by an IP address, keep the original address as the
source's name and pass it to the NCR instance. Allow the sources to go
through the replacement process if their address has changed.

This will be useful with NTS-KE negotiation.

The IP-based source names are now provided via cmdmon. This means
chronyc -n and -N can show two different addresses for a source.

4 years agontp: fix NULL pointer
Miroslav Lichvar [Thu, 14 Jan 2021 16:31:40 +0000 (17:31 +0100)] 
ntp: fix NULL pointer

4 years agotest: support ss as netstat replacement
Miroslav Lichvar [Wed, 13 Jan 2021 16:01:01 +0000 (17:01 +0100)] 
test: support ss as netstat replacement

netstat is considered obsolete on Linux. It is replaced by ss from
iproute. Support both tools for the test port selection.

4 years agotest: fix port selection to disable grep output
Miroslav Lichvar [Wed, 13 Jan 2021 15:59:17 +0000 (16:59 +0100)] 
test: fix port selection to disable grep output

4 years agotest: make 120-selectoptions more reliable
Miroslav Lichvar [Wed, 13 Jan 2021 15:25:08 +0000 (16:25 +0100)] 
test: make 120-selectoptions more reliable

Remove packet interval checks with long delays as the tests are much
more likely to end when the client is waiting for a response. Increase
the base delay to make selection with two sources more reliable.

Reported-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
4 years agosocket: add debug message for unexpected control message
Miroslav Lichvar [Wed, 13 Jan 2021 12:57:37 +0000 (13:57 +0100)] 
socket: add debug message for unexpected control message

4 years agosocket: check length of received control messages
Miroslav Lichvar [Wed, 13 Jan 2021 12:36:13 +0000 (13:36 +0100)] 
socket: check length of received control messages

Make sure each processed control messages has the expected length.
Beside improved safety, this should prevent potential issues with broken
timestamps on systems that support both 64-bit and 32-bit time_t.

4 years agosched: stop dispatching timeouts on exit
Miroslav Lichvar [Wed, 13 Jan 2021 11:51:57 +0000 (12:51 +0100)] 
sched: stop dispatching timeouts on exit

Check in the dispatch loop whether the need_to_exit flag was set.

4 years agosched: improve infinite loop detection
Miroslav Lichvar [Wed, 13 Jan 2021 11:32:38 +0000 (12:32 +0100)] 
sched: improve infinite loop detection

The "infinite loop in scheduling" fatal error was observed on a system
running out of memory. Presumably, the execution of the process slowed
down due to memory thrashing so much that the dispatching loop wasn't
able to break with a single server polled at a 16-second interval.

To allow recovery in such a case, require for the error more than
20 handled timeouts and a rate higher than 100 per second.

Reported-by: Jamie Gruener <jamie.gruener@biospatial.io>
4 years agortc: log error message when driver initialisation fails
Michael Witten [Tue, 15 Dec 2020 09:44:19 +0000 (10:44 +0100)] 
rtc: log error message when driver initialisation fails

4 years agodoc: diagnose problem with RTC interrupts on Linux
Michael Witten [Mon, 14 Dec 2020 23:02:00 +0000 (23:02 +0000)] 
doc: diagnose problem with RTC interrupts on Linux

This commit updates the FAQ with a new entry.

chronyd's Linux RTC driver (rtc_linux.c) requires the following ioctl
requests to be functional:

  RTC_UIE_ON
  RTC_UIE_OFF

However, a Linux system's RTC driver does not necessarily implement them,
as noted in these previous commits:

  d66b2f2b2423bfbd3de4d69895024dac7eefb306
  rtc: handle RTCs that don't support interrupts
  Tue Dec 10 17:45:28 2019 +0100

  bff3f51d13c3f41e2ead2cfff5bfe0b8c22ef44a
  rtc: extend check for RTCs that don't support interrupts
  Thu Dec 12 12:50:19 2019 +0100

Fortunately, the Linux kernel can be built with software emulation of
these hardware requests, by enabling the following config variable:

  CONFIG_RTC_INTF_DEV_UIE_EMUL
    Provides an emulation for RTC_UIE if the underlying rtc chip
    driver does not expose RTC_UIE ioctls. Those requests generate
    once-per-second update interrupts, used for synchronization.

    The emulation code will read the time from the hardware
    clock several times per second, please enable this option
    only if you know that you really need it.

This commit records these facts for the benefit of the user.

4 years agodoc: fix ntsntpserver reference in chrony.conf man page
Miroslav Lichvar [Thu, 26 Nov 2020 14:09:38 +0000 (15:09 +0100)] 
doc: fix ntsntpserver reference in chrony.conf man page

Fix the name of ntsntpserver directive in ntsrotate description.

Reported-By: Phil Roberts <phil@robertskeys.net>
4 years agonts: save new server keys on start 4.0
Miroslav Lichvar [Wed, 7 Oct 2020 13:26:40 +0000 (15:26 +0200)] 
nts: save new server keys on start

If ntsdumpdir is specified and the server NTS keys are not reloaded from
the file, save the generated keys on start instead of waiting for the
first rotation or exit. This allows the keys to be shared with another
server without having to use the dump command.

4 years agoconf: free refclock strings on exit
Miroslav Lichvar [Wed, 7 Oct 2020 11:18:34 +0000 (13:18 +0200)] 
conf: free refclock strings on exit

Free driver name and parameter of configured refclocks in helpers on
exit.

4 years agontp: avoid unnecessary replacement attempts
Miroslav Lichvar [Wed, 7 Oct 2020 07:37:41 +0000 (09:37 +0200)] 
ntp: avoid unnecessary replacement attempts

In the initial resolving of pool sources try to assign each address only
once. If it fails, it means the address is already used (DNS provided
the same address) or the address is not connectable. The same result can
be expected for other unresolved sources of the pool as they don't have
a real address yet.

4 years agofix compiler warnings
Miroslav Lichvar [Tue, 6 Oct 2020 06:59:56 +0000 (08:59 +0200)] 
fix compiler warnings

Fix -Wchar-subscripts warnings on NetBSD and warnings about pointer
aliasing and uninitialized values with an older compiler.

4 years agodoc: improve FAQ
Miroslav Lichvar [Mon, 5 Oct 2020 11:09:29 +0000 (13:09 +0200)] 
doc: improve FAQ

4 years agodoc: improve ntsrotate description
Miroslav Lichvar [Mon, 5 Oct 2020 09:15:03 +0000 (11:15 +0200)] 
doc: improve ntsrotate description

4 years agosys_netbsd: don't check access to /dev/clockctl with -x
Miroslav Lichvar [Mon, 5 Oct 2020 16:25:50 +0000 (18:25 +0200)] 
sys_netbsd: don't check access to /dev/clockctl with -x

With the -x option there is no need for write access to /dev/clockctl.

4 years agosys: don't start privops helper for NTS-KE helper
Miroslav Lichvar [Mon, 5 Oct 2020 16:14:23 +0000 (18:14 +0200)] 
sys: don't start privops helper for NTS-KE helper

The NTS-KE helper doesn't need to bind sockets or adjust the clock.
Don't start the privops helper, or keep the capabilities, when dropping
root privileges in its context.

4 years agosys: specify process context for dropping root
Miroslav Lichvar [Mon, 5 Oct 2020 16:10:35 +0000 (18:10 +0200)] 
sys: specify process context for dropping root

Similarly to enabling the syscall filter, specify what kind of chronyd
process is dropping the root privileges.

4 years agoconfigure: don't check for getrandom when arc4random is present
Miroslav Lichvar [Mon, 5 Oct 2020 14:17:45 +0000 (16:17 +0200)] 
configure: don't check for getrandom when arc4random is present

On FreeBSD 12, both functions seem to be available. Prefer arc4random.

4 years agotest: improve sources unit test
Miroslav Lichvar [Mon, 5 Oct 2020 12:06:27 +0000 (14:06 +0200)] 
test: improve sources unit test

4 years agocmdmon: add leap status to selectdata report
Miroslav Lichvar [Mon, 5 Oct 2020 09:05:37 +0000 (11:05 +0200)] 
cmdmon: add leap status to selectdata report

4 years agosched: include unexpected jumps in monotonic time
Miroslav Lichvar [Mon, 5 Oct 2020 08:16:53 +0000 (10:16 +0200)] 
sched: include unexpected jumps in monotonic time

Update the monotonic time before the timestamps are corrected for
unexpected jumps, e.g. due to the computer being suspended and resumed,
and switch to the raw timestamps. This should allow the NTS refresh
interval to better follow real time, but it will not be corrected for
a frequency offset if the clock is not synchronized (e.g. with -x).

4 years agocmdmon: fix link-local address check
Miroslav Lichvar [Mon, 5 Oct 2020 07:58:31 +0000 (09:58 +0200)] 
cmdmon: fix link-local address check

Don't check for a link-local address on path of a Unix domain socket.

Fixes: 4e747da4b482 ("ntp+cmdmon: fix responding to link-local addresses")
4 years agosocket: process all message headers
Miroslav Lichvar [Mon, 5 Oct 2020 07:51:52 +0000 (09:51 +0200)] 
socket: process all message headers

If multiple messages were received, don't stop their processing if some
header fails.

Fixes: 86a3ef9ed192 ("socket: add new socket support")
4 years agosocket: always process control messages
Miroslav Lichvar [Mon, 5 Oct 2020 07:39:11 +0000 (09:39 +0200)] 
socket: always process control messages

Even if a received message will not be returned to the caller (e.g.
because it is truncated), process its control messages to avoid leaking
received descriptors.

Fixes: f231efb811ee ("socket: add support for sending and receiving descriptors")
4 years agotest: make 007-cmdmon test more reliable
Miroslav Lichvar [Thu, 1 Oct 2020 08:19:46 +0000 (10:19 +0200)] 
test: make 007-cmdmon test more reliable

4 years agoclient: drop unnecessary function
Miroslav Lichvar [Wed, 30 Sep 2020 14:30:36 +0000 (16:30 +0200)] 
client: drop unnecessary function

Replace cvt_to_sec_usec() with a UTI_DoubleToTimespec() call.

4 years agoutil: fix UTI_BytesToHex() to handle zero-length input
Miroslav Lichvar [Wed, 30 Sep 2020 12:07:04 +0000 (14:07 +0200)] 
util: fix UTI_BytesToHex() to handle zero-length input

4 years agonts: handle invalid algorithm in TLS key export
Miroslav Lichvar [Wed, 30 Sep 2020 12:29:37 +0000 (14:29 +0200)] 
nts: handle invalid algorithm in TLS key export

4 years agonts: fix server kod setting
Miroslav Lichvar [Wed, 30 Sep 2020 10:40:47 +0000 (12:40 +0200)] 
nts: fix server kod setting

Set the response kod value to zero even if NTS server is disabled.

4 years agonts: save server name in client dump file
Miroslav Lichvar [Tue, 29 Sep 2020 12:59:35 +0000 (14:59 +0200)] 
nts: save server name in client dump file

Save the NTS-KE server name and require it to match the name of the
instance loading the file.

4 years agonts: update client state earlier
Miroslav Lichvar [Tue, 29 Sep 2020 12:49:27 +0000 (14:49 +0200)] 
nts: update client state earlier

Generate a new uniq ID on each client poll to invalidate responses to
the previous request, even if a new request cannot be generated (e.g.
due to missing cookies). Reset the NAK indicator earlier in the request
sequence. Also, drop the cookie even if it's not included in the request
to prevent the client from getting stuck with a cookie that has an
invalid length. Rely on the exponentially increasing interval to avoid
frequent NTS-KE sessions due to a client bug.

4 years agodoc+examples: update http links to https
Miroslav Lichvar [Wed, 23 Sep 2020 09:03:45 +0000 (11:03 +0200)] 
doc+examples: update http links to https

4 years agoclient: improve help message
Miroslav Lichvar [Tue, 22 Sep 2020 15:10:16 +0000 (17:10 +0200)] 
client: improve help message

Describe all chronyc options in the help message.

4 years agomain: improve help message
Miroslav Lichvar [Tue, 22 Sep 2020 15:09:51 +0000 (17:09 +0200)] 
main: improve help message

Describe all chronyd options in the help message.

4 years agodoc: document long options
Miroslav Lichvar [Tue, 22 Sep 2020 15:01:29 +0000 (17:01 +0200)] 
doc: document long options

Document the --version and --help options in chronyd and chronyc man
page.

4 years agotest: include CMAC keys in ntp_core unit test
Miroslav Lichvar [Tue, 22 Sep 2020 09:55:10 +0000 (11:55 +0200)] 
test: include CMAC keys in ntp_core unit test

4 years agonts: reset packet length after failed auth encryption
Miroslav Lichvar [Mon, 21 Sep 2020 13:29:37 +0000 (15:29 +0200)] 
nts: reset packet length after failed auth encryption

If encryption of the NTS authenticator field fails, don't leave
uninitialized data in the packet in case a bug causes the packet to be
sent.

4 years agontp: improve NTS check in NAU_DestroyInstance()
Miroslav Lichvar [Wed, 23 Sep 2020 12:59:22 +0000 (14:59 +0200)] 
ntp: improve NTS check in NAU_DestroyInstance()

Check the mode instead of the nts pointer to make it clear the pointer
is not expected to be NULL in an NTS instance (unless the NTS support is
stubbed).

4 years agontp: update comments with new RFCs
Miroslav Lichvar [Mon, 21 Sep 2020 12:06:10 +0000 (14:06 +0200)] 
ntp: update comments with new RFCs

4 years agodoc: update NEWS 4.0-pre4
Miroslav Lichvar [Wed, 16 Sep 2020 09:39:01 +0000 (11:39 +0200)] 
doc: update NEWS

4 years agoupdate copyright years
Miroslav Lichvar [Wed, 16 Sep 2020 08:01:50 +0000 (10:01 +0200)] 
update copyright years

4 years agoclient: drop support for GNU readline
Miroslav Lichvar [Wed, 16 Sep 2020 07:45:59 +0000 (09:45 +0200)] 
client: drop support for GNU readline

GNU readline switched to GPLv3+ in version 6.0, which is incompatible
with the chrony's GPLv2 license.

Drop support for the readline library. Only editline is supported now.

4 years agodoc: update and improve FAQ
Miroslav Lichvar [Tue, 15 Sep 2020 16:06:28 +0000 (18:06 +0200)] 
doc: update and improve FAQ

4 years agodoc: improve chronyd man page
Miroslav Lichvar [Tue, 15 Sep 2020 10:12:41 +0000 (12:12 +0200)] 
doc: improve chronyd man page

4 years agomain: add option to disable check for root
Miroslav Lichvar [Tue, 15 Sep 2020 10:11:08 +0000 (12:11 +0200)] 
main: add option to disable check for root

The -U option can be used to start chronyd under a non-root user if it
is provided with all capabilities and access to files, directories, and
devices, needed to operate correctly in the specified configuration. It
is not recommended in cases where the configuration is unknown.

4 years agosys_linux: don't keep NET_BIND_SERVICE for unprivileged port
Miroslav Lichvar [Tue, 15 Sep 2020 10:02:49 +0000 (12:02 +0200)] 
sys_linux: don't keep NET_BIND_SERVICE for unprivileged port

Don't keep the NET_BIND_SERVICE capability if the configured NTP port is
not privileged (i.e. not smaller than 1024).

4 years agosys_linux: don't keep NET_RAW on new kernels
Miroslav Lichvar [Tue, 15 Sep 2020 09:57:17 +0000 (11:57 +0200)] 
sys_linux: don't keep NET_RAW on new kernels

It seems the NET_RAW capability is no longer needed to bind a socket to
a device since Linux 5.7.

4 years agontp: log error when SIOCSHWTSTAMP fails with EPERM
Miroslav Lichvar [Tue, 15 Sep 2020 08:52:41 +0000 (10:52 +0200)] 
ntp: log error when SIOCSHWTSTAMP fails with EPERM

Increase the severity of the log message to "error" when
the SIOCSHWTSTAMP ioctl fails due missing the NET_ADMIN capability.

4 years agoconfigure: require TLS1.3 support in gnutls
Miroslav Lichvar [Mon, 14 Sep 2020 09:00:29 +0000 (11:00 +0200)] 
configure: require TLS1.3 support in gnutls

Before enabling NTS support, explicitly check for TLS1.3 support in
gnutls, which is required by NTS.

4 years agotest: add ntp_auth unit test
Miroslav Lichvar [Mon, 14 Sep 2020 15:47:23 +0000 (17:47 +0200)] 
test: add ntp_auth unit test

4 years agotest: fix ntp_core unit test
Miroslav Lichvar [Mon, 14 Sep 2020 08:19:10 +0000 (10:19 +0200)] 
test: fix ntp_core unit test

Fix setting of key_id in the response.

Fixes: f6625717cdb0 ("test: improve ntp_core unit test")
4 years agodoc: improve chrony.conf man page
Miroslav Lichvar [Thu, 10 Sep 2020 13:04:27 +0000 (15:04 +0200)] 
doc: improve chrony.conf man page

4 years agodoc: improve chronyc man page
Miroslav Lichvar [Thu, 10 Sep 2020 12:16:48 +0000 (14:16 +0200)] 
doc: improve chronyc man page

4 years agotest: improve ntp_core unit test
Miroslav Lichvar [Thu, 10 Sep 2020 09:53:42 +0000 (11:53 +0200)] 
test: improve ntp_core unit test

4 years agontp: drop support for long NTPv4 MACs
Miroslav Lichvar [Thu, 10 Sep 2020 08:22:27 +0000 (10:22 +0200)] 
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.

4 years agosiv: return error if key is not set
Miroslav Lichvar [Wed, 9 Sep 2020 12:00:32 +0000 (14:00 +0200)] 
siv: return error if key is not set

Avoid encryption or decryption using uninitialized data, or causing a
crash, if a key was not set for the SIV instance.

4 years agonts: improve NTP client code
Miroslav Lichvar [Wed, 9 Sep 2020 07:43:01 +0000 (09:43 +0200)] 
nts: improve NTP client code

Reset the client instance more thoroughly and make sure the
nonce cannot be reused.

4 years agoclient: improve help message for sources command
Miroslav Lichvar [Wed, 9 Sep 2020 06:36:59 +0000 (08:36 +0200)] 
client: improve help message for sources command

4 years agocmdmon: rename status constants
Miroslav Lichvar [Tue, 8 Sep 2020 09:17:48 +0000 (11:17 +0200)] 
cmdmon: rename status constants

Change the naming of reported selection status in the sources report to
better match the internal status.

4 years agosources: don't report untrusted sources as selectable
Miroslav Lichvar [Tue, 8 Sep 2020 08:45:24 +0000 (10:45 +0200)] 
sources: don't report untrusted sources as selectable

Show untrusted sources with the '?' symbol instead of '-' to make them
consistent with not selectable and selectable sources in the selectdata
description.

4 years agoconfigure: fix building with -NTP -CMDMON +SCFILTER
Miroslav Lichvar [Tue, 8 Sep 2020 07:45:13 +0000 (09:45 +0200)] 
configure: fix building with -NTP -CMDMON +SCFILTER

Don't enable privileged operations using the nameserv code unless
NTP is enabled.

4 years agonts: log early client NTS-KE socket errors
Miroslav Lichvar [Tue, 8 Sep 2020 07:41:12 +0000 (09:41 +0200)] 
nts: log early client NTS-KE socket errors

Log an error message when SCK_OpenTcpSocket() fails in the NTS-KE
client, e.g. when connect() fails due to the port not being allowed in
the SELinux policy.

4 years agocmdmon: remove unused test code
Miroslav Lichvar [Mon, 7 Sep 2020 08:45:03 +0000 (10:45 +0200)] 
cmdmon: remove unused test code

4 years agocmdmon: check response length before sending
Miroslav Lichvar [Mon, 7 Sep 2020 08:42:33 +0000 (10:42 +0200)] 
cmdmon: check response length before sending

Before sending a cmdmon response, make sure it is not longer than the
request to avoid amplification in case the response/padding length is
incorrectly specified for a request.

4 years agosys_linux: allow readlinkat in seccomp filter
Vincent Blut [Tue, 1 Sep 2020 12:01:10 +0000 (14:01 +0200)] 
sys_linux: allow readlinkat in seccomp filter

4 years agoexamples: improve chrony-wait service
Miroslav Lichvar [Tue, 1 Sep 2020 10:05:06 +0000 (12:05 +0200)] 
examples: improve chrony-wait service

Use the systemd TimeoutStartSec setting to report a timeout instead of
an error and reduce the timeout to 3 minutes.

4 years agoconf: add clockprecision directive
Miroslav Lichvar [Tue, 1 Sep 2020 09:21:46 +0000 (11:21 +0200)] 
conf: add clockprecision directive

Make the precision of the system clock configurable. This can be useful
on servers using hardware timestamping to reduce the amount of noise
added to the NTP timestamps and improve stability of NTP measurements.

4 years agosys_linux: allow lstat and readlink in seccomp filter
Miroslav Lichvar [Mon, 31 Aug 2020 13:13:39 +0000 (15:13 +0200)] 
sys_linux: allow lstat and readlink in seccomp filter

These syscalls seem to be needed when gnutls is loading system trusted
certificates due to p11-kit >= 0.23.21 getting the program name from
/proc/self/exe.

4 years agotest: extend frequency in ntp_adjtime() test
Bryan Christianson [Mon, 31 Aug 2020 08:09:33 +0000 (20:09 +1200)] 
test: extend frequency in ntp_adjtime() test

Extend the frequency range in the test to cover negative frequencies.

4 years agosys_timex: add workaround for broken ntp_adjtime() on macOS
Bryan Christianson [Mon, 31 Aug 2020 07:56:45 +0000 (19:56 +1200)] 
sys_timex: add workaround for broken ntp_adjtime() on macOS

On macOS 11.0 (Big Sur) beta, ntp_adjtime() incorrectly returns
timex.freq as an unsigned number. This patch is a workaround for the bug
and should be removed when Apple fix the problem (assuming they will).

4 years agodoc: update NEWS 4.0-pre3
Miroslav Lichvar [Tue, 25 Aug 2020 08:58:31 +0000 (10:58 +0200)] 
doc: update NEWS

4 years agodoc: update README
Miroslav Lichvar [Tue, 25 Aug 2020 08:55:34 +0000 (10:55 +0200)] 
doc: update README

4 years agoutil: don't open symlink when appending to file
Miroslav Lichvar [Tue, 25 Aug 2020 07:39:59 +0000 (09:39 +0200)] 
util: don't open symlink when appending to file

When opening a file for appending (i.e. a log file), use the O_NOFOLLOW
flag to get an error if the path is a symlink. Opening log files through
symlinks is no longer supported.

This is a protection against symlink attacks if chronyd is misconfigured
to write a log in a world-writable directory (e.g. /tmp). That is not
meant to become a recommended practice. Log messages will be lost, or
chronyd won't start, if a symlink exists at the location of the log
file.

4 years agotest: fix cookie length in nts_ke_client unit test
Miroslav Lichvar [Mon, 24 Aug 2020 12:03:06 +0000 (14:03 +0200)] 
test: fix cookie length in nts_ke_client unit test

4 years agonts: avoid key corruption on failed loading
Miroslav Lichvar [Thu, 20 Aug 2020 09:18:09 +0000 (11:18 +0200)] 
nts: avoid key corruption on failed loading

Don't save a loaded key to the server key slot until it is fully
decoded.

4 years agonts: explicitly disable session tickets
Miroslav Lichvar [Wed, 19 Aug 2020 11:31:48 +0000 (13:31 +0200)] 
nts: explicitly disable session tickets

Session tickets should never be enabled with the currect code on both
clients and servers. Set the GNUTLS_NO_TICKETS flag when opening a TLS
session in case this understanding is wrong, or it changes in future, to
reduce the TLS attack surface.

4 years agotest: fix 102-hwtimestamp test for new ethtool
Miroslav Lichvar [Thu, 20 Aug 2020 14:17:05 +0000 (16:17 +0200)] 
test: fix 102-hwtimestamp test for new ethtool

New ethtool using netlink messages has a different output.

4 years agotest: extend 110-chronyc test
Miroslav Lichvar [Tue, 18 Aug 2020 15:39:39 +0000 (17:39 +0200)] 
test: extend 110-chronyc test

4 years agotest: extend 007-cmdmon system test
Miroslav Lichvar [Tue, 18 Aug 2020 15:37:28 +0000 (17:37 +0200)] 
test: extend 007-cmdmon system test

4 years agotest: add 105-nts system test
Miroslav Lichvar [Wed, 19 Aug 2020 10:06:43 +0000 (12:06 +0200)] 
test: add 105-nts system test

4 years agotest: add 009-binddevice system test
Miroslav Lichvar [Wed, 19 Aug 2020 10:49:50 +0000 (12:49 +0200)] 
test: add 009-binddevice system test

4 years agotest: add 008-confload system test
Miroslav Lichvar [Tue, 18 Aug 2020 14:28:15 +0000 (16:28 +0200)] 
test: add 008-confload system test

4 years agoconf: rename confdirs and sourcedirs directives
Miroslav Lichvar [Tue, 18 Aug 2020 12:21:06 +0000 (14:21 +0200)] 
conf: rename confdirs and sourcedirs directives

Rename the directives to confdir and sourcedir to better match an
expected use case with only one specified directory.

4 years agoreference: fix assignment of frequency_sd
Miroslav Lichvar [Tue, 18 Aug 2020 11:46:29 +0000 (13:46 +0200)] 
reference: fix assignment of frequency_sd

Fixes: 8afd62d9548b ("reference: update synchronization status more frequently")
4 years agoclient: improve parsing of keygen arguments
Miroslav Lichvar [Tue, 18 Aug 2020 08:22:21 +0000 (10:22 +0200)] 
client: improve parsing of keygen arguments

Detect invalid syntax for the keygen command.

4 years agoclient: ignore case in add command
Miroslav Lichvar [Mon, 17 Aug 2020 15:18:04 +0000 (17:18 +0200)] 
client: ignore case in add command

For consistency with chronyd configuration, make the source type in the
add command case insensitive.

4 years agoclient: drop unnecessary parsing of IPv4 address
Miroslav Lichvar [Mon, 17 Aug 2020 15:06:28 +0000 (17:06 +0200)] 
client: drop unnecessary parsing of IPv4 address

4 years agocmdmon: change name fields to unsigned type
Miroslav Lichvar [Mon, 17 Aug 2020 14:27:54 +0000 (16:27 +0200)] 
cmdmon: change name fields to unsigned type

4 years agotest: fix random failures in nts_ntp_client unit test
Miroslav Lichvar [Mon, 17 Aug 2020 08:11:12 +0000 (10:11 +0200)] 
test: fix random failures in nts_ntp_client unit test

Fixes: 18d9243eb9b0 ("test: improve NTS unit tests")
4 years agotest: improve siv unit test
Miroslav Lichvar [Thu, 13 Aug 2020 14:20:46 +0000 (16:20 +0200)] 
test: improve siv unit test

4 years agotest: improve NTS unit tests
Miroslav Lichvar [Thu, 13 Aug 2020 12:27:13 +0000 (14:27 +0200)] 
test: improve NTS unit tests

4 years agotest: extend 139-nts test
Miroslav Lichvar [Thu, 13 Aug 2020 10:49:39 +0000 (12:49 +0200)] 
test: extend 139-nts test

4 years agonts: check all encrypted fields before saving cookies
Miroslav Lichvar [Thu, 13 Aug 2020 12:25:12 +0000 (14:25 +0200)] 
nts: check all encrypted fields before saving cookies

Don't save any cookies if an encrypted extension field fails parsing.