RE: RE: Can we deny non-NTS client?

"Akihiko.Izumi-7U/[email protected]" <Akihiko.Izumi-7U/[email protected]>
Newsgroups gmane.comp.time.chrony.user
Message-ID <OSBPR01MB2549EDAEC4D782367C6DD62494C19@OSBPR01MB2549.jpnprd01.prod.outlook.com>
> The response is sent only if it's not longer than the request. In the source code it's in the transmit_packet() function in ntp_core.c:

I looked the transmit_packet() function and it seems to be called at sending every NTP request/response.
I feel that's good and safe implementation. Thank you.

> > RFC8915 describes "8.7. NTS Stripping". Isn't is applicable to Chrony?
> chronyd as an NTP client configured with the "nts" option ignores unauthenticated responses.

When chronyd failed NTS-KE handshake (ex. mis-configuration of certificate), does chronyd fallback to plain NTP (or not)?
(If it is true, I afraid dedicated NTS server/client may use plain NTP unintentionally.)

Best Regards,

-----Original Message-----
From: Miroslav Lichvar <[email protected]> 
Sent: Wednesday, January 11, 2023 6:54 PM
To: [email protected]
Subject: Re: [chrony-users] RE: Can we deny non-NTS client?

On Wed, Jan 11, 2023 at 02:31:11AM +0000, Akihiko.Izumi-7U/[email protected] wrote:
> Thank you for clarifying my question. I learned a lot.
> 
> > it would not be sent as there is an additional check made before transmission comparing the length of the request and response.
> 
> What comparison is done between the length of the request and response?

The response is sent only if it's not longer than the request. In the source code it's in the transmit_packet() function in ntp_core.c:

  if (request_info && request_info->length < info.length) {
    DEBUG_LOG("Response longer than request req_len=%d res_len=%d",
              request_info->length, info.length);
    return 0;
  }


> > If the NTP server didn't respond to unauthenticated NTP requests, it couldn't respond with NTS NAK to indicate the client it has expired cookies.
> 
> I understand.
> I think sending NTS NAK is necessary for mis-authenticated NTP packets, but not necessary for plain NTP packets.
> Is my understanding correct?

Right. NTS NAK is sent only if the request contains the NTS-specific extension fields and the authenticator is not valid (most likely due to the client using an old cookie, which the server can no longer decrypt).
> 
> I have another question.
> RFC8915 describes "8.7. NTS Stripping". Isn't is applicable to Chrony?

chronyd as an NTP client configured with the "nts" option ignores unauthenticated responses. An NTS NAK is accepted only if no valid authenticated response is received in the polling interval, i.e. an off-path attacker cannot trigger a new NTS-KE session unless there is a packet loss between the server and client, or the server cannot respond to all requests (e.g. due to rate limiting).

--
Miroslav Lichvar


-- 
To unsubscribe email chrony-users-request-kWFZVVI9zxvPqho9SqqRMmD2FQJk+8+b@public.gmane.org 
with "unsubscribe" in the subject.
For help email chrony-users-request-kWFZVVI9zxvPqho9SqqRMmD2FQJk+8+b@public.gmane.org 
with "help" in the subject.
Trouble?  Email [email protected]


-- 
To unsubscribe email chrony-users-request-kWFZVVI9zxvPqho9SqqRMmD2FQJk+8+b@public.gmane.org 
with "unsubscribe" in the subject.
For help email chrony-users-request-kWFZVVI9zxvPqho9SqqRMmD2FQJk+8+b@public.gmane.org 
with "help" in the subject.
Trouble?  Email [email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.