Re: [tcpm] [Technical Errata Reported] RFC5926 (5267)

touch@strayalpha.com Thu, 29 March 2018 15:47 UTC

Return-Path: <touch@strayalpha.com>
X-Original-To: tcpm@ietfa.amsl.com
Delivered-To: tcpm@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id D59B412DA22 for <tcpm@ietfa.amsl.com>; Thu, 29 Mar 2018 08:47:21 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.989
X-Spam-Level:
X-Spam-Status: No, score=-1.989 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, T_SPF_PERMERROR=0.01, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=strayalpha.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 w2aIbN2wcuFw for <tcpm@ietfa.amsl.com>; Thu, 29 Mar 2018 08:47:14 -0700 (PDT)
Received: from server217-3.web-hosting.com (server217-3.web-hosting.com [198.54.115.226]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 9098912DA17 for <tcpm@ietf.org>; Thu, 29 Mar 2018 08:47:14 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=strayalpha.com; s=default; h=Message-ID:References:In-Reply-To:Subject:Cc: To:From:Date:Content-Transfer-Encoding:Content-Type:MIME-Version:Sender: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=ouoBy5+yyzTH/bRTS+IgjBxCChjkbnRe4Kx0IrJzdYo=; b=POwFqgO+XkO2ct3vpTQorYau3a 9fCemjU63VhrhTIg7bESUK9CjLGBncQf68iOheZKZSjbqSkYUVAzDQajKKWTREAtnMMmBumEzvS5F 8B+Kg5cWs9btiHAqj52YvJSadUKoj3aEOCy7CHlzQbVN7JbDeHBlXDzzKOx2oRc5niR4ttH/mOShn tiTZC1TefkNPK4bZUyVZrrrwHejKb1WdFeF3GU6OtvJ45c+ewknR2Sqkv4kMbZX5iriYqPJBHtv1v eW+CpL9idqOEbUX7syrDLvwsvX/P+iUldfUoXLZcaYqYw7v8K376TXA4epVjChdHT0o132dAZqpiI Z+ALcmug==;
Received: from [::1] (port=34544 helo=webmail.strayalpha.com) by server217.web-hosting.com with esmtpa (Exim 4.89_1) (envelope-from <touch@strayalpha.com>) id 1f1ZlQ-000H2Z-0N; Thu, 29 Mar 2018 11:46:57 -0400
MIME-Version: 1.0
Content-Type: text/plain; charset="UTF-8"; format="flowed"
Content-Transfer-Encoding: 8bit
Date: Thu, 29 Mar 2018 11:46:55 -0400
From: touch@strayalpha.com
To: "Brian Weis (bew)" <bew@cisco.com>
Cc: RFC Editor <rfc-editor@rfc-editor.org>, ekr@rtfm.com, tuexen@fh-muenster.de, tcpm@ietf.org, ietf@kuehlewind.net
In-Reply-To: <8B1FAC72-2B18-4406-A3D3-E3BE5524EB59@cisco.com>
References: <20180226190209.F3D43B80E1F@rfc-editor.org> <A1D80502-1BFA-4F12-9978-D74DE20EB4CA@strayalpha.com> <8B1FAC72-2B18-4406-A3D3-E3BE5524EB59@cisco.com>
Message-ID: <cab9312222159c07346b5dd5cfd9ce9e@strayalpha.com>
X-Sender: touch@strayalpha.com
User-Agent: Roundcube Webmail/1.2.7
X-OutGoing-Spam-Status: No, score=-0.2
X-AntiAbuse: This header was added to track abuse, please include it with any abuse report
X-AntiAbuse: Primary Hostname - server217.web-hosting.com
X-AntiAbuse: Original Domain - ietf.org
X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12]
X-AntiAbuse: Sender Address Domain - strayalpha.com
X-Get-Message-Sender-Via: server217.web-hosting.com: authenticated_id: touch@strayalpha.com
X-Authenticated-Sender: server217.web-hosting.com: touch@strayalpha.com
X-Source:
X-Source-Args:
X-Source-Dir:
X-From-Rewrite: unmodified, already matched
Archived-At: <https://mailarchive.ietf.org/arch/msg/tcpm/FXix-6DqUFVq0dBayIoato1a-us>
Subject: Re: [tcpm] [Technical Errata Reported] RFC5926 (5267)
X-BeenThere: tcpm@ietf.org
X-Mailman-Version: 2.1.22
Precedence: list
List-Id: TCP Maintenance and Minor Extensions Working Group <tcpm.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/tcpm>, <mailto:tcpm-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/tcpm/>
List-Post: <mailto:tcpm@ietf.org>
List-Help: <mailto:tcpm-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/tcpm>, <mailto:tcpm-request@ietf.org?subject=subscribe>
X-List-Received-Date: Thu, 29 Mar 2018 15:47:22 -0000

On 2018-03-28 15:42, Brian Weis (bew) wrote:
> Hi Joe,
> 
> Sorry, I missed your reply to this before the errata was rejected.
> 
>> On Feb 28, 2018, at 6:56 AM, Joe Touch <touch@strayalpha.com> wrote:
>> 
>> 
>> Hi, all,
>> 
>> This errata should be rejected.
>> 
>> NIST-SP800-108 does not require the use of 0x00 (see cited text
>> below). It only requires that the length and order of each field be
>> defined unambiguously.
> 
>  This is correct. The issue is whether all TCP-AO implementations
> implementing NIST SP800-108 all add the 0x00 or not. If there is
> confusion between implementations then they will not generate the same
> session keys.

We use a fixed string ("TCP-AO"), not a variable one. As a result, we 
don't need a flag to indicate the length of the string, and the flag 
0x00 is only one way to do such an indication (vs. a second length field 
or other flag value). Page 11 footnote of the NIST spec explains this.

> 
>> The length of “TCP-AO” is clearly and unambiguously 6 octets, as
>> defined in the existing RFC text. The method of providing that
>> length unambiguously to the KDF algorithm is an implementation
>> issue.
> 
>  I disagree that it is unambiguously 6 octets.  The use of
> double-quotes is often construed as a null-terminated string.

strlen("TCP-AO") = 6.

The null is a C encoding. Other languages use other ways to indicate the 
length of the string.


> This can
> be read as a null-terminated 7 octet string.

That actually cannot be expressed in C. Strings in C cannot have 
internal nulls; they would be interpreted as terminators.

> In fact, this is the
> exact question asked by an implementor, and why I filed the errata. I
> believe it is a reasonable request to clarify this one way or the
> other.

Neither Mirja nor I read the NIST spec that way. C strlen agrees with us 
too.

I really think the implementer is getting wrapped around implementation 
details, which are both language and implementation specific and don't 
need to be in the spec IMO.

Joe


> 
> If you agree with this, I’ll open another errata indicating the
> problem more clearly.
> 
> My preference for clarifying that it does include the 0x00 is for
> safety. While the current RFC has only one label field (“TCP-AO”),
> if another string _beginning_ with ‘TCP-AO’ were also defined then
> there could be confusion between the two generated keys. Since the
> cost of adding 0x00 to the calculation is negligible, it seems prudent
> to  be safe.
> 
> Thanks,
> Brian
> 
>> Joe
>> 
>> The following text is clear that 0x00 is optional:
>> 
>>> 12) 0x00 – An all zero octet. An optional data field used to
>>> indicate a separation of different variable length data fields1.
>>> 
>>> 1 This indicator may be considered as a part of the encoding
>>> method for the input data and can be replaced by other indicators,
>>> for example, an indicator to represent the length of the variable
>>> length field. If, for a specific KDF, only data fields with
>>> identical length are used, then the indicator may be omitted.
>> 
>> and later, 0x00 is given as a choice used in the example presented,
>> not as a requirement:
>> 
>>> The length for each data field and an order shall be defined
>>> unambiguously. For example, the length and the order may be
>>> defined as a part of a KDF specification or by the protocol where
>>> the KDF is used. In each of the following sections, a specific
>>> order for the feedback value, the counter, the Label, the
>>> separation indicator 0x00, the Context, and [L]2 is used, assuming
>>> that each of them is represented with a specific length. This
>>> Recommendation specifies several families of KDFs. Alternative
>>> orders for the input data fields may be used for different KDFs.
>> 
>> ---------------------
>> 
>>> On Feb 26, 2018, at 11:02 AM, RFC Errata System
>>> <rfc-editor@rfc-editor.org> wrote:
>>> 
>>> The following errata report has been submitted for RFC5926,
>>> "Cryptographic Algorithms for the TCP Authentication Option
>>> (TCP-AO)".
>>> 
>>> --------------------------------------
>>> You may review the report below and at:
>>> http://www.rfc-editor.org/errata/eid5267
>>> 
>>> --------------------------------------
>>> Type: Technical
>>> Reported by: Brian Weis <bew@cisco.com>
>>> 
>>> Section: 3.1.1
>>> 
>>> Original Text
>>> -------------
>>> - Label:     A binary string that clearly identifies the purpose
>>> of this KDF's derived keying material.  For
>>> TCP-AO,
>>> we use the ASCII string "TCP-AO", where the last
>>> character is the capital letter "O", not to be
>>> confused with a zero.  While this may seem like
>>> overkill in this specification since TCP-AO only
>>> describes one call to the KDF, it is included in
>>> order to comply with FIPS 140 certifications.
>>> 
>>> Corrected Text
>>> --------------
>>> - Label:     A binary string that clearly identifies the purpose
>>> of this KDF's derived keying material.  For
>>> TCP-AO,
>>> we use the ASCII string "TCP-AO", where the last
>>> character is the capital letter "O", not to be
>>> confused with a zero. The ASCII string is
>>> terminated
>>> with a null octet (0x00). While this may seem
>>> like
>>> overkill in this specification since TCP-AO only
>>> describes one call to the KDF, it is included in
>>> order to comply with FIPS 140 certifications.
>>> 
>>> Notes
>>> -----
>>> This section states that "Both of these KDFs are based on the
>>> iteration-mode KDFs specified in [NIST-SP800-108].", which is
>>> later clarified to be the "counter mode" KDF defined in that
>>> document. The definition of the "Label" input to the KDF in the
>>> original text is not clear.
>>> 
>>> [NIST-SP800-108] specifies that a 0x00 octet should follow the
>>> Label. This 0x00 octet is important when the KDF does not have
>>> control over the Context given it, which is the case here -- RFC
>>> 5926 depends on the definition in RFC 5925. RFC 5925 currently
>>> declares two fixed-size inputs for the Context (See Figures 7 & 8
>>> of RFC 5925), so the Context length differs. Also, RFC 5925 RFC
>>> could be updated over over time to include other Contexts that are
>>> variable sized. The risk of excluding 0x00 is enabling an attacker
>>> to choose a specially-crafted Context that violates the clean
>>> separation between the Label and Context arguments. Therefore, it
>>> is important to include the 0x00 octet for TCP-AO.
>> 
>>> I believe this 0x00 is implied in the specification of the string
>>> "TCP-AO", since conventionally many string definitions include a
>>> trailing 0x00 octet, The text should state that the 0x00 octet is
>>> present as part of the string.
>>> 
>>> If this errata does not result in adding the 0x00 octet, then its
>>> omission needs to be justified.
>>> 
>>> Instructions:
>>> -------------
>>> This erratum is currently posted as "Reported". If necessary,
>>> please
>>> use "Reply All" to discuss whether it should be verified or
>>> rejected. When a decision is reached, the verifying party
>>> can log in to change the status and edit the report, if necessary.
>>> 
>>> 
>>> --------------------------------------
>>> RFC5926 (draft-ietf-tcpm-tcp-ao-crypto-03)
>>> --------------------------------------
>>> Title               : Cryptographic Algorithms for the TCP
>>> Authentication Option (TCP-AO)
>>> Publication Date    : June 2010
>>> Author(s)           : G. Lebovitz, E. Rescorla
>>> Category            : PROPOSED STANDARD
>>> Source              : TCP Maintenance and Minor Extensions
>>> Area                : Transport
>>> Stream              : IETF
>>> Verifying Party     : IESG
>>> 
>>> _______________________________________________
>>> tcpm mailing list
>>> tcpm@ietf.org
>>> https://www.ietf.org/mailman/listinfo/tcpm
>> 
>> _______________________________________________
>> tcpm mailing list
>> tcpm@ietf.org
>> https://www.ietf.org/mailman/listinfo/tcpm
> 
> --
> Brian Weis
> Security, CSG, Cisco Systems
> Telephone: +1 408 526 4796
> Email: bew@cisco.com