]> git.ipfire.org Git - thirdparty/chrony.git/log
thirdparty/chrony.git
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.

4 years agocmdmon: fix data field name in handle_ntp_source_name()
Miroslav Lichvar [Wed, 12 Aug 2020 13:59:16 +0000 (15:59 +0200)] 
cmdmon: fix data field name in handle_ntp_source_name()

Fixes: 93f6358916ca ("cmdmon: add request to get source name")
4 years agosocket: improve code
Miroslav Lichvar [Tue, 11 Aug 2020 15:07:14 +0000 (17:07 +0200)] 
socket: improve code

Add more assertions and other checks, and improve coding style a bit.

4 years agontp: fix comments
Miroslav Lichvar [Mon, 10 Aug 2020 14:22:19 +0000 (16:22 +0200)] 
ntp: fix comments

Fix typos and remove an obsolete comment.

4 years agontp: reuse pool IDs for new pools
Miroslav Lichvar [Mon, 10 Aug 2020 10:14:42 +0000 (12:14 +0200)] 
ntp: reuse pool IDs for new pools

When adding a new pool, reuse unused pool IDs to avoid increasing the
pools array.

5 years agontp: rename pool fields to pool_id
Miroslav Lichvar [Mon, 10 Aug 2020 09:54:43 +0000 (11:54 +0200)] 
ntp: rename pool fields to pool_id

Rename the pool fields holding the ID of the pool to avoid confusion
with the pool record and pool flag.

5 years agoexamples: add leapsecmode to chrony.conf examples
Miroslav Lichvar [Tue, 4 Aug 2020 13:42:59 +0000 (15:42 +0200)] 
examples: add leapsecmode to chrony.conf examples

5 years agoclient: add missing option to help message
Miroslav Lichvar [Tue, 4 Aug 2020 11:04:04 +0000 (13:04 +0200)] 
client: add missing option to help message

5 years agotest: fix compiler warning in ntp unit test
Miroslav Lichvar [Mon, 3 Aug 2020 17:10:49 +0000 (19:10 +0200)] 
test: fix compiler warning in ntp unit test

5 years agoutil: fix compiler warning
Miroslav Lichvar [Mon, 3 Aug 2020 16:56:20 +0000 (18:56 +0200)] 
util: fix compiler warning

Replace the snprintf() call with memcpy() in UTI_PathToDir() to make it
clear a truncated string is expected.

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