Re: [IPsec] What's the most reasonable way for the responder to handle the request containing unknown Key Exchange methods

"Panwei (William)" <william.panwei@huawei.com> Tue, 06 February 2024 09:23 UTC

Return-Path: <william.panwei@huawei.com>
X-Original-To: ipsec@ietfa.amsl.com
Delivered-To: ipsec@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 23C22C14F60F for <ipsec@ietfa.amsl.com>; Tue, 6 Feb 2024 01:23:32 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.906
X-Spam-Level:
X-Spam-Status: No, score=-1.906 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_BLOCKED=0.001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01] autolearn=ham autolearn_force=no
Received: from mail.ietf.org ([50.223.129.194]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id YvNr75TkD9CP for <ipsec@ietfa.amsl.com>; Tue, 6 Feb 2024 01:23:30 -0800 (PST)
Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id AEBBCC14F5F7 for <ipsec@ietf.org>; Tue, 6 Feb 2024 01:23:29 -0800 (PST)
Received: from mail.maildlp.com (unknown [172.18.186.231]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4TTd4r59JPz6K5kj; Tue, 6 Feb 2024 17:20:12 +0800 (CST)
Received: from lhrpeml500005.china.huawei.com (unknown [7.191.163.240]) by mail.maildlp.com (Postfix) with ESMTPS id 83CDE1408F9; Tue, 6 Feb 2024 17:23:27 +0800 (CST)
Received: from kwepemi500010.china.huawei.com (7.221.188.191) by lhrpeml500005.china.huawei.com (7.191.163.240) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Tue, 6 Feb 2024 09:23:26 +0000
Received: from kwepemi500010.china.huawei.com (7.221.188.191) by kwepemi500010.china.huawei.com (7.221.188.191) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Tue, 6 Feb 2024 17:23:25 +0800
Received: from kwepemi500010.china.huawei.com ([7.221.188.191]) by kwepemi500010.china.huawei.com ([7.221.188.191]) with mapi id 15.01.2507.035; Tue, 6 Feb 2024 17:23:25 +0800
From: "Panwei (William)" <william.panwei@huawei.com>
To: Paul Wouters <paul@nohats.ca>
CC: "ipsec@ietf.org" <ipsec@ietf.org>
Thread-Topic: [IPsec] What's the most reasonable way for the responder to handle the request containing unknown Key Exchange methods
Thread-Index: AdpYNcfe9ZYfZMnUS7SS4j6Mdob8o///2a+A//6Kn/A=
Date: Tue, 06 Feb 2024 09:23:25 +0000
Message-ID: <7a226816f8d546afb59011f0ab3f739a@huawei.com>
References: <5e48af661d63445794b649649519ea65@huawei.com> <9d92f51b-0d9f-e43d-3392-bf9887befa3e@nohats.ca>
In-Reply-To: <9d92f51b-0d9f-e43d-3392-bf9887befa3e@nohats.ca>
Accept-Language: zh-CN, en-US
Content-Language: zh-CN
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-originating-ip: [10.164.106.52]
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
MIME-Version: 1.0
Archived-At: <https://mailarchive.ietf.org/arch/msg/ipsec/kW1Wr99Uua5M6rP_T0imerHdW2k>
Subject: Re: [IPsec] What's the most reasonable way for the responder to handle the request containing unknown Key Exchange methods
X-BeenThere: ipsec@ietf.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: Discussion of IPsec protocols <ipsec.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/ipsec>, <mailto:ipsec-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/ipsec/>
List-Post: <mailto:ipsec@ietf.org>
List-Help: <mailto:ipsec-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/ipsec>, <mailto:ipsec-request@ietf.org?subject=subscribe>
X-List-Received-Date: Tue, 06 Feb 2024 09:23:32 -0000

Hi Paul,

Thank you very much for your feedback. I'm happy to see my thoughts are in line with you experts.


    > > The latter sentence indicates that the responder can continue the
    > > negotiation when the KE method in the KE payload is unknown and just
    > needs to reply INVALID_KE_PAYLOAD with the correct KE method.
    > 
    > No, it cannot "continue". INVALID_KE_PAYLOAD is an errror. If this is sent in
    > the IKE_SA_INIT reply, the responder isn't even expected to keep any state.
    > The initiator has to "start from scratch" using a different KE method. The
    > responder responds "from scratch" to that message.

Yes, you're right. I misused the word, "continue" isn't the right expression. I just want to say "the responder should reply INVALID_KE_PAYLOAD and shouldn't terminate without reply".

Regards & Thanks!
Wei PAN (潘伟)

    > -----Original Message-----
    > From: Paul Wouters <paul@nohats.ca>
    > Sent: Tuesday, February 6, 2024 3:01 AM
    > To: Panwei (William) <william.panwei@huawei.com>
    > Cc: ipsec@ietf.org
    > Subject: Re: [IPsec] What's the most reasonable way for the responder to
    > handle the request containing unknown Key Exchange methods
    > 
    > On Mon, 5 Feb 2024, Panwei (William) wrote:
    > 
    > > Regarding how the responder handles the request containing the new
    > Key
    > > Exchange methods (old name was DH
    > > Group) that it doesnʼt understand, Iʼve had a discussion with someone,
    > > but we failed to agree with each other due to different interpretations of
    > RFC 7296. Iʼd like to hear more opinions from you experts.
    > >
    > > The handling I suggest is as follows:
    > >
    > >     1) if all KE methods proposed by the initiator are unknown to the
    > > responder, i.e., no KE method is acceptable, then the responder replies
    > NO_PROPOSAL_CHOSEN, no matter what KE method is used in the KE
    > payload.
    > >
    > >     2) if at least one acceptable KE method is included in the
    > > initiatorʼs proposals, the responder can select one acceptable KE method,
    > ignore the unknown KE methods, and perform the next step of KE Payload
    > processing.
    > >
    > >        2.1) if the KE method used in the KE payload happens to be the
    > > same as this selected KE method, then the responder normally replies
    > with this selected KE method and the corresponding KE payload.
    > >
    > >        2.2) if the KE method used in the KE payload is different from
    > > this selected KE method, then the responder replies
    > INVALID_KE_PAYLOAD
    > > with this selected KE method, regardless of whether the KE method used
    > in the KE payload is known or unknown to the responder.
    > 
    > that is correct. Note that the INVALID_KE_PAYLOAD can also contain the KE
    > method(s) the responder is willing to use.
    > 
    > > This paragraph indicates that the responder should ignore the unknown
    > > KE methods in the SA payload because the new KE methods can be
    > considered as new Transform Attributes.
    > 
    > Yes, it should ignore unknown KEs. This allows newer software/versions to
    > attempt newer KEs without breaking with older implementations that do
    > not support the newer KEs.
    > 
    > >    If the responder selects a
    > >
    > >    proposal using a different Diffie-Hellman group (other than NONE),
    > >
    > >    the responder will indicate the correct group in the response and
    > > the
    > >
    > >    initiator SHOULD pick an element of that group for its KE value
    > > when
    > >
    > >    retrying the first message.
    > 
    > I guess that SHOULD is a little odd. It really means "it should pick one from
    > the responder list, that falls within its own local policy as valid to use,
    > otherwise it must terminate the connection".
    > 
    > > This paragraph indicates that the initiator can suggest a KE method
    > > regardless of whether it is known to the responder.
    > 
    > IKE assumes both peers do not know each others capabilities before the
    > negotiation starts.
    > 
    > > The latter sentence indicates that the responder can continue the
    > > negotiation when the KE method in the KE payload is unknown and just
    > needs to reply INVALID_KE_PAYLOAD with the correct KE method.
    > 
    > No, it cannot "continue". INVALID_KE_PAYLOAD is an errror. If this is sent in
    > the IKE_SA_INIT reply, the responder isn't even expected to keep any state.
    > The initiator has to "start from scratch" using a different KE method. The
    > responder responds "from scratch" to that message.
    > 
    > > However, others suggest that the responder should terminate the IKE
    > > exchange without reply, when the KE method used in the KE payload is
    > > unknown to the responder, even if there are other acceptable KE methods
    > proposed in the SA payload.
    > 
    > One must NEVER terminate without sending a reply. Doing so only causes
    > the initiator to retransmit its packet, thinking the packet was dropped.
    > It will only make things worse. Always reply. But in the case of
    > INVALID_KE_PAYLOAD, the responder can get away with not keeping (or
    > even
    > creating) state.
    > 
    > > Because they feel the unknown KE method in the KE payload means that
    > > the whole packet is an invalid packet, and discarding this packet is the
    > thing to do.
    > 
    > That is wrong :)
    > 
    > Paul