Re: [CFRG] IRSG review draft-irtf-cfrg-spake2-20

Watson Ladd <watsonbladd@gmail.com> Wed, 08 September 2021 20:39 UTC

Return-Path: <watsonbladd@gmail.com>
X-Original-To: cfrg@ietfa.amsl.com
Delivered-To: cfrg@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id BD9D13A3746 for <cfrg@ietfa.amsl.com>; Wed, 8 Sep 2021 13:39:40 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.099
X-Spam-Level:
X-Spam-Status: No, score=-2.099 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, FREEMAIL_FROM=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=gmail.com
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 8nKPju9dI0RH for <cfrg@ietfa.amsl.com>; Wed, 8 Sep 2021 13:39:36 -0700 (PDT)
Received: from mail-io1-xd2c.google.com (mail-io1-xd2c.google.com [IPv6:2607:f8b0:4864:20::d2c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 977F93A3742 for <cfrg@ietf.org>; Wed, 8 Sep 2021 13:39:36 -0700 (PDT)
Received: by mail-io1-xd2c.google.com with SMTP id b7so5008574iob.4 for <cfrg@ietf.org>; Wed, 08 Sep 2021 13:39:36 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=lNhUoKhx5YO6rKZSBSrQfGoC1lGrlbIAAk1SB2e/zAI=; b=SX+M5++Fw7u7GW5C3GUSfTh0pJ4E58w+fW1EuNqyRkx4TmyQW1fqFTfoaB7UTALO8r 2m+4yFe1s9xK2gDxCDTMxuOi7BgnltpsSeYxjg2oMc0tfwzwkmKLpTR7Pm/ay3AXEXH5 yLGSTXn70QGUGx0eptYfFOElQMymmN0x2Mj610AoD0Qh20nNcKuaOLU9qWrudbPAIBYc BmRPFeuyXi+H69qnY0ALUcH8VAZR457mCHjaF0BjJDOkr91c+jIj84Es8Zt9w8nugdyS FwkYmQi6M+Een+KnOqbSJqFhFOvJSrvRK/PH3Mfy9517VIKrDsSrOP0JIhnZ8iqa3gZ8 6+7Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=lNhUoKhx5YO6rKZSBSrQfGoC1lGrlbIAAk1SB2e/zAI=; b=ULxMjcaIVo4HIYc19fUSqdpIio5+y+x2x+WBRdwskKS+vdO+eUcsw4gJzzuvXwSDPX tIHYjwEju6Nwxd84NWF7ChfCda93xHZ2jtg9/f3K2kplSLWDWYbYfWktwhQ2W2mhLiBB 2Xh4JTu06g8dM+EVAshd7Vt4Rv3clfV0uj3QkrZFImYpeB+vCr/B0steoL3t9oywWTDA gNeIgwxSwqq7sS8AP/gg1EqM5VdH+ppjASF7a2AzSUrCpLh//wC5xtEzBKNIsKYrfGr8 GExDyvCfre7ATA5fiTAbvYX5x4lgY/fRxJNEzaNJ3Cx+2lu/iQt6E9tC0WcNrNtqq8fl mrqg==
X-Gm-Message-State: AOAM5316ZeXYzVAxqdgDymiIL/lPdg+JYWHQlMYDxfYMMT9P7/aiFYGZ /a762TuauIlU0cuJt8aE/cExWmV9ISLK76agM6Y=
X-Google-Smtp-Source: ABdhPJyk4dTktkjLfa87GwmAJ8dJpxVQXnUgCj3ZdFaX3PSbDkzH+D8tq7uoS7R+drsWBozBNLKXrZBE5z4XYX2RTbc=
X-Received: by 2002:a02:9669:: with SMTP id c96mr216771jai.128.1631133575239; Wed, 08 Sep 2021 13:39:35 -0700 (PDT)
MIME-Version: 1.0
References: <aad93bd3-3dd2-bd53-ca21-d6f2632a3cb5@gmail.com>
In-Reply-To: <aad93bd3-3dd2-bd53-ca21-d6f2632a3cb5@gmail.com>
From: Watson Ladd <watsonbladd@gmail.com>
Date: Wed, 08 Sep 2021 16:39:24 -0400
Message-ID: <CACsn0cmQgrYHhWm533R2ybQ7rTMg_sVxqO5qN5TLrs1C4uir+Q@mail.gmail.com>
To: Julia Hesse <juliahesse2@gmail.com>
Cc: crypto-panel@irtf.org, Benjamin Kaduk <kaduk@mit.edu>, "<cfrg@ietf.org>" <cfrg@ietf.org>, Colin Perkins <csp@csperkins.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Archived-At: <https://mailarchive.ietf.org/arch/msg/cfrg/RSNohs7sNStj9yHrTqqqDS9UKxQ>
Subject: Re: [CFRG] IRSG review draft-irtf-cfrg-spake2-20
X-BeenThere: cfrg@irtf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: Crypto Forum Research Group <cfrg.irtf.org>
List-Unsubscribe: <https://www.irtf.org/mailman/options/cfrg>, <mailto:cfrg-request@irtf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/cfrg/>
List-Post: <mailto:cfrg@irtf.org>
List-Help: <mailto:cfrg-request@irtf.org?subject=help>
List-Subscribe: <https://www.irtf.org/mailman/listinfo/cfrg>, <mailto:cfrg-request@irtf.org?subject=subscribe>
X-List-Received-Date: Wed, 08 Sep 2021 20:39:41 -0000

On Tue, Sep 7, 2021 at 4:41 AM Julia Hesse <juliahesse2@gmail.com> wrote:
>
> Dear all,
>
> below is a review of the latest SPAKE2 draft. I did not verify changes in test vectors. The // - questions were posted by Chris Wood here https://gist.github.com/chris-wood/2205c8e79b309adec5a785470d31226e
> and my * comments are about how they were addressed.
>
> Best regards,
> Julia
>
>
> // - Should we include a definition of UKS attacks inline, rather than cite draft-ietf-mmusic-sdp-uks?
>     * Resolved. Maybe substitute "over who is authenticated" by "over whom the key is shared with"? Because this is tied to the key.
>
> // - Should SPAKE2 require that the output length of Hash is at least 256-bits? (It's output is split in half to derive Ke and Ka, and we probably want those to have at least 128 bits.)
>     * Watson said he will add the requirement, but I cannot seem to find it. However, all ciphersuites use at least SHA-256 and it is very clear from the draft that the key length is half of the hash output. So I do not see the need to edit further in this regard.

I think it's worth adding "Keys MUST be at least 128 bits in length"
to the first paragraph in section 4.

>
> // - What does it mean to exchange messages symmetrically? (In the per-user M and N section)
>     * Resolved. I suggest to remove "to have a symmetric variant" - it is not needed and might cause confusion (variant of what?)

It is needed: Magic Wormhole uses this variant. And the concern about
who uses M and who uses N in cases where it isn't clear is best
addressed by using this variant.

>
> // - Beyond scalar multiplication being constant time, are there any other constant time considerations we should include?
>     * Resolved
>
> // - Why is Ke not included in the test vectors? It may be redundant, but it seems useful as an additional sanity check.
> // - There are currently no test vectors that include AAD -- should we add some?
>     * I have not verified these two.
>
> // - Why is len() a little-endian output?
>     * I agree with Watson to be consistent with Kerberos here
>
> // - Should we clarify that the transcript assumes a particular point encoding scheme, and that is to be defined by the calling application or implementation?
>     * Resolved
>
> Some more comments, not related to the IRSG review, below.
>
> I was missing a minimal list of data that A and B can start SPAKE2 from: ciphersuite, pw, A, B, M, N - did I forget something? What about the output key length? This can be easily included in 3.2, replacing "A and B are provisioned with information such as..."
>
> The document does not specify who uses M and who uses N. In the M\neq N variant of the protocol, which is mostly described in this draft, this is relevant, since no analysis was conducted in case A sends both xM and xN (a solution that implementors are not unlikely to come up with). I would include an instruction in the RFC, e.g., that the application must ensure that M and N are assigned to A and B, e.g., by having them apply some lexicographically-first-... rule.

I'm not sure I follow the issue. The sentence says 'A picks x randomly
and uniformly from the integers in [0,p), and calculates X=x*P and
S=w*M+X, then transmits pA=S to B.' Alice is hence the initiatior. If
it's impossible to do this easily then one of the M=N variants should
be used. Most protocols have an asymmetry here where one side is
initiating a request and the other receiving. Happy to add clarifying
text.

>
> p.2
> The KDF has only 3 inputs, but a fourth (key length L) is described in the text
>
> p.3
> servers -> serves
> flow figure should include "verify cA" and "verify cB", since it is a MUST.
>
> p.4
> remove unnecessary variables T and S? E.g., directly set pB=w*N+Y.

These editorial comments seem worthwile to fix. Side note to Colin: is
there another set of reviews I should be waiting for at this stage? If
not I should be able to fix these all pretty promptly.

Sincerely,
Watson Ladd


--
Astra mortemque praestare gradatim