Re: [Emu] TEAP - RFC 7170 - Errata ID 5768

Joseph Salowey <joe@salowey.net> Mon, 29 June 2020 15:53 UTC

Return-Path: <joe@salowey.net>
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 9C8E63A0121 for <emu@ietfa.amsl.com>; Mon, 29 Jun 2020 08:53:55 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.798
X-Spam-Level:
X-Spam-Status: No, score=-1.798 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=0.001, HTTPS_HTTP_MISMATCH=0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=no autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=salowey-net.20150623.gappssmtp.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 dCkhkEfbNdTJ for <emu@ietfa.amsl.com>; Mon, 29 Jun 2020 08:53:53 -0700 (PDT)
Received: from mail-qk1-x734.google.com (mail-qk1-x734.google.com [IPv6:2607:f8b0:4864:20::734]) (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 36D6B3A03F3 for <emu@ietf.org>; Mon, 29 Jun 2020 08:53:53 -0700 (PDT)
Received: by mail-qk1-x734.google.com with SMTP id c139so15643607qkg.12 for <emu@ietf.org>; Mon, 29 Jun 2020 08:53:53 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=salowey-net.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=uGdT3ISwKvpo8Ct0mIyuhczXcimagD6lATK1jv1Ua04=; b=Uagc0JBcFUZhopXbl83dncHOELc4YuPRmGBOtmcmTisz8y9i8Ln6TZYHNa2jlOX71z qcuWZaNdpBDwOc4ZZzn41YpsvbKDkWwS5lg4CRxuWYW1GHWn+cgO9Z+uOzwCv+RYAZ0s eew19+ZfP2SAPNxy0v7VyfgYLQn8yXZwwK59Me6Xj1hBGYm2s0aCtXvLTKFMBokNfYDi NBmLFkIPzPf8niM1/wVR8Mb+QPamFxW+1r0ZLBFWd9vjqzRRyiHLSGptgrOnv8Z5B6eN E65MeCQxCxFW4XxawYHo+LeDlk5Zkgw5+kx4i8dRisp4PxoW/OZomqnXBsDmcmrTgqAi 88Yg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=uGdT3ISwKvpo8Ct0mIyuhczXcimagD6lATK1jv1Ua04=; b=mCU2BgF4g4Ul3DMsuIzdgnKvZtQaGElzLbDVOP1CM5QAM72wctSxfew12nX6v64Jut juFej3WJsQVa69L2H3bFVIFMpwQ5vYNx1oiDX6xVIgk84JD3WpwLBvk0/MnqhFly+EBe 3h2ELogX7rg3KD1AviE+3Pbn3K186TN/os1cmGiDirkjIn2LPXOk1sT3h/5Qr3+jWfSO UxxoUhmum3TWDHFV0PmNC64hGJxMa2l/Mgxijtddwuyy15uCG8TnEkWMl5jGiKaI41P9 pi2BPWmXib05XWK8pZxPJM71PBIo+noa2IKvye6RyhrnRmmfoPsYyUvE0Y+0c1CTY0oV Suag==
X-Gm-Message-State: AOAM530ZOr2sL+uScqbH4oar87X6Pdbm9hTb3N8e2e9SvysXZ90a/iBv LONAPtO2S6XNwmP9K2b1ximoVDzXPdwonu708ywCog==
X-Google-Smtp-Source: ABdhPJyN+mLuuRFzDRBJ0Pjfmfd2+kedpcoqBKMtIq3vTXaz8wbKJgfx0CdgeYfdecVP3M1XLTkZn7oAQ+xBu82fBQU=
X-Received: by 2002:a37:4683:: with SMTP id t125mr15563148qka.416.1593446031646; Mon, 29 Jun 2020 08:53:51 -0700 (PDT)
MIME-Version: 1.0
References: <CABXxEz-LyyWcxvArfoU=JEcAEtun9T2wkADAB9_sw8zdGc2R2g@mail.gmail.com> <CH2PR21MB138134E39EBC0EF2F4EBE9C4D1B40@CH2PR21MB1381.namprd21.prod.outlook.com> <CAOgPGoDsV-f2iNt2c1nnyPF8nTnabRyqsVBU+MWuwnswTWZw-A@mail.gmail.com> <CH2PR21MB13815E6F39A40C156A5A3388D1B00@CH2PR21MB1381.namprd21.prod.outlook.com> <CABXxEz8H3pWCk5c+2EWDvPGK4FOoD6q-GoD-nfvYcPYW+WyEvw@mail.gmail.com>
In-Reply-To: <CABXxEz8H3pWCk5c+2EWDvPGK4FOoD6q-GoD-nfvYcPYW+WyEvw@mail.gmail.com>
From: Joseph Salowey <joe@salowey.net>
Date: Mon, 29 Jun 2020 08:53:40 -0700
Message-ID: <CAOgPGoA4ZDWCW2WpkH168i+cWP5YyeTuhJOUC3P4YDqM1L5uFg@mail.gmail.com>
To: Oleg Pekar <oleg.pekar.2017@gmail.com>
Cc: Jorge Vergara <jovergar@microsoft.com>, Jouni Malinen <j@w1.fi>, EMU WG <emu@ietf.org>
Content-Type: multipart/alternative; boundary="000000000000b0b05f05a93b103c"
Archived-At: <https://mailarchive.ietf.org/arch/msg/emu/mArgWr4Z2QXytb-qGc_xYs-YFoU>
Subject: Re: [Emu] TEAP - RFC 7170 - Errata ID 5768
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: Mon, 29 Jun 2020 15:53:56 -0000

On Mon, Jun 29, 2020 at 6:49 AM Oleg Pekar <oleg.pekar.2017@gmail.com>
wrote:

> Jorge, Joe, thank you for your comments. So the updated proposal should be:
>
> 1) In Section "4.2.13.  Crypto-Binding TLV" make "EMSK Compound MAC" and
> "MSK Compound MAC" fields variable length depending on the number of output
> bits of the MAC function negotiated by TLS protocol. A field "Compound MAC
> Length" of size 1 octet is added after the "Nonce" field to represent the
> length of each of "EMSK Compound MAC" and "MSK Compound MAC" fields. The
> minimum length for each Compound MAC field is 20 octets (to honor the
> original RFC fixed size and to allow usage of SHA-1 - that is still used in
> TLS 1.2 - to provide MAC without padding). The length should never be less
> than 20 octets since there are no ciphers supported by TLS 1.2 with a
> digest of less than 160 bits output size. Therefore if "Compound MAC
> Length" field value is less than 20 then the Crypto-binding TLV should be
> considered of erroneous format and handled as described in section 3.6.
> Error Handling. The value of the length field of the whole Crypto-Binding
> TLV should be calculated accordingly (currently fix 76 octets).
>
> [Joe] I'm not sure I see the need to for a length here.  Isn't the MAC
algorithm known before this message is processed and therefore the length
should be known?  The document should clarify how the MAC algorithm is
determined for TLS 1.2 and TLS 1.3. The length could then be defined as the
length of the output of the MAC function.


> The updated structure of Crypto-Binding TLV:
>
> The Crypto-Binding TLV is defined as follows:
>
>     0                   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
>    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
>    |M|R|         TLV Type          |            Length             |
>    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
>    |    Reserved   |    Version    |  Received Ver.| Flags|Sub-Type|
>    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
>    |                                                               |
>    ~                             Nonce                             ~
>    |                                                               |
>    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
>
>    |  Comp MAC Len |
>
>    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
>
>    |                                                               |
>    ~                   EMSK Compound MAC                           ~
>    |                                                               |
>    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
>    |                                                               |
>    ~                    MSK Compound MAC                           ~
>    |                                                               |
>    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
>
>
> If we would not bump the TEAP protocol version - we still can change the Crypto-Binding TLV version to 2.
>
>
> 2) [This was accepted and stays unchanged]
>
> 3) In Section "5.3.  Computing the Compound MAC" when specifying the list of fields to be placed in the BUFFER" should say "...2  A single octet contains TEAP EAP method type 0x37". However to let this byte play a role in protection of Crypto-Binding TLV I would suggest to place in it the inner EAP method type related to the calculation or 0x0 if no inner EAP method was executed. What are your opinions on this?
>
>
[Joe] I believe the original intent was that the same Compound MAC
construction could be used in multiple protocols (EAP-FAST, PEAP, TEAP).
Using the outer EAP method type would help protect against cross protocol
attacks if this TLV were reused.  If we are going to change the
TLV/protocol version we could revisit this and other aspects of the
compound TLV to validate their security goals and implementation.


>
> Thanks
> Oleg
>
>
> On Tue, May 26, 2020 at 12:29 PM Jorge Vergara <jovergar@microsoft.com>
> wrote:
>
>>
>>
>> *From:* Joseph Salowey <joe@salowey.net>
>> *Sent:* Monday, May 25, 2020 9:27 PM
>> *To:* Jorge Vergara <jovergar@microsoft.com>
>> *Cc:* Oleg Pekar <oleg.pekar.2017@gmail.com>; Jouni Malinen <j@w1.fi>;
>> EMU WG <emu@ietf.org>
>> *Subject:* Re: [Emu] TEAP - RFC 7170 - Errata ID 5768
>>
>>
>>
>>
>>
>>
>>
>> On Fri, May 22, 2020 at 1:18 PM Jorge Vergara <jovergar=
>> 40microsoft.com@dmarc.ietf.org> wrote:
>>
>> My review of this errata and the current responses from Oleg:
>>
>>
>>
>>    1. I agree with this proposed resolution. I do think this is an
>>    important omission that needs to be clarified in the RFC. Otherwise it is
>>    somewhat guesswork that truncation is the right action. I think the current
>>    wording leans toward truncation, but I definitely asked this question
>>    myself while implementing.
>>
>> [Joe]  Why not just change the TLV to be variable length?  It seems if we
>> hardcode the length to 100 we risk having the same problem in the future?
>>
>>
>>
>> [Jorge] I have to admit that in my original response my brain skipped
>> over the TLV length adjustment and focused only on the truncation. If the
>> TLV length is going to be adjusted at all, I am in favor of making the TLV
>> variable length. A minimum length could also be added (32 bits seems to be
>> the current recommendation). However, I do believe this is a breaking
>> change to any TEAP implementation – would the TEAP version need to be
>> bumped?
>>
>>
>>    1.
>>    2. This bleeds into Alan’s TLS 1.3 document somewhat, but I agree
>>    with Jouni that this will need to change when the rest of the document is
>>    eventually updated to TLS 1.3.. There are enough TLS 1.3 related things to
>>    address in TEAP that I don’t exactly view this as an errata. I view it as a
>>    needed update, whether in this document, Alan’s document, or both.
>>
>> [Joe]  I tend to agree that this is not an errata.  However an update to
>> TEAP should address these.
>>
>>
>>
>>
>>    1.
>>    2. Agree with Jouni that I don’t see the point of the 0x37 octet, but
>>    regardless this clarification of how it is encoded is positive (minor)
>>    change.
>>
>> [Joe] I think the original reason to include the TEAP method ID in the
>> specification was to make sure that we differentiated between similar
>> crypto binding implementations in other protocols such as EAP-FAST.   I
>> don't think there is much ambiguity here, but I am OK with including 0x37
>> in the description.
>>
>>
>>
>>
>>
>> Thanks,
>>
>> Jorge
>>
>>
>>
>> *From:* Emu <emu-bounces@ietf.org> *On Behalf Of *Oleg Pekar
>> *Sent:* Tuesday, May 5, 2020 6:27 AM
>> *To:* Jouni Malinen <j@w1.fi>; EMU WG <emu@ietf.org>
>> *Subject:* [Emu] TEAP - RFC 7170 - Errata ID 5768
>>
>>
>>
>> Hi Jouni,
>>
>> I propose the following fix for the issues described in this errata id:
>>
>> 1) In Section "4.2.13.  Crypto-Binding TLV" make "EMSK Compound MAC" and
>> "MSK Compound MAC" fields 32 octets long (currently 20 octets). The MAC
>> value is truncated at 32 octets if it is longer than 32 octets or padded to
>> a length of 32 octets with zeros to the right if it is less than 32 octets.
>> The length of the TLV should be changed to 100 bytes (currently 76).
>>
>>
>>
>> The motivation is to keep collision-resistance strength of MAC on 128
>> bit. Hash value truncation is described in "NIST Special Publication
>> 800-107 Revision 1: Recommendation for Applications Using Approved Hash
>> Algorithms"
>> <https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fnvlpubs.nist.gov%2Fnistpubs%2FLegacy%2FSP%2Fnistspecialpublication800-107r1.pdf&data=02%7C01%7Cjovergar%40microsoft.com%7C6102b418ffd64be20f0b08d8012d1ade%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637260640995993815&sdata=MIOfT9tSEHTmbuP2oTjAxlgJdBOke3V4uAqQq7YDzN0%3D&reserved=0>
>>
>>
>>
>>
>> 2) In Section "5.3.  Computing the Compound MAC" specify that "MAC is the
>> MAC function negotiated in TLS of TEAP Phase 1" (currently it says TLS
>> 1.2)
>>
>>
>>
>> The motivation is to support TLS 1.2, 1.3 and possibly later TLS versions.
>>
>>
>>
>> 3) In Section "5.3.  Computing the Compound MAC" when specifying the list
>> of field to be placed in the BUFFER" should say "...2  A single octet
>> contains TEAP EAP method type 0x37". Alternatively it could be "...2  A
>> single octet contains EAP Type of the inner EAP method related to the
>> calculation or 0 if no inner EAP method was executed" (currently "...2  The
>> EAP Type sent by the other party in the first TEAP message")
>>
>>
>>
>> Please note that there's still a discussion on sending Crypto-Binding TLV
>> on "Authentication inner EAP method" or "Inner EAP method that exports MSK"
>> only.
>>
>>
>>
>> Thanks
>>
>> Oleg
>>
>> _______________________________________________
>> Emu mailing list
>> Emu@ietf.org
>> https://www.ietf.org/mailman/listinfo/emu
>> <https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.ietf.org%2Fmailman%2Flistinfo%2Femu&data=02%7C01%7Cjovergar%40microsoft.com%7C6102b418ffd64be20f0b08d8012d1ade%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637260640996003807&sdata=kBRkWM2GADS2iZP%2F6A9Ygr61JO6hcEe8cNK2Z6p9Pg0%3D&reserved=0>
>>
>>