Re: [TLS] TLS 1.3 and TCP interactions

Jeremy Harris <jgh@wizmail.org> Sat, 30 May 2020 00:06 UTC

Return-Path: <jgh@wizmail.org>
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 D80563A128D for <tls@ietfa.amsl.com>; Fri, 29 May 2020 17:06:29 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.097
X-Spam-Level:
X-Spam-Status: No, score=-2.097 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, SPF_HELO_NONE=0.001, SPF_NONE=0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=neutral reason="invalid (unsupported algorithm ed25519-sha256)" header.d=wizmail.org header.b=p6rZwp4i; dkim=pass (2048-bit key) header.d=wizmail.org header.b=PfuLFjBM
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 BPisldqUILRn for <tls@ietfa.amsl.com>; Fri, 29 May 2020 17:06:28 -0700 (PDT)
Received: from wizmail.org (wizmail.org [IPv6:2a00:1940:107::2:0:0]) (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 D4F633A128C for <tls@ietf.org>; Fri, 29 May 2020 17:06:27 -0700 (PDT)
DKIM-Signature: v=1; a=ed25519-sha256; q=dns/txt; c=relaxed/relaxed; d=wizmail.org; s=e202001; h=Content-Transfer-Encoding:Content-Type: In-Reply-To:MIME-Version:Date:Message-ID:Autocrypt:From:References:Cc:To: Subject:From:Sender:Reply-To:Subject:Date:Message-ID:To:Cc:MIME-Version: Content-Type:Content-Transfer-Encoding:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive:Autocrypt; bh=UUtLnbu7k2mvFSm2AuqyeKzQq2IgmOUDa8qwuwubX+I=; b=p6rZwp4iHFNUjNUfB5rdlg4P39 RtIYoYFSdf0324UGWHsfeAjjRN6uRR9O2S8Q6Fb6qZGSJS1b/ohg62rKoRCQ==;
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=wizmail.org ; s=r202001; h=Content-Transfer-Encoding:Content-Type:In-Reply-To: MIME-Version:Date:Message-ID:Autocrypt:From:References:Cc:To:Subject:From: Sender:Reply-To:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Id:List-Help:List-Unsubscribe:List-Subscribe:List-Post: List-Owner:List-Archive:Autocrypt; bh=UUtLnbu7k2mvFSm2AuqyeKzQq2IgmOUDa8qwuwubX+I=; b=PfuLFjBM6UiYathLrLFc6TMj2v fiQJwN5fwfUWKbZBMNjV5cpEB3N6HXqDZuuL8MggDqdYCF7EL7UQ8GpcQUaK4sNoWSBlqw0wBKzO0 nbgQBrwjVkT3f/vo7OejqpwtJJEqJiOW/1fAgTvF1U7Gq1ekfroVsVVOK/+OSSQdNRvbGpIQWjm7r NjSJPCvAFKQOCkK1nEqaDM9aPUrIf4eVtympr6MntqdHUloDXabKTB8C8LSquLaDfuXGeoO7NdKTu sBKDbUpLDylLnIv4wKrZ71LJ8/QjVxy5ZRN+xaO7klPNJqaIasxDI3Mcn/S/dL4SuMd8takJG7PFy Wiig0JTA==;
Authentication-Results: wizmail.org; iprev=pass (vgate18.wizint.net) smtp.remote-ip=2a00:1940:107::1:2f:0; auth=pass (PLAIN) smtp.auth=jgh@wizmail.org
Received: from vgate18.wizint.net ([2a00:1940:107::1:2f:0] helo=lap.dom.ain) by wizmail.org (Exim 4.93.117) (TLS1.3) tls TLS_AES_128_GCM_SHA256 with esmtpsa id 1jep17-0007xh-Dg (return-path <jgh@wizmail.org>); Sat, 30 May 2020 00:06:25 +0000
To: David Benjamin <davidben@chromium.org>
Cc: tls@ietf.org
References: <CAF8qwaBBKvcGMFRxxuVvfBo2Z96mqiEwLfG7H2ZQw0m5+TMnVg@mail.gmail.com> <36e4f801-f61f-4f7e-3a5f-2e68b5cf0f29@wizmail.org> <CAF8qwaD81mA9mp0LFXAAamZc_PvSrqpbSEqUt=vzzRp9u3=o+Q@mail.gmail.com>
From: Jeremy Harris <jgh@wizmail.org>
Autocrypt: addr=jgh@wizmail.org; prefer-encrypt=mutual; keydata= mQENBFWABsQBCADTFfb9EHGGiDel/iFzU0ag1RuoHfL/09z1y7iQlLynOAQTRRNwCWezmqpD p6zDFOf1Ldp0EdEQtUXva5g2lm3o56o+mnXrEQr11uZIcsfGIck7yV/y/17I7ApgXMPg/mcj ifOTM9C7+Ptghf3jUhj4ErYMFQLelBGEZZifnnAoHLOEAH70DENCI08PfYRRG6lZDB09nPW7 vVG8RbRUWjQyxQUWwXuq4gQohSFDqF4NE8zDHE/DgPJ/yFy+wFr2ab90DsE7vOYb42y95keK tTBp98/Y7/2xbzi8EYrXC+291dwZELMHnYLF5sO/fDcrDdwrde2cbZ+wtpJwtSYPNvVxABEB AAG0JkplcmVteSBIYXJyaXMgKG5vbmUpIDxqZ2hAd2l6bWFpbC5vcmc+iQFOBBMBCAA4FiEE qYbzpr1jd9hzCVjevOWMjOQfMt8FAl4WMuMCGwMFCwkIBwIGFQoJCAsCBBYCAwECHgECF4AA CgkQvOWMjOQfMt946ggAvqDr2jvVnGIN2Njnjl2iiKyw4dYdFzNhZgjTaryiV90BftUDxRsB uTVFUC6XU+B13MEgSK0zRDyI5NpEH+JTW539gWlmz2k2WTTmoB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n3NBYAuhymnqgLgWcrPNaiSP6VIrsu4aCCoeIuc7bCFks6hrR x805g1J6uxixrMu2bW+AbPpRObi5B0pTJhDaLBW1xQgOiwYIAdyu0H2YNMrCBsA0w40UWEIz xrAkJFP/CS+qkjMI47FKq1EzbQ==
Message-ID: <48784e43-d01c-2c1e-c1b2-d6397b5ebae3@wizmail.org>
Date: Sat, 30 May 2020 01:06:23 +0100
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0
MIME-Version: 1.0
In-Reply-To: <CAF8qwaD81mA9mp0LFXAAamZc_PvSrqpbSEqUt=vzzRp9u3=o+Q@mail.gmail.com>
Content-Type: text/plain; charset=utf-8
Content-Language: en-GB
Content-Transfer-Encoding: 8bit
X-Pcms-Received-Sender: vgate18.wizint.net ([2a00:1940:107::1:2f:0] helo=lap.dom.ain) with esmtpsa
Archived-At: <https://mailarchive.ietf.org/arch/msg/tls/AcQ8AQfRhCFL4dA_jC5JWYEHN7s>
Subject: Re: [TLS] TLS 1.3 and TCP interactions
X-BeenThere: tls@ietf.org
X-Mailman-Version: 2.1.29
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: Sat, 30 May 2020 00:06:30 -0000

On 29/05/2020 22:52, David Benjamin wrote:
> On Fri, May 29, 2020 at 5:36 PM Jeremy Harris <jgh@wizmail.org> wrote:
> 
>> On 29/05/2020 21:59, David Benjamin wrote:
>>> Moreover, in a client-speaks-first protocol, the error now comes after
>> the
>>> client has already sent its request. This is not only a behavior change
>> but
>>> makes it unreliable over TCP. TCP sees:
>>>
>>>
>>>    1.
>>>
>>>    Client: write(ClientHello);
>>>    2.
>>>
>>>    Server: read(ClientHello); write(ServerHello..Finished);
>>>    3.
>>>
>>>    Client: read(ServerHello..Finished); write(Certificate..Finished);
>>>    4.
>>>
>>>    Server: read(Certificate..Finished); write(bad_certificate); close();
>>
>> Rather than close(), the server should shutdown(SHUT_WR)
>>
>>>    5.
>>>
>>>    Client: write(“GET / ...”); read(???);
>>>
>>>
>>> Note (4) and (5) happen in parallel. Ideally ??? would be a
>> bad_certificate
>>> alert, but it is sometimes a TCP reset. I’m not a TCP expert, but I
>> believe
>>> this is because the client writes data (“GET / ...”) the server never
>>> consumes.
>>
>> ... because, having solely notified that it will send no more, the
>> server is free to continue to read from the socket.
>>
> 
> The server's application logic has no reason to continue to read from the
> socket.

Perhaps not, though I suggest it is valuable to it for debug and
development to be able to see the client's reaction to the shutdown.

However, you ignored the value of the shutdown() action not resulting
in a RST.  That means that the client view becomes deterministic;
your "read(???)" in the close/RST scenario becomes
"read(error, ALERT:bad cert)".
-- 
Cheers,
  Jeremy


-- 
Cheers,
  Jeremy