mirror of
https://gitlab.com/chrony/chrony.git
synced 2025-12-03 22:45:07 -05:00
keys: warn about short key only if used by source
After restricting authentication of servers and peers to the specified key, a short key in the key file is a security problem from the client's point of view only if it's specified for a source.
This commit is contained in:
@@ -497,8 +497,13 @@ NCR_GetInstance(NTP_Remote_Address *remote_addr, NTP_Source_Type type, SourcePar
|
||||
result->do_auth = 1;
|
||||
result->auth_key_id = params->authkey;
|
||||
if (!KEY_KeyKnown(result->auth_key_id)) {
|
||||
LOG(LOGS_WARN, LOGF_NtpCore, "Source %s added with unknown key %"PRIu32,
|
||||
UTI_IPToString(&result->remote_addr.ip_addr), result->auth_key_id);
|
||||
LOG(LOGS_WARN, LOGF_NtpCore, "Key %"PRIu32" used by source %s is %s",
|
||||
result->auth_key_id, UTI_IPToString(&result->remote_addr.ip_addr),
|
||||
"missing");
|
||||
} else if (!KEY_CheckKeyLength(result->auth_key_id)) {
|
||||
LOG(LOGS_WARN, LOGF_NtpCore, "Key %"PRIu32" used by source %s is %s",
|
||||
result->auth_key_id, UTI_IPToString(&result->remote_addr.ip_addr),
|
||||
"too short");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user