Re: [TLS] Genart last call review of draft-ietf-tls-tls13-24

Ion Larranaga Azcue <ilarra@s21sec.com> Mon, 09 April 2018 09:28 UTC

Return-Path: <ilarra@s21sec.com>
X-Original-To: tls@ietfa.amsl.com
Delivered-To: tls@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 3F903127698 for <tls@ietfa.amsl.com>; Mon, 9 Apr 2018 02:28:27 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.902
X-Spam-Level:
X-Spam-Status: No, score=-1.902 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_PASS=-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 YKiTM-lBuBTa for <tls@ietfa.amsl.com>; Mon, 9 Apr 2018 02:28:24 -0700 (PDT)
Received: from mail.ssi.pt (mail1.ssi.pt [195.23.55.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 5364A126C26 for <tls@ietf.org>; Mon, 9 Apr 2018 02:28:24 -0700 (PDT)
From: Ion Larranaga Azcue <ilarra@s21sec.com>
To: Peter Gutmann <pgut001@cs.auckland.ac.nz>
CC: "tls@ietf.org" <tls@ietf.org>
Thread-Topic: [TLS] Genart last call review of draft-ietf-tls-tls13-24
Thread-Index: AQHTtcVLUPhTERem+EGBXUIdhpIlGKPn+86AgAAneICAATNEAIAAByMAgABNPYCAAAVigIAAvEKAgAEIQ4CAAJzjAIAHHkKAgACURICAACmygIAAYlRRgAAw1YCAAacBgIACKyew
Date: Mon, 09 Apr 2018 09:28:21 +0000
Message-ID: <9112d613326d4fe8b397fdd61580ea59@LXDOMEXC01.ssidom.com>
References: <1522377304060.20682@cs.auckland.ac.nz> <r470Ps-10133i-7B3DEB3D7CF1410DB2E2FF250A811BB1@Williams-MacBook-Pro.local> <CABcZeBMFrnSUddraBps-b=CujitVfaQuqBFHD9WCAcCKg9M7Tw@mail.gmail.com> <CDC57F65-C88C-43BB-B4DB-77AEE9B437EF@gmail.com> <1522462562850.29528@cs.auckland.ac.nz> <2C1F7A14-45B0-49DE-98B1-897223F7A1B0@akamai.com> <1522559738688.99197@cs.auckland.ac.nz> <7EBF2F91-6FEA-4705-BB1A-3FB5D7E33949@akamai.com> <2DA08233-1EC4-4371-943B-E41BF5D8DA8C@dukhovni.org> <109337BE-3299-46B5-A2F8-9583107AB537@akamai.com> <1523025589.2651530.1328912616.6FC37C86@webmail.messagingengine.com> <1523044476527.20197@s21sec.com>, <1523057191.3844723.1329421696.7A2BAE27@webmail.messagingengine.com> <1523147980074.75304@cs.auckland.ac.nz>
In-Reply-To: <1523147980074.75304@cs.auckland.ac.nz>
Accept-Language: es-ES, pt-PT, en-US
Content-Language: es-ES
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-ms-exchange-transport-fromentityheader: Hosted
x-originating-ip: [10.228.250.16]
x-exclaimer-md-config: 006f0bbf-7968-42ed-bdf3-292cea52a85c
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
Archived-At: <https://mailarchive.ietf.org/arch/msg/tls/CDssaaFrbUDwm1BDS7uGf8EJIeo>
Subject: Re: [TLS] Genart last call review of draft-ietf-tls-tls13-24
X-BeenThere: tls@ietf.org
X-Mailman-Version: 2.1.22
Precedence: list
List-Id: "This is the mailing list for the Transport Layer Security working group of the IETF." <tls.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/tls>, <mailto:tls-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/tls/>
List-Post: <mailto:tls@ietf.org>
List-Help: <mailto:tls-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/tls>, <mailto:tls-request@ietf.org?subject=subscribe>
X-List-Received-Date: Mon, 09 Apr 2018 09:28:27 -0000

I don't think it's necessary going to that degree of detail. For your specific first example, alert the alert "bad_certificate" is enough, or at the most a "certificate_chain_length_error". Your second example is, for me, more real, because it can be an extended error for a "decode_error" alert. As "decode_error" is too broad, we could have a "length_mismatch" extended error. But not give the specific values, because once the user knows that there is an error with the length of a packet, it can revise length fields in that specific packet in order to identify the error. An additional intermediate option is allowing specific parameters for each extended error, for instance in this example it could be the location within the packet of the offending field. 

Summarizing, including a text error message is going from black to white without passing through the greys. The problem I see with it is that it's hard for applications to automatically parse it, should it become necessary. I would first start trying to define an extended error reporting protocol using only numeric codes, and after the first few attempts, if we see that the list is not manageable, we could start exploring other options.

My preferences are (in descending order of preference):

- leave it as it is now, no extended error codes
- numeric extended error codes
- numeric extended error codes with specific sub-parameters for each extended error code (e.g. location within the packet of offending length field in a "length_mismatch" extended error code)
- numeric extended error codes with an arbitrary list of opaque parameters each, to be filled by developer (implementations can't rely on the content but can show them, on screen, so if you want it can be a text message)
- a single opaque extended error code. It can be numeric, UTF8 string or what the developer wants, but in my opinion this should be the last resort. I have never liked "let me put whatever I want" solutions


-----Mensaje original-----
De: Peter Gutmann [mailto:pgut001@cs.auckland.ac.nz] 
Enviado el: domingo, 8 de abril de 2018 2:41
Para: Ion Larranaga Azcue <ilarra@s21sec.com>
CC: tls@ietf.org
Asunto: Re: [TLS] Genart last call review of draft-ietf-tls-tls13-24

Stan Kalisch <stan@glyphein.mailforce.net> writes:

>On Fri, Apr 6, 2018, at 3:54 PM, Ion Larranaga Azcue wrote:
>>
>> My opinion is that if we are going to have extended error codes, it's 
>> better to use numeric ones and not text based errors.
>
>That was my own gut feeling on the least painful way to go, but I'm 
>open to the possibility that gut feeling was woefully naive.

To see why this won't work, you just need to think one step further: Try sitting down and defining the numeric error codes you're proposing.

If it's still not obvious: The reason why we need free-form strings is because the numeric codes we already have provide insufficient detail.  To provide the required detail, you'd need to define numeric codes for every error condition and failed check that every TLS and PKI library (because lots of handshake failures are due to problems with certs) could wish to communicate.  To take a PKI example, there's "Certificate chain with length %d has a path constraint of length %d", which for reasonable values of the two %d leads to, say, around a hundred error codes just for that one condition.  Then take every single type of error that would need to be communicated and you're into at least 16- bit values, or 32- or 64-bit if you take cases like "Packet length of %d indicated but only %d bytes were sent".

Even if someone came up with the massive codebook of thousands or tens of thousands of error codes, which TLS author would want to spend hours paging through them to find the right code for each situation?

Conversely, if you limit the number of error codes to, say, 5,000, how are you going to convince TLS library authors to check for and report only those errors?  What happens if new error types are defined?

Peter.