]> git.ipfire.org Git - thirdparty/chrony.git/log
thirdparty/chrony.git
5 years agoconf: add dscp directive
Miroslav Lichvar [Mon, 3 Aug 2020 15:55:42 +0000 (17:55 +0200)] 
conf: add dscp directive

The directive sets the DSCP value in transmitted NTP packets, which can
be useful in local networks where switches/routers are configured to
prioritise packets with specific DSCP values.

5 years agosources: reset leap voting flag earlier in selection
Miroslav Lichvar [Mon, 3 Aug 2020 14:13:56 +0000 (16:13 +0200)] 
sources: reset leap voting flag earlier in selection

Remove the leap vote from sources that get the noselect option, or
have too large distance or jitter.

5 years agontp: improve auth code
Miroslav Lichvar [Mon, 3 Aug 2020 09:38:41 +0000 (11:38 +0200)] 
ntp: improve auth code

Before generating a MAC, make sure there is enough space in the packet.
This is always true with the current code, but it may change when a
non-NTS extension field is supported.

Update the packet auth info after generating a MAC in case it's needed
before the transmission.

Add more assertions and make other changes for better readability.

5 years agotest: improve nts_ntp_client unit test
Miroslav Lichvar [Mon, 27 Jul 2020 13:42:20 +0000 (15:42 +0200)] 
test: improve nts_ntp_client unit test

5 years agonts: disable TLS 1.2 on server
Miroslav Lichvar [Tue, 28 Jul 2020 10:13:17 +0000 (12:13 +0200)] 
nts: disable TLS 1.2 on server

It seems gnutls (at least in version 3.6.14) allows clients to connect
using TLS1.2 when it has a DTLS version enabled in the priority cache.

Disable all DTLS versions in order to disable TLS1.2.

5 years agonts: improve NTS-NTP server/client code
Miroslav Lichvar [Mon, 27 Jul 2020 13:38:46 +0000 (15:38 +0200)] 
nts: improve NTS-NTP server/client code

Add more comments, assertions, debug messages, and other minor
changes to make the code more robust.

5 years agonts: scale server listening backlog with number of helpers
Miroslav Lichvar [Mon, 27 Jul 2020 10:57:44 +0000 (12:57 +0200)] 
nts: scale server listening backlog with number of helpers

5 years agonts: fix destroying of NTS-KE client
Miroslav Lichvar [Mon, 27 Jul 2020 10:13:39 +0000 (12:13 +0200)] 
nts: fix destroying of NTS-KE client

Destroy the NTS-KE session of the client immediately even when the
resolver of the NTP address is running. This removes the session
local change handler and avoids an assertion failure in the local
finalization.

5 years agonts: move loading of syscall filter in NTS-KE server
Miroslav Lichvar [Mon, 27 Jul 2020 07:56:53 +0000 (09:56 +0200)] 
nts: move loading of syscall filter in NTS-KE server

Load the filter after NKS_Initialise() to avoid hitting
a fcntl syscall.

Fixes: 66e097e3e644 ("nts: improve NTS-KE server/client code")
5 years agonts: fix error response to NTS-KE request
Miroslav Lichvar [Thu, 23 Jul 2020 13:46:57 +0000 (15:46 +0200)] 
nts: fix error response to NTS-KE request

When the request has an unrecognized critical record before the
NEXT_PROTOCOL and AEAD_ALGORITHM records, respond with error 0
(unrecognized critical record) instead of 1 (bad request).

When the request has multiple NEXT_PROTOCOL or AEAD_ALGORITHM records,
respond with error 1 (bad request).

5 years agonts: reset NAK indicator with new request
Miroslav Lichvar [Mon, 20 Jul 2020 14:31:49 +0000 (16:31 +0200)] 
nts: reset NAK indicator with new request

Don't restart NTS-KE if a spoofed NAK response was received and no valid
response is received for a subsequent request.

5 years agonts: don't allow malformed encrypted extension fields
Miroslav Lichvar [Mon, 20 Jul 2020 11:38:22 +0000 (13:38 +0200)] 
nts: don't allow malformed encrypted extension fields

Require data decrypted from the NTS authenticator field to contain
correctly formatted extension fields (known or unknown).

5 years agomain: remove unneeded code in signal handler
Miroslav Lichvar [Tue, 14 Jul 2020 16:34:10 +0000 (18:34 +0200)] 
main: remove unneeded code in signal handler

The handler is set up when the main code is already initialized.

5 years agosiv: add more assertions
Miroslav Lichvar [Tue, 14 Jul 2020 15:04:30 +0000 (17:04 +0200)] 
siv: add more assertions

Make sure the returned tag and key lengths are sane.

5 years agonts: improve NTS-KE server/client code
Miroslav Lichvar [Mon, 13 Jul 2020 12:25:57 +0000 (14:25 +0200)] 
nts: improve NTS-KE server/client code

Add more assertions and comments, refactor initialization of the helper,
and make other changes to make the code more robust.

5 years agologging: extend functionality
Miroslav Lichvar [Thu, 16 Jul 2020 11:16:15 +0000 (13:16 +0200)] 
logging: extend functionality

Add a function to get the current minimum severity and a function to set
a global prefix for debug messages in order to identify messages from
helpers.

5 years agoconf: improve error message
Miroslav Lichvar [Tue, 14 Jul 2020 07:15:29 +0000 (09:15 +0200)] 
conf: improve error message

Replace "command" with "directive" for consistency with the
documentation.

5 years agoconf: adopt default bind*address values
Miroslav Lichvar [Mon, 13 Jul 2020 12:19:45 +0000 (14:19 +0200)] 
conf: adopt default bind*address values

Move the default values of the bind*address settings from the
ntp/nts/cmdmon code to conf.

5 years agonts: follow bind*device settings for NTS-KE sockets
Miroslav Lichvar [Mon, 13 Jul 2020 12:16:42 +0000 (14:16 +0200)] 
nts: follow bind*device settings for NTS-KE sockets

Bind the server and client NTS-KE sockets to the specified device.

5 years agonts: deinit gnutls when setting of credentials fails
Miroslav Lichvar [Wed, 15 Jul 2020 10:11:38 +0000 (12:11 +0200)] 
nts: deinit gnutls when setting of credentials fails

This is needed to cleanly exit when the server key/cert couldn't be
loaded.

5 years agonts: disable input when sending data in NTS-KE session
Miroslav Lichvar [Mon, 13 Jul 2020 10:21:39 +0000 (12:21 +0200)] 
nts: disable input when sending data in NTS-KE session

Ignore read events when sending data to avoid spinning with blocked
output.

5 years agodoc: fix formatting with new asciidoctor
Miroslav Lichvar [Tue, 14 Jul 2020 08:22:46 +0000 (10:22 +0200)] 
doc: fix formatting with new asciidoctor

With newer asciidoctor versions a blank character seems to be required
in an empty description used to set the indentation level in a nested
list.

https://github.com/asciidoctor/asciidoctor/issues/2766

5 years agosocket: fix debug message for unsupported binding
Miroslav Lichvar [Fri, 10 Jul 2020 07:04:20 +0000 (09:04 +0200)] 
socket: fix debug message for unsupported binding

Fixes: 4ef944b7343 ("socket: add support for binding sockets to device")
Reported-by: Bryan Christianson <bryan@whatroute.net>
5 years agodoc: mention automatic creation of directories
Miroslav Lichvar [Wed, 8 Jul 2020 15:11:15 +0000 (17:11 +0200)] 
doc: mention automatic creation of directories

5 years agoconf: create ntsdumpdir directory
Miroslav Lichvar [Wed, 8 Jul 2020 15:04:47 +0000 (17:04 +0200)] 
conf: create ntsdumpdir directory

Create the directory specified by the ntsdumpdir directive if it doesn't
exist, similarly to logdir and dumpdir.

5 years agoconf: restrict permissions of created directories
Miroslav Lichvar [Wed, 8 Jul 2020 15:02:32 +0000 (17:02 +0200)] 
conf: restrict permissions of created directories

If logdir or dumpdir doesn't exist, create the directory with no
permissions for other users (mode 0750 instead of 0755).

5 years agocmac+hash: change parameter types
Miroslav Lichvar [Wed, 8 Jul 2020 10:02:12 +0000 (12:02 +0200)] 
cmac+hash: change parameter types

For consistency and safety, change the CMC and HSH functions to accept
signed lengths and handle negative values as errors. Also, change the
input data type to void * to not require casting in the caller.

5 years agonts: don't assume field position in NNA_DecryptAuthEF()
Miroslav Lichvar [Thu, 9 Jul 2020 11:14:55 +0000 (13:14 +0200)] 
nts: don't assume field position in NNA_DecryptAuthEF()

Modify NNA_DecryptAuthEF() to not assume that the authenticator is the
last extension field in the packet as some extension fields specified in
future may need to be placed after the authenticator. The caller of the
function is supposed to verify the position.

5 years agonts: check for negative length in NNA_DecryptAuthEF()
Miroslav Lichvar [Thu, 9 Jul 2020 11:13:13 +0000 (13:13 +0200)] 
nts: check for negative length in NNA_DecryptAuthEF()

As other functions that accept a signed length, make sure it is sane in
NNA_DecryptAuthEF() too.

5 years agonts: fix comment about message handler
Miroslav Lichvar [Tue, 7 Jul 2020 15:55:07 +0000 (17:55 +0200)] 
nts: fix comment about message handler

5 years agonts: improve session code
Miroslav Lichvar [Tue, 7 Jul 2020 10:34:29 +0000 (12:34 +0200)] 
nts: improve session code

Add more comments and assertions, replace getsockopt() call with
SCK_GetIntOption(), replace strncmp() with memcmp(), move a return
statement for clarity, and remove an unused field from the instance
record.

5 years agonts: log details about failed certificate verification
Miroslav Lichvar [Tue, 7 Jul 2020 10:33:46 +0000 (12:33 +0200)] 
nts: log details about failed certificate verification

5 years agontp: drop precompensation of TX timestamp
Miroslav Lichvar [Thu, 2 Jul 2020 13:34:22 +0000 (15:34 +0200)] 
ntp: drop precompensation of TX timestamp

The daemon transmit timestamps are precompensated for the time it takes
to generate a MAC using a symmetric key (as measured on chronyd start)
and also an average round-trip time of the Samba signing of MS-SNTP
responses. This improves accuracy of the transmit timestamp, but it
has some issues.

The correction has a random error which is changing over time due to
variable CPU frequency, system load, migration to a different machine,
etc. If the measured delay is too large, the correction may cause the
transmit timestamp to be later than the actual transmission. Also, the
delay is measured for a packet of a minimal length with no extension
fields, and there is no support for NTS.

Drop the precompensation in favor of the interleaved mode, which now
avoids the authentication delay even when no kernel/hardware timestamps
are available.

5 years agontp: get TX timestamp after authentication
Miroslav Lichvar [Thu, 2 Jul 2020 13:18:23 +0000 (15:18 +0200)] 
ntp: get TX timestamp after authentication

If the daemon transmit timestamp is saved for processing of a future
response or responding in the interleaved mode, get a more accurate
timestamp right before calling NIO_SendPacket(). Avoid unnecessary
reading of the clock for the transmit timestamp in the packet (i.e.
in interleaved modes and client basic mode).

This should improve accuracy and stability when authentication is
enabled in the client and symmetric basic modes and also interleaved
modes if kernel/hardware timestamps are not available.

5 years agontp+cmdmon: fix responding to link-local addresses
Miroslav Lichvar [Tue, 30 Jun 2020 14:13:48 +0000 (16:13 +0200)] 
ntp+cmdmon: fix responding to link-local addresses

After commit e49aececceaa ("socket: don't set interface for sent
packets") the NTP and cmdmon server stopped responding to requests from
link-local addresses.

Set the interface specifically for packets sent to a link-local address.

5 years agosocket: add support for selecting interface again
Miroslav Lichvar [Tue, 30 Jun 2020 13:26:55 +0000 (15:26 +0200)] 
socket: add support for selecting interface again

Revert commit e49aececceaa ("socket: don't set interface for sent
packets") to allow the interface to be selected for outgoing packets,
but don't set it in the callers yet.

5 years agoconf: add directives to specify interfaces for binding sockets
Miroslav Lichvar [Tue, 30 Jun 2020 10:27:10 +0000 (12:27 +0200)] 
conf: add directives to specify interfaces for binding sockets

Add binddevice, bindacqdevice, and bindcmddevice directive to specify
the interface for binding the NTP server, NTP client, and command socket
respectively.

5 years agosocket: add support for binding sockets to device
Miroslav Lichvar [Tue, 30 Jun 2020 08:21:45 +0000 (10:21 +0200)] 
socket: add support for binding sockets to device

As a Linux-specific feature, allow sockets to be bound to a device using
the SO_BINDTODEVICE socket option. The CAP_NET_RAW capability is
required for setting the option.

5 years agoexamples: align onoffline with DHCP NM dispatcher
Robert Fairley [Thu, 4 Jun 2020 18:48:40 +0000 (14:48 -0400)] 
examples: align onoffline with DHCP NM dispatcher

Similar to the DHCP dispatcher, add a variable for the chronyc
executable path, which can be overwritten more easily by
downstream packages if needed.

Also give an `.onoffline` suffix to more clearly differentiate
this script from `chrony.nm-dispatcher.dhcp`.

5 years agoexamples: add dispatcher for NTP servers from DHCP
Robert Fairley [Thu, 4 Jun 2020 18:48:35 +0000 (14:48 -0400)] 
examples: add dispatcher for NTP servers from DHCP

Add new NM dispatcher script for NTP servers given by DHCP through
NetworkManager in a similar way to how distributions have done in
11-dhclient, e.g. [1]. New NTP servers are written as entries to a
file per-interface in /var/run/chrony-dhcp, which is re-read by
chronyd upon executing `chronyc reload sources`.

This provides a way for NTP server configuration to be carried over
from NetworkManager DHCP events to chrony, for DHCP clients other
than dhclient. Part of fixing integration where the NetworkManager
internal client is used, e.g [2].

Paths to the chronyc executable and sources directory are set in
variables, which may be overwritten by downstream packages, but
should work for distributions for the most part.

[1] https://src.fedoraproject.org/rpms/dhcp/blob/master/f/11-dhclient
[2] https://bugzilla.redhat.com/show_bug.cgi?id=1800901

5 years agonameserv: don't return scoped IPv6 addresses
Miroslav Lichvar [Mon, 29 Jun 2020 14:56:09 +0000 (16:56 +0200)] 
nameserv: don't return scoped IPv6 addresses

Ignore IPv6 addresses returned by getaddrinfo() that have a non-zero
scope ID to avoid silently ignoring the ID if it was specified with the
% sign in the provided string.

This can be removed when the scope ID is returned from the function and
the callers handle it.

5 years agontp: fix comment about find_slot()
Miroslav Lichvar [Mon, 29 Jun 2020 14:46:05 +0000 (16:46 +0200)] 
ntp: fix comment about find_slot()

5 years agoconfigure: link with libnssutil3 for NSS hash support
Miroslav Lichvar [Thu, 25 Jun 2020 09:00:53 +0000 (11:00 +0200)] 
configure: link with libnssutil3 for NSS hash support

With recent NSS versions, the NSS low hash initialization seems to fail
unless the executable is linked with the libnssutil3 library.

5 years agosocket: handle negative sa_length
Miroslav Lichvar [Wed, 24 Jun 2020 10:07:55 +0000 (12:07 +0200)] 
socket: handle negative sa_length

As the type of the sa_length parameter is signed, negative values
should be handled as invalid.

5 years agologging: handle too many file logs
Miroslav Lichvar [Wed, 24 Jun 2020 09:27:41 +0000 (11:27 +0200)] 
logging: handle too many file logs

Don't rely on an assert to catch insufficient maximum number of file
logs (e.g. after introducing a new file log).

5 years agontp: rework initial burst
Miroslav Lichvar [Tue, 23 Jun 2020 11:10:02 +0000 (13:10 +0200)] 
ntp: rework initial burst

Instead of making the initial burst only once and immediately after
chronyd start (even when iburst is specified together with the offline
option), trigger the burst whenever the connectivity changes from
offline to online.

5 years agoexample: update chrony.conf examples
Miroslav Lichvar [Mon, 22 Jun 2020 12:45:42 +0000 (14:45 +0200)] 
example: update chrony.conf examples

Add some new directives, remove dumponexit (it's a no-op), remove
broadcast (to not encourage its use), fix a typo, and remove a
OS-specific limitation.

5 years agotest: update cmdmon and chronyc tests with new commands
Miroslav Lichvar [Wed, 17 Jun 2020 13:56:02 +0000 (15:56 +0200)] 
test: update cmdmon and chronyc tests with new commands

5 years agontp: reduce poll adjustment with specific failed tests
Miroslav Lichvar [Wed, 17 Jun 2020 12:18:49 +0000 (14:18 +0200)] 
ntp: reduce poll adjustment with specific failed tests

Reduce the poll increment for measurements that are rejected due to a
failed maxdelay* test in order to better track the source.

5 years agonts: warn about missing NTS support
Miroslav Lichvar [Wed, 17 Jun 2020 11:19:20 +0000 (13:19 +0200)] 
nts: warn about missing NTS support

Log a warning message if an NTP source is specified with the nts option
and the request fails due to missing NTS support.

5 years agonts: update NTS-KE port number
Miroslav Lichvar [Wed, 17 Jun 2020 10:29:20 +0000 (12:29 +0200)] 
nts: update NTS-KE port number

The port assigned by IANA for NTS-KE is 4460.

5 years agosocket: enable only specified IP families
Miroslav Lichvar [Wed, 17 Jun 2020 10:06:21 +0000 (12:06 +0200)] 
socket: enable only specified IP families

Allow an IP family to be specified in the socket initialization in order
to globally disable the other family. This replaces the ntp_io and
cmdmon code handling the -4/-6 options and fixes a case where the NTP
client could still use a disabled family if the source was specified
with an IP address.

5 years agosocket: don't log errors on removing socket
Miroslav Lichvar [Wed, 17 Jun 2020 09:24:15 +0000 (11:24 +0200)] 
socket: don't log errors on removing socket

Call unlink() directly to avoid an error log message when a Unix domain
socket cannot be removed (e.g. SOCK refclock created for gpsd in
/var/run).

5 years agocmdmon: avoid unsigned shorts
Miroslav Lichvar [Wed, 17 Jun 2020 08:28:14 +0000 (10:28 +0200)] 
cmdmon: avoid unsigned shorts

Change unsigned shorts to uint16_t or longer types to avoid any
assumptions about length of the short type.

5 years agontp: combine parameters of NCR_AddBroadcastDestination()
Miroslav Lichvar [Wed, 17 Jun 2020 07:50:23 +0000 (09:50 +0200)] 
ntp: combine parameters of NCR_AddBroadcastDestination()

5 years agoconf: fix missing format string
Miroslav Lichvar [Wed, 10 Jun 2020 13:54:11 +0000 (15:54 +0200)] 
conf: fix missing format string

Fixes: 519796de3756 ("conf: add sourcedirs directive")
5 years agoconf: reset global pointers after parsing line
Miroslav Lichvar [Wed, 10 Jun 2020 13:28:17 +0000 (15:28 +0200)] 
conf: reset global pointers after parsing line

Don't leave dangling pointers in CNF_ParseLine().

5 years agomain: add option to print configuration
Miroslav Lichvar [Wed, 10 Jun 2020 11:13:11 +0000 (13:13 +0200)] 
main: add option to print configuration

Add -p option to chronyd to print lines from the configuration as they
are parsed and exit. It can be used to verify the syntax and get the
whole configuration when it is split into multiple files.

5 years agocmdmon: add reload sources command
Miroslav Lichvar [Wed, 10 Jun 2020 09:20:43 +0000 (11:20 +0200)] 
cmdmon: add reload sources command

Add the command which reloads the files from the directories specified
by the sourcedirs directive.

5 years agoconf: add sourcedirs directive
Miroslav Lichvar [Wed, 10 Jun 2020 09:07:48 +0000 (11:07 +0200)] 
conf: add sourcedirs directive

Add a new directive to include configuration files that only specify NTP
sources and which will be possible to reload with a chronyc command.

5 years agoconf: detect truncated lines
Miroslav Lichvar [Wed, 10 Jun 2020 10:37:15 +0000 (12:37 +0200)] 
conf: detect truncated lines

If the buffer filled by fgets() is full, indicating it might not contain
the whole line, abort with a fatal message.

5 years agontp: add configuration ID to sources
Miroslav Lichvar [Tue, 9 Jun 2020 09:59:25 +0000 (11:59 +0200)] 
ntp: add configuration ID to sources

Provide an ID for each configured NTP source to enable tracking and
removing of its corresponding sources, even after they change their
address.

5 years agotest: disable object dependencies in main makefile
Miroslav Lichvar [Mon, 8 Jun 2020 13:14:22 +0000 (15:14 +0200)] 
test: disable object dependencies in main makefile

When the main makefile is used to get the list of chronyd objects in
order to build the unit tests, clang started (with the -MM option) to
generate the dependency files prints error messages about wrong
inclusions. Set a NODEPS variable to completely disable the generation
of the files.

5 years agoclient: add tab-completition for authdata command
Miroslav Lichvar [Wed, 3 Jun 2020 10:22:18 +0000 (12:22 +0200)] 
client: add tab-completition for authdata command

5 years agoclient: add verbose text to authdata command
Miroslav Lichvar [Wed, 3 Jun 2020 10:20:49 +0000 (12:20 +0200)] 
client: add verbose text to authdata command

5 years agotest: extend siv unit test
Miroslav Lichvar [Wed, 3 Jun 2020 09:07:00 +0000 (11:07 +0200)] 
test: extend siv unit test

5 years agosiv: add gnutls support
Miroslav Lichvar [Wed, 3 Jun 2020 09:03:46 +0000 (11:03 +0200)] 
siv: add gnutls support

Add support for the AES-SIV-CMAC cipher in gnutls using the AEAD
interface. It should be available in gnutls-3.6.14.

This will enable NTS support on systems that have a pre-3.6 version of
Nettle, without falling back to the internal SIV implementation.

5 years agonts: allow missing SIV support
Miroslav Lichvar [Wed, 3 Jun 2020 09:03:00 +0000 (11:03 +0200)] 
nts: allow missing SIV support

When compiled with NTS support, don't require a SIV cipher to be always
supported (e.g. due to a different version of a library used for
building). Handle this case with a fatal message instead of crash.
Also, check the support early in the client unit test to prevent a hang.

5 years agotest: fix sources unit test
Miroslav Lichvar [Thu, 4 Jun 2020 09:13:38 +0000 (11:13 +0200)] 
test: fix sources unit test

Use different source addresses, fix a debug message and a memory leak.

5 years agosources: add more assertions
Miroslav Lichvar [Thu, 4 Jun 2020 07:49:17 +0000 (09:49 +0200)] 
sources: add more assertions

5 years agosources: check for negative distance
Miroslav Lichvar [Thu, 4 Jun 2020 07:35:52 +0000 (09:35 +0200)] 
sources: check for negative distance

This is not expected to happen, but make sure the endpoints of each
source are in the right order (i.e. the distance is not negative) to
prevent getting a negative depth in the selection.

5 years agosources: require majority for trusted sources
Miroslav Lichvar [Tue, 2 Jun 2020 16:54:41 +0000 (18:54 +0200)] 
sources: require majority for trusted sources

Handle trusted sources as a separate set of sources which is required to
have a majority for the selection to proceed. This should improve the
selection with multiple trusted sources (e.g. due to the auth selection
mode).

5 years agosources: relax selection of non-trusted sources
Miroslav Lichvar [Tue, 2 Jun 2020 16:06:46 +0000 (18:06 +0200)] 
sources: relax selection of non-trusted sources

When the selection has some trusted sources, don't require non-trusted
sources to be contained in the best interval as that can usually pass
only one source if the best interval is the interval of the source, or
no source at all if the best interval is an intersection of multiple
sources.

Relax the requirement for non-trusted sources to be contained in the
best interval of trusted sources alone instead of all sources in the
trusted interval.

5 years agosources: extend mark debug message
Miroslav Lichvar [Tue, 2 Jun 2020 16:05:43 +0000 (18:05 +0200)] 
sources: extend mark debug message

5 years agosources: include hostname in selection log message
Miroslav Lichvar [Mon, 1 Jun 2020 15:22:58 +0000 (17:22 +0200)] 
sources: include hostname in selection log message

When selecting an NTP source, include the hostname in the log message.

5 years agocmdmon: update protocol changelog
Miroslav Lichvar [Wed, 3 Jun 2020 10:37:45 +0000 (12:37 +0200)] 
cmdmon: update protocol changelog

5 years agocmdmon: add selectdata command
Miroslav Lichvar [Mon, 25 May 2020 12:10:40 +0000 (14:10 +0200)] 
cmdmon: add selectdata command

Add a command to report selection-specific data.

5 years agocmdmon: don't report selection options in source report
Miroslav Lichvar [Mon, 25 May 2020 11:58:00 +0000 (13:58 +0200)] 
cmdmon: don't report selection options in source report

The selection options returned as flags are not reported by the
client and will be better reported in a separate command with other
selection-specific data.

5 years agoclient: fix help message to indicate mask is optional
Miroslav Lichvar [Mon, 25 May 2020 12:06:08 +0000 (14:06 +0200)] 
client: fix help message to indicate mask is optional

5 years agotest: add 140-noclientlog test
Miroslav Lichvar [Thu, 21 May 2020 14:19:59 +0000 (16:19 +0200)] 
test: add 140-noclientlog test

5 years agoclientlog: fix check for ratelimit and noclientlog
Miroslav Lichvar [Thu, 21 May 2020 14:07:52 +0000 (16:07 +0200)] 
clientlog: fix check for ratelimit and noclientlog

Fixes: 3a2d33d5a37c ("clientlog: refactor client record and API")
5 years agodoc: improve answer for chronyc error in FAQ
Miroslav Lichvar [Thu, 21 May 2020 10:42:20 +0000 (12:42 +0200)] 
doc: improve answer for chronyc error in FAQ

5 years agolocal: don't remove handlers in finalization
Miroslav Lichvar [Thu, 21 May 2020 09:47:38 +0000 (11:47 +0200)] 
local: don't remove handlers in finalization

Require all handlers to be deregistered by their users before the local
finalization.

5 years agotest: check logs for assertion failures
Miroslav Lichvar [Thu, 21 May 2020 09:45:38 +0000 (11:45 +0200)] 
test: check logs for assertion failures

5 years agonts: free client cert credentials when not used
Miroslav Lichvar [Thu, 21 May 2020 08:49:26 +0000 (10:49 +0200)] 
nts: free client cert credentials when not used

Destroy the client cert credentials when destroying the last NKC
instance instead of NKC_Finalise(). This allows the client to reload the
trusted cert file between NTS-KE sessions.

5 years agonts: add debug messages for gnutls init/deinit
Miroslav Lichvar [Thu, 21 May 2020 08:48:51 +0000 (10:48 +0200)] 
nts: add debug messages for gnutls init/deinit

5 years agontp: change NSR_RemoveSource() to accept IP address only
Miroslav Lichvar [Wed, 20 May 2020 16:06:43 +0000 (18:06 +0200)] 
ntp: change NSR_RemoveSource() to accept IP address only

Change the function to accept IP address alone to make it clear that the
port is ignored.

5 years agontp: refactor slot finding
Miroslav Lichvar [Wed, 20 May 2020 15:47:16 +0000 (17:47 +0200)] 
ntp: refactor slot finding

Change the find_slot() function to not match port and return the found
status directly. Add a separate function for matching both address and
port.

5 years agoconf: replace empty strings with NULL
Miroslav Lichvar [Wed, 20 May 2020 14:20:43 +0000 (16:20 +0200)] 
conf: replace empty strings with NULL

Avoid mixing empty strings with NULLs in configuration strings to make
the handling of default or disabled values consistent.

5 years agoreference: fix offset sign in log message
Miroslav Lichvar [Wed, 20 May 2020 10:53:16 +0000 (12:53 +0200)] 
reference: fix offset sign in log message

In the maxchange check, log the original offset instead of the absolute
value.

5 years agoclientlog: add debug message for maximum number of records
Miroslav Lichvar [Wed, 20 May 2020 10:14:59 +0000 (12:14 +0200)] 
clientlog: add debug message for maximum number of records

5 years agocmdmon: report new client and server statistics
Miroslav Lichvar [Wed, 20 May 2020 10:02:03 +0000 (12:02 +0200)] 
cmdmon: report new client and server statistics

Report the new clientlog data in the clients and serverstats reports.

Add -k option to the clients command to select between command and
NTS-KE data.

5 years agoclientlog: count authenticated NTP requests
Miroslav Lichvar [Wed, 20 May 2020 08:49:45 +0000 (10:49 +0200)] 
clientlog: count authenticated NTP requests

5 years agoclientlog: add NTS-KE service
Miroslav Lichvar [Tue, 19 May 2020 12:22:00 +0000 (14:22 +0200)] 
clientlog: add NTS-KE service

Instead of sharing the NTP rate limiting with NTS-KE, specify a new
service for NTS-KE and use it in the NTS-KE server.

Add ntsratelimit directive for configuration.

5 years agoclientlog: refactor client record and API
Miroslav Lichvar [Tue, 19 May 2020 11:45:31 +0000 (13:45 +0200)] 
clientlog: refactor client record and API

Refactor the client record and clientlog API to reuse more code between
different services and enumerate the services instead of hardcoding NTP
and cmdmon.

5 years agoclientlog: fix time_t variables
Miroslav Lichvar [Tue, 19 May 2020 10:02:28 +0000 (12:02 +0200)] 
clientlog: fix time_t variables

The last_hit and oldest_hit timestamps are uint32_t, not time_t.

5 years agostubs: add NSR_GetAuthReport()
Miroslav Lichvar [Wed, 20 May 2020 15:35:08 +0000 (17:35 +0200)] 
stubs: add NSR_GetAuthReport()

Fixes: 79c7384e5e47 ("cmdmon: add authdata command")
5 years agosys_linux: allow some *time64 syscalls in seccomp filter
Vincent Blut [Thu, 14 May 2020 17:05:14 +0000 (19:05 +0200)] 
sys_linux: allow some *time64 syscalls in seccomp filter

These are needed for 32-bit architectures with new system calls using
64-bit time_t.

5 years agosys_linux: restructure syscalls in seccomp filter
Vincent Blut [Thu, 14 May 2020 16:10:22 +0000 (18:10 +0200)] 
sys_linux: restructure syscalls in seccomp filter

Having one syscall per line improves the seccomp filter reading. It
should also make updates more straightforward.

5 years agocmdmon: add cookie length to authdata report
Miroslav Lichvar [Mon, 18 May 2020 12:21:53 +0000 (14:21 +0200)] 
cmdmon: add cookie length to authdata report