Re: [Emu] RFC 7170 (TEAP) errata

Jouni Malinen <j@w1.fi> Tue, 23 July 2019 09:01 UTC

Return-Path: <j@w1.fi>
X-Original-To: emu@ietfa.amsl.com
Delivered-To: emu@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id AD5AB12008D for <emu@ietfa.amsl.com>; Tue, 23 Jul 2019 02:01:44 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.899
X-Spam-Level:
X-Spam-Status: No, score=-1.899 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
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 1xRE8FlmtoPj for <emu@ietfa.amsl.com>; Tue, 23 Jul 2019 02:01:43 -0700 (PDT)
Received: from li674-96.members.linode.com (mail.w1.fi [212.71.239.96]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id C6E1B120041 for <emu@ietf.org>; Tue, 23 Jul 2019 02:01:42 -0700 (PDT)
Received: from localhost (localhost [127.0.0.1]) by li674-96.members.linode.com (Postfix) with ESMTP id 5291911B78; Tue, 23 Jul 2019 09:01:40 +0000 (UTC)
X-Virus-Scanned: Debian amavisd-new at w1.fi
Received: from li674-96.members.linode.com ([127.0.0.1]) by localhost (mail.w1.fi [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 5Wmh5Swvnv8n; Tue, 23 Jul 2019 09:01:38 +0000 (UTC)
Received: by jm (sSMTP sendmail emulation); Tue, 23 Jul 2019 12:01:31 +0300
Date: Tue, 23 Jul 2019 12:01:31 +0300
From: Jouni Malinen <j@w1.fi>
To: Joseph Salowey <joe@salowey.net>
Cc: Jouni Malinen <jkmalinen@gmail.com>, emu@ietf.org
Message-ID: <20190723090131.GB6611@w1.fi>
References: <CANe27jLO9eDA867X8hCHv_WRADN_txSp4xpRTxn2RpwS=yaquA@mail.gmail.com> <CAOgPGoBGYWQn72eojTZD_Q+AqZoNq7USPhSUeEgZLtSNfoZh9w@mail.gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Disposition: inline
In-Reply-To: <CAOgPGoBGYWQn72eojTZD_Q+AqZoNq7USPhSUeEgZLtSNfoZh9w@mail.gmail.com>
Archived-At: <https://mailarchive.ietf.org/arch/msg/emu/G8r9Cy4DfM04h1zduLVYpZbNh-0>
Subject: Re: [Emu] RFC 7170 (TEAP) errata
X-BeenThere: emu@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: "EAP Methods Update \(EMU\)" <emu.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/emu>, <mailto:emu-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/emu/>
List-Post: <mailto:emu@ietf.org>
List-Help: <mailto:emu-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/emu>, <mailto:emu-request@ietf.org?subject=subscribe>
X-List-Received-Date: Tue, 23 Jul 2019 09:01:45 -0000

On Mon, Jul 22, 2019 at 03:12:15PM -0400, Joseph Salowey wrote:
> On Mon, Jul 1, 2019 at 4:11 PM Jouni Malinen <jkmalinen@gmail.com> wrote:
> > (2) S-IMCK[j] derivation when inner EAP methods in the sequence derive
> > both MSK and EMSK (or even more complicated, if there are multiple inner
> > EAP authentication methods that have difference in whether they derive MSK
> > or EMSK):
> > https://www.rfc-editor.org/errata/eid5770

> [Joe]  I'd like to hear from implementers on this one.

My current implementation derives two copies of S-IMCK[i] values (one
based on MSK and the other one based on EMSK from the inner EAP method).
Both of these are initialized to session_key_seed. If the inner EAP
method derives EMSK, EMSK Compound MAC gets included in crypto-binding.
MSK is assumed to be derived for all cases where EMSK is derived. If
neither MSK nor EMSK is derived, the "MSK" S-IMCK[j] is derived based on
the all-zeros-IMSK and that is then used to calculate the MSK Compound
MAC field. This implementation does not support a sequence of more than
one inner EAP authentication method that derives keys, so the more
complicated mixes do not show up. Or well, in theory, there is support
for EAP-TNC, so that could show these cases (e.g., with EAP-MSCHAPv2
deriving MSK and that followed by EAP-TNC not deriving any keys), but I
have not tested that combination yet.

I'm currently deriving the TEAP MSK and EMSK based on the MSK-based
S-IMCK[j], but that would be trivial to change to use EMSK-based
S-IMCK[j] (if available) for TEAP EMSK derivation. However, this part
would need to be done based on whether both ends actually claimed to
derive EMSK from the inner EAP method(s) (and with even more complex
rules if only a subset of the inner EAP methods derive EMSK while
another subset does not and those subsets are different at each end).

> I think the intent is that section 5.4 should say the S-IMCK is generated
> as specified  as described in section 5.2.
> 
> Section 5.2 does provide a mechanism to derive the S-IMCK at the end of the
> section.  Each IMCK can be derived in one of 3 ways:
> - MSK
> - EMSK
> - 0s if the method is not key generating

Well, yes, but this is not very helpful now that TEAP added two Compound
MAC values into crypto-binding. There is clearly an assumption that
different IMSK[j] values (and from that, two different S-IMSK[j] values)
are derived if the inner EAP method derives both an MSK and EMSK, but
the sections describing derivations and use of these keys do not take
into account that need for two independent values.

> There is ambiguity on how to derive each IMSK in the case that both sides
> do not have the same capability to export the EMSK.   I think the steps
> involving the compound MAC are meant to disambiguate this situation.

They were probably meant to do that, but they did not really.

> Is the problem that the section does not explicitly say how to use the
> compound MAC sent to determine which IMCK derivation to use?

No, the problem is in one of the design (crypto-binding
construction/validation) assuming there are two values (MSK-based and
EMSK-based) while the IMSK[j]/IMCK[j] derivation part assuming only one
value (EMSK-based, if available, otherwise MSK-based) is derived.
Furthermore, the TEAP MSK/EMSK derivation rules assumes there is only
one S-IMCK[j]. This would have all worked fine if the crypto-binding
design from EAP-FAST had not been extended to cover the EMSK case, but
I'd guess that addition was done based on some review, but that did not
end up getting fully baked into the TEAP design to make it work.

-- 
Jouni Malinen                                            PGP id EFC895FA