Miroslav Lichvar
224ab8ddb1
test: enable valgrind in more tests
2021-03-24 17:50:33 +01:00
Miroslav Lichvar
307c2ec70f
test: extend 106-refclock test
2021-03-18 17:41:36 +01:00
Miroslav Lichvar
cf3d976a68
test: extend ntp_sources unit test
2021-03-11 11:47:48 +01:00
Miroslav Lichvar
26fc28c056
test: drop logging suspension
...
Instead of selectively suspending logging by redirecting messages to
/dev/null, increase the default minimum log severity to FATAL. In the
debug mode, all messages are printed.
2021-03-11 11:47:31 +01:00
Miroslav Lichvar
c61ddb70da
test: extend util unit test
2021-03-04 17:26:00 +01:00
Miroslav Lichvar
9339766bfe
test: use env shebang in all bash scripts
...
This allows the scripts to be executed on systems that don't have bash
in /bin. This fixes "make check".
2021-03-04 12:36:36 +01:00
Miroslav Lichvar
f60410016a
test: extend 007-cmdmon system test
2021-03-04 12:36:36 +01:00
Miroslav Lichvar
d898bd246b
test: extend 139-nts test
2021-02-18 17:44:04 +01:00
Miroslav Lichvar
ebf0ff2c0d
cmdmon: set certset for new sources
...
Add the new certset option to the cmdmon protocol.
2021-02-18 17:44:04 +01:00
Miroslav Lichvar
6615bb1b78
nts: add support for multiple sets of trusted certificates
...
Modify the session, NTS-KE, and NTS-NTP code to support multiple sets of
trusted certificates and identify the sets by a 32-bit ID.
2021-02-18 17:44:04 +01:00
Miroslav Lichvar
316d47e3b4
nts: allow multiple files with trusted certificates
...
Allow the ntstrustedcerts directive to be specified multiple times.
2021-02-11 16:13:39 +01:00
Miroslav Lichvar
90557cf1ba
nts: allow multiple server keys and certificates
...
Allow the ntsservercert and ntsserverkey directives to be specified
multiple times to enable the NTS-KE server to operate under multiple
names.
2021-02-11 16:13:39 +01:00
Miroslav Lichvar
80e627c86b
nts: define type for credentials
...
Add a NKSN_Credentials type to avoid referring to it as void *.
2021-02-11 16:13:39 +01:00
Miroslav Lichvar
0e4995e10b
nts: split creating server and client credentials
2021-02-11 16:13:39 +01:00
Miroslav Lichvar
c1d56ede3f
nts: rework update of NTP server address
...
In the NTS-NTP client instance, maintain a local copy of the NTP address
instead of using a pointer to the NCR's address, which may change at
unexpected times.
Also, change the NNC_CreateInstance() to accept only the NTP port to
make it clear the initial NTP address is the same as the NTS-KE address
and to make it consistent with NNC_ChangeAddress(), which accepts only
one address.
2021-02-11 09:52:57 +01:00
Miroslav Lichvar
cf6af112e1
test: extend 129-reload test
2021-02-04 17:48:51 +01:00
Miroslav Lichvar
1a8dcce84f
sources: update stratum with leap status
...
Remove stratum from the NTP sample and update it together with the leap
status. This enables a faster update when samples are dropped by the NTP
filters.
2021-02-04 17:43:47 +01:00
Miroslav Lichvar
362d7c517d
test: improve NTS tests
2021-01-14 18:17:48 +01:00
Miroslav Lichvar
82ddc6a883
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.
2021-01-14 18:17:48 +01:00
Miroslav Lichvar
624b76e86e
test: fix port selection to disable grep output
2021-01-14 18:17:48 +01:00
Miroslav Lichvar
4dd0aece02
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>
2021-01-14 18:17:48 +01:00
Miroslav Lichvar
1494ef1df3
test: improve sources unit test
2020-10-05 18:56:37 +02:00
Miroslav Lichvar
698f270b5b
cmdmon: add leap status to selectdata report
2020-10-05 18:56:37 +02:00
Miroslav Lichvar
df43ebe9e0
test: make 007-cmdmon test more reliable
2020-10-01 12:58:17 +02:00
Miroslav Lichvar
944cf6e318
util: fix UTI_BytesToHex() to handle zero-length input
2020-10-01 12:58:17 +02:00
Miroslav Lichvar
de752b28de
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.
2020-10-01 12:58:17 +02:00
Miroslav Lichvar
455b8e4b44
test: include CMAC keys in ntp_core unit test
2020-09-23 15:10:43 +02:00
Miroslav Lichvar
cc535632d1
test: add ntp_auth unit test
2020-09-16 11:15:29 +02:00
Miroslav Lichvar
cb8ee57b9e
test: fix ntp_core unit test
...
Fix setting of key_id in the response.
Fixes: f6625717cd
("test: improve ntp_core unit test")
2020-09-16 11:15:16 +02:00
Miroslav Lichvar
f6625717cd
test: improve ntp_core unit test
2020-09-10 13:32:39 +02:00
Miroslav Lichvar
fdfcabd79b
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.
2020-09-10 13:31:57 +02:00
Miroslav Lichvar
2bb88b45c6
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.
2020-09-10 09:36:35 +02:00
Miroslav Lichvar
ff466439fc
configure: fix building with -NTP -CMDMON +SCFILTER
...
Don't enable privileged operations using the nameserv code unless
NTP is enabled.
2020-09-10 09:36:35 +02:00
Bryan Christianson
bd3b36865e
test: extend frequency in ntp_adjtime() test
...
Extend the frequency range in the test to cover negative frequencies.
2020-08-31 10:17:21 +02:00
Miroslav Lichvar
9d88c028e2
test: fix cookie length in nts_ke_client unit test
2020-08-25 11:49:44 +02:00
Miroslav Lichvar
4cf6b29397
test: fix 102-hwtimestamp test for new ethtool
...
New ethtool using netlink messages has a different output.
2020-08-20 16:19:13 +02:00
Miroslav Lichvar
571359b366
test: extend 110-chronyc test
2020-08-20 13:27:53 +02:00
Miroslav Lichvar
0f009e7718
test: extend 007-cmdmon system test
2020-08-20 13:27:53 +02:00
Miroslav Lichvar
24effd7340
test: add 105-nts system test
2020-08-20 13:27:53 +02:00
Miroslav Lichvar
5289fc5f80
test: add 009-binddevice system test
2020-08-20 13:27:53 +02:00
Miroslav Lichvar
ca49304bd6
test: add 008-confload system test
2020-08-20 13:27:53 +02:00
Miroslav Lichvar
97a8b1e43b
test: fix random failures in nts_ntp_client unit test
...
Fixes: 18d9243eb9
("test: improve NTS unit tests")
2020-08-17 16:28:36 +02:00
Miroslav Lichvar
aeee1feda6
test: improve siv unit test
2020-08-13 16:37:38 +02:00
Miroslav Lichvar
18d9243eb9
test: improve NTS unit tests
2020-08-13 16:37:38 +02:00
Miroslav Lichvar
1aa4827b3b
test: extend 139-nts test
2020-08-13 16:37:38 +02:00
Miroslav Lichvar
32fb8d41ca
test: fix compiler warning in ntp unit test
2020-08-04 12:24:51 +02:00
Miroslav Lichvar
cc007ad93b
test: improve nts_ntp_client unit test
2020-07-28 12:48:23 +02:00
Miroslav Lichvar
72bf3d26eb
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).
2020-07-23 15:53:24 +02:00
Miroslav Lichvar
cc20ead3dc
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.
2020-07-20 16:52:46 +02:00
Miroslav Lichvar
66e097e3e6
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.
2020-07-16 16:02:08 +02:00