mirror of
https://gitlab.com/chrony/chrony.git
synced 2026-01-20 21:00:20 -05:00
ntp: avoid truncation of NTPv4 MACs by default
If the MAC in NTPv4 requests would be truncated, use version 3 by default to avoid the truncation. This is necessary for compatibility with older chronyd servers, which do not respond to messages with truncated MACs.
This commit is contained in:
16
keys.c
16
keys.c
@@ -322,6 +322,22 @@ KEY_GetAuthDelay(uint32_t key_id)
|
||||
|
||||
/* ================================================== */
|
||||
|
||||
int
|
||||
KEY_GetAuthLength(uint32_t key_id)
|
||||
{
|
||||
unsigned char buf[MAX_HASH_LENGTH];
|
||||
Key *key;
|
||||
|
||||
key = get_key_by_id(key_id);
|
||||
|
||||
if (!key)
|
||||
return 0;
|
||||
|
||||
return HSH_Hash(key->hash_id, buf, 0, buf, 0, buf, sizeof (buf));
|
||||
}
|
||||
|
||||
/* ================================================== */
|
||||
|
||||
int
|
||||
KEY_CheckKeyLength(uint32_t key_id)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user