mirror of
https://gitlab.com/chrony/chrony.git
synced 2025-12-03 16:45:07 -05:00
cmdparse: don't allow NTP key ID of 0
Key number 0 is used as inactive key, prevent the user from inadvertently not using authentication.
This commit is contained in:
@@ -134,7 +134,8 @@ CPS_ParseNTPSourceAdd(char *line, CPS_NTP_Source *src)
|
||||
line += n;
|
||||
}
|
||||
} else if (!strcasecmp(cmd, "key")) {
|
||||
if (sscanf(line, "%lu%n", &src->params.authkey, &n) != 1) {
|
||||
if (sscanf(line, "%lu%n", &src->params.authkey, &n) != 1 ||
|
||||
src->params.authkey == INACTIVE_AUTHKEY) {
|
||||
result = CPS_BadKey;
|
||||
ok = 0;
|
||||
done = 1;
|
||||
|
||||
Reference in New Issue
Block a user