Re: [IPsec] Shepherd review of the draft-ietf-ipsecme-add-ike

Tero Kivinen <kivinen@iki.fi> Tue, 31 January 2023 13:31 UTC

Return-Path: <kivinen@iki.fi>
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 587C1C1516E3; Tue, 31 Jan 2023 05:31:12 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.1
X-Spam-Level:
X-Spam-Status: No, score=-2.1 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, NICE_REPLY_A=-0.001, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=iki.fi
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 bZLUjNHy9WM3; Tue, 31 Jan 2023 05:31:07 -0800 (PST)
Received: from lahtoruutu.iki.fi (lahtoruutu.iki.fi [185.185.170.37]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 3AB19C14CE2D; Tue, 31 Jan 2023 05:31:05 -0800 (PST)
Received: from fireball.acr.fi (fireball.acr.fi [83.145.195.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: kivinen@iki.fi) by lahtoruutu.iki.fi (Postfix) with ESMTPSA id 2E9B11B00332; Tue, 31 Jan 2023 15:31:02 +0200 (EET)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=lahtoruutu; t=1675171862; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=WpLxUkwdlO7MvlKNob/sZZ7T0NdkDSISArgjbY23uXE=; b=LXkawVFn49++aGTDC0P4aLcYO2+rc8/3X2XjF/LELS5X4WHifkrC4FlYk3i2c60f0lsfFE uY06NbNcs0IpUEof19moBFDR8p5HPWMcdwebrvuEczr0oeGgISucgUKZEIh6lmRdWVCeS1 MbfLUaVjT4bL4fkvWsvWM3udcqqZDcleI7cL5W1G/u0LVNtiANj0BVr2FHbtRCQM1nrQ1+ Ne9VR5i4Qo3Lgs2W+DN/3Xx2mz+R6pcMqFHm8Y3GGGN/wzKLuZFSs3nufsRrxzQ4Eq7y6P ObNU/pq6PK1fNk3kgkkHJXaBBuqi2VrtbywodzOjcasbzNYGweoNu2d8lDpjgA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=lahtoruutu; t=1675171862; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=WpLxUkwdlO7MvlKNob/sZZ7T0NdkDSISArgjbY23uXE=; b=Ipt9KNSisNIbCB6sRnJAyezSCpS4dAla7a2PdeTUiuMGTg9mq8eh32ei7TcR/UTIlG56gM HlNEUmU9+EkWvcyv2UJkW1l3BPRFlDbqcDzHhUlm1rKR9Ltvzzl3ygSHiyzXSLEqB4XymT 7dQTPKY0O8FPpu6vR8YQkYsxbX0IDG19Do//Sxtqua4UFpg89sOruHFNM/iIvXrDK6GPzP fiIrQXK9z6jVniyCWof0wZ99so15WifKQfYbkaChwzvrCesf8OMNmR6+3zXv4X1f1WUEw9 qcb1gk+8bvUqRPuCvIbecvic02awXaes0DKLhGuaCBskdQvyWlWujhUYqkpVfQ==
ARC-Authentication-Results: i=1; ORIGINATING; auth=pass smtp.auth=kivinen@iki.fi smtp.mailfrom=kivinen@iki.fi
ARC-Seal: i=1; s=lahtoruutu; d=iki.fi; t=1675171862; a=rsa-sha256; cv=none; b=Wg57BAJlEKPB9vcHtBoXu2O6FX+lsBHeCguxmG8PEg+tdFIGyoeukGIsTxu/UZ1fNcdVPM sLYHB3p2ZKs4NjhqQxiXCdHn4hCSGU0IbXJ7vuXLGfaTsYjb/xRoMLlkA3U9q+jLOWDTQV /DO6gncirK9h6aFHOCEEeuPgSwE/2USrj2fczcpeX3belncWox+0Oa1IKZW+T2PRXP/RE/ RF5RjWX4HWmSk8zee3ZTYyTvz1xPU9jB2AJl6Lyo28JYdaJi3WG23R0RtzJ34xO+dxewmP 07Yau6Utqz98FSLznWO2gXdBjfSQeZNohd0I1brh62hCvSP0R4Gpo25u/K6nWA==
Received: by fireball.acr.fi (Postfix, from userid 15204) id 8DAB125C1300; Tue, 31 Jan 2023 15:31:01 +0200 (EET)
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Message-ID: <25561.6165.517900.737387@fireball.acr.fi>
Date: Tue, 31 Jan 2023 15:31:01 +0200
From: Tero Kivinen <kivinen@iki.fi>
To: Valery Smyslov <smyslov.ietf@gmail.com>
Cc: draft-ietf-ipsecme-add-ike@ietf.org, ipsec@ietf.org
In-Reply-To: <013a01d9354c$c1fe37b0$45faa710$@gmail.com>
References: <25560.18262.145478.996578@fireball.acr.fi> <013a01d9354c$c1fe37b0$45faa710$@gmail.com>
X-Mailer: VM 8.2.0b under 26.3 (x86_64--netbsd)
X-Edit-Time: 24 min
X-Total-Time: 27 min
Archived-At: <https://mailarchive.ietf.org/arch/msg/ipsec/T-N7jq70cDasV9LFDAOeK_i9lXg>
Subject: Re: [IPsec] Shepherd review of the draft-ietf-ipsecme-add-ike
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, 31 Jan 2023 13:31:12 -0000

Valery Smyslov writes:
> > In section 3.2 it is not clear what the length of the Hash Algorithm
> > Identifiers fields is. It contains list of hash algorithms or one hash
> > algorithm if this is response, but it is not clear what is response.
> 
> What was meant is that a list of hashes is sent by a client (in
> CFG_REQUEST) and a single hash is sent by a server (in CFG_REPLY).

Yes, and I think it is easier to understand if we have two figures,
one for the CFG_REQUEST and another for CFG_REPLY/CFG_SET. 

> > We have CFG_REQUEST, CFG_REPLY, CFG_SET, and CFG_ACK. Most likely
> > CFG_REPLY and CFG_ACK are sent in IKE exchange response. On the other
> > hand CFG_SET is usually used to set the parameters, thus the
> > Certificate Digest would be required there.
> 
> True, but IKEv2 doesn't currently use CFG_SET/CFG_ACK and
> it explicitly allows implementations to ignore them.

True, but you do include some text in some places about the CFG_ACK
for example, so for completeness it would be good to define them in
same way than RFC7296 does.

I.e., CFG_SET is same as CFG_REPLY, and CFG_ACK is always empty (i.e.,
length = 0, and no other fields after that).

> >                         1                   2                   3
> >     0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
> >    +-+-----------------------------+-------------------------------+
> >    |R|         Attribute Type      |            Length             |
> >    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
> > 
> >      Figure 4: ENCDNS_DIGEST_INFO Attribute Format for CFG_ACK.
> > 
> > and then explain the Hash Algorithm Identifier and List of Hash
> > Algorithm Identifiers separately.
> 
> We may do this for completeness, but as I've already mentioned
> CFG_SET/CFG_ACK are not currently used in IKEv2. So I'm in not sure
> if this is really needed and won't further confuse implementers...

I think first two ones are needed, the last one can be left out and
simply say in length definition that it is zero for CFG_ACK, just like
you do for ENCDNS_IP*.

> > Actually is there any point of having ADN Length and Authenticated
> > Domain Name in CFG_REQUESTS ever? Why would someone calculate hashes
> > with certain domain names with different hash algorithms? Perhaps we
> > should define the format for CFG_REQUEST as follows:
> > 
> > 
> >                         1                   2                   3
> >     0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
> >    +-+-----------------------------+-------------------------------+
> >    |R|         Attribute Type      |            Length             |
> >    +-------------------------------+-------------------------------+
> >    ~              List of Hash Algorithm Identifiers               ~
> >    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
> > 
> >      Figure 3: ENCDNS_DIGEST_INFO Attribute Format for CFG_REQUEST
> 
> I'm confused, since CFG_REQUEST doesn't include Digest.
> Am I missing your point?

Thats the point. As the CFG_REQUEST does not include Certificate
Digest, it only includes list of hash algorithms, there is no point of
having Authentication Domain Name there either. So the ADN Length of
CFG_REQUEST will always be zero, and Authentication Domain Name is
omitted, but then we could simply omit the RESERVED and ADN Length
fields also for more optimal encoding. I.e., if as we already have
different format for CFG_REQUEST and CFG_REPLY/CFG_SET then making
them even more different does not matter.

If we want to keep the format same for all CFG_* then we need to
format this payload as follows:


                        1                   2                   3
    0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
   +-+-----------------------------+-------------------------------+
   |R|         Attribute Type      |            Length             |
   +-+-----------------------------+---------------+---------------+
   |            RESERVED           | Num Hash Algs |  ADN Length   |
   +-----------------------------------------------+---------------+
   ~                  Authentication Domain Name                   ~
   +---------------------------------------------------------------+
   ~                  Hash Algorithm Identifiers                   ~
   +---------------------------------------------------------------+
   ~                     Certificate Digest                        ~
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+


Where for CFG_REQUEST the Num Hash Algs tells how many hash algorithms
there are in the Hash Algorithm Identifiers list, and ADN Length will
be zero, and Authentication Domain Name and Certificate Digest are
omitted.

For CFG_REPLY/CFG_SET the Num Hash Algs MUST be one, and Hash
Algoritms Identifiers includes exactly one hash algorithm identifier
which is used to calculate the Certificate Digest.

With this payload format the decoder for this configuration payload
attribute does not need to know the type of the Configuration Payload
CFG Type, it can decode and encode the payload without knowing that
information, and the actual code that fills or uses them can then do
checking whether they have suitable fields set to suitable values.

But either one of those ways is fine, I would assume you as an
implementor has more preference which one is nicer than we others who
most likely will not do implementation of this.

> > I would prefer the SPKI (Subject Public Key Info) selector field way
> > of RFC7671, as then it does not matter if the certificate is renewed
> > etc.
> 
> Does certificate renewal matter in this case?

Not really, but for TLSA certificates I have been mostly using SPKI
and when I need to renew certificate because it expired, I will simply
reuse the private/public key and generate new certificate, and as I am
using SPKI I do not need to update my dns zone when I do that. I would
assume I am not alone in this situation, but I have no idea what will
be the operational practices for these certificates.

Both full certificate and SPKI digest allow checking that key is
correct, but full certificate digest might get broken in case there is
different certificates in the VPN gateway and the DNS server (i.e.,
DNS server hash renewed its certificate with same public key, but this
has not yet been migrated to the configuration of the VPN gateway). 

> > I do not think the [Hash] is normative reference. I did not need to
> > read and understand that to somewhat understand this document :-)
> 
> Well, it's only 58 words including title, you may read them in few
> seconds :-) Kidding aside, how this can be informative? The document
> uses these codepoints.

I usually have been considered things to normative if you need to read
and understand to be able to implement the protocol. In most of the
cases the information in IANA registries are already in the normative
reference RFCs, thus having normative reference to one iana registry 
is not needed. The reason I pointed this out is because the ID nits
complained about possible downref for having normative reference to
non-rfc document...
-- 
kivinen@iki.fi