Re: [tcpinc] Review of draft-bittau-tcpinc-tcpeno-01

Watson Ladd <> Sun, 23 August 2015 15:37 UTC

Return-Path: <>
Received: from localhost ( []) by (Postfix) with ESMTP id 4338F1A8A3C for <>; Sun, 23 Aug 2015 08:37:15 -0700 (PDT)
X-Virus-Scanned: amavisd-new at
X-Spam-Flag: NO
X-Spam-Score: 4.8
X-Spam-Level: ****
X-Spam-Status: No, score=4.8 tagged_above=-999 required=5 tests=[BAYES_50=0.8, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, J_CHICKENPOX_16=0.6, J_CHICKENPOX_37=0.6, J_CHICKENPOX_39=0.6, MANGLED_BACK=2.3, SPF_PASS=-0.001] autolearn=no
Received: from ([]) by localhost ( []) (amavisd-new, port 10024) with ESMTP id X48P2Bcmks7Z for <>; Sun, 23 Aug 2015 08:37:13 -0700 (PDT)
Received: from ( [IPv6:2a00:1450:400c:c05::22d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by (Postfix) with ESMTPS id 895F81A8A3B for <>; Sun, 23 Aug 2015 08:37:13 -0700 (PDT)
Received: by wicja10 with SMTP id ja10so52018725wic.1 for <>; Sun, 23 Aug 2015 08:37:12 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=P1CF0YrVettQvE0TzLsfS3ZQaVAX/54riX8WU5FXawU=; b=ZW4tC2HEkuVt7+xIvL1NY1loi6r8VCY4Vz22ZorohfryQI7Nu00rWTbu1HDOhI69i0 KFIsftYkXCKEzoL3xrGOZd3/0eLlU6q0gfCVIMASEAe0+kakHBayO1eouqjQgwSY3wQt /quQHV2weITSSgWWQcrRiDYegGI7+VTmmuYzlLzNV+TrM6oHZpiEIF4UfRpJ946aI8oC SHvS2RPHX56QPD7VK6vPcccTH1leePuXNxu7Gvirb6lrcpX5A5bzUQweIKncBcETgdlt nTPbcKJxzitlaUOUOZq5nNJh+eMH/+6jU2n6nUjNX2ydIY3oDRq5Xc0G38wEY80Sgw/4 0ahA==
MIME-Version: 1.0
X-Received: by with SMTP id t7mr32724084wjq.45.1440344232247; Sun, 23 Aug 2015 08:37:12 -0700 (PDT)
Received: by with HTTP; Sun, 23 Aug 2015 08:37:12 -0700 (PDT)
In-Reply-To: <>
References: <> <> <> <>
Date: Sun, 23 Aug 2015 08:37:12 -0700
Message-ID: <>
From: Watson Ladd <>
To: David Mazieres <>
Content-Type: text/plain; charset="UTF-8"
Archived-At: <>
Cc: tcpinc <>
Subject: Re: [tcpinc] Review of draft-bittau-tcpinc-tcpeno-01
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: "Discussion list for adding encryption to TCP." <>
List-Unsubscribe: <>, <>
List-Archive: <>
List-Post: <>
List-Help: <>
List-Subscribe: <>, <>
X-List-Received-Date: Sun, 23 Aug 2015 15:37:15 -0000

On Sat, Aug 22, 2015 at 11:12 PM, David Mazieres
<> wrote:
> Watson Ladd <> writes:
>> Let's imagine the stupidest possible protocol: each party squeezes 32
>> bytes into each SYN, representing a Curve25519 public key, and
>> we compute H(agreed key || lexographically least || lexographically
>> greater) . This protocol supports simultaneous open. So why can't a
>> more complicated protocol do the same?
> What you describe about lexicographically least is a proprety of the
> encryption spec.  The question ENO addresses is how to negotiate that
> spec in the first place.  Suppose suboptDHE does what you describe and
> suboptA is TCPINC (e.g., something derived from tcpcrypt or
> TCP-use-TLS).  Now consider the following simultaneous open:
>   A->B: SYN ENO<suboptA, suboptDHE key-material>
>   B->A: SYN ENO<suboptDHE key-material>, ENO<suboptA>
> Keeping in mind that the above two messages were sent concurrently,
> which spec should ENO chose:  A or DHE?  The current draft says pick the
> first spec in whichever SYN segment has the b flag set, and disable
> encryption unless exactly one SYN segment has the b flag set.

So 50% of the time, encryption fails between two parties both
supporting the spec, when using simultaneous open. Why not impose a
fixed ordering on all possible options and use the best mutually
supported option, aka versioning?

>>> If by resolve simultaneous open you mean not support it, I agree.  But
>>> if you mean something else, then things can get tricky.  I would
>>> welcome a detailed design that works, but just saying "do something
>>> like ALPN" is not enough detail to determine whether or not that
>>> approach is viable.  We'd need to see an "A -> B: ... B -> A: ..."-
>>> style example with TCP flags.
>> How often is simultaneous open used? Are there important applications
>> we won't encrypt if we kill it?
> It is probably used mostly by NAT-piercing applications.  The timing is
> actually hard to get right if you don't have NATs involved to drop SYN
> segments that would otherwise trigger resets.  I wish I had more data on
> this.
>>>    A -> B:  SYN     X
>>>    B -> A:  SYN-ACK X' which depends on X
>>>    A -> B:  ACK     X'' which depends on X and X' and might disable TCPINC
>>> With simultaneous open, you have two pairs of messages sent in parallel:
>>>    A -> B:  SYN X
>>>    B -> A:  SYN Y
>>>    A -> B:  SYN-ACK X' which depends on X and Y, but not X' or Y'
>>>    B -> A:  SYN-ACK Y' which depends on X and Y, but not X' or Y'
>>> So in particular B does not have the opportunity to abort TCPINC in
>>> response to X', but must decide it based on X and Y.  That's why TCP-ENO
>>> determines the spec based only on the first ENO option sent by each
>>> side.
>> But what do you need the other ones for in that case? If they just
>> contain keying material, you probably want to specialize them to that
>> case.
> I don't understand your comment.  By "the other ones", do you mean the
> contents of packets X' and Y' in the simultaneous open scenario?  With
> TCP-ENO you don't need those contents (just the one bit that the option
> got through and was acceptable).
> The context of the example was a response to a comment from EKR about
> why not eliminate the tie-breaker bit "b" and have B chose one of the
> active opener's encryption specs.  I can't see a way to make EKR's
> suggestion work without embedding meaningful data in X'.  And the
> problem I was pointing out is that the other side must commit to TCPINC
> before seeing the contents of X'.
> But I may have misunderstood your question.
> For context, keep in mind that, while we would like to leave open the
> possibility of embedding a DH key exchange in the SYN options, this
> cannot be the only solution to TCPINC, because 32-byte curves may stop
> being secure before we get large options in SYN segments (not to mention
> middlebox problems of inevitably compressing SACK, TIMESTAMP, etc., to a
> supported-option bit-vectorj.  So we need a more general
> forward-compatible negotiation option.  To avoid a circular dependency,
> the negotiation needs to proceed independently of the particular
> encryption spec.

My question is as follows: If we're willing to add half an RTT of
latency because we can't put key material in the first flight,
we can do the following exchange in the following manner
A->B "I can speak X,Y,Z"
B->A: "X, and here is my key share"
A->B: "here is my key share".

In the simultaneous case we can do: (using ; as sequencing mark)
A->B: "I speak X, Y, Z"
B->A: "I speak X,Y,Z";
A->B: "My key"
B->A "My key"

A and B both know that X, Y, Z are ordered, and so can agree.
Now, both kinds of message are completely different, and so shouldn't
be variations on the same kind to avoid attacks based on confusing SYN
with SYN-ACK.

> David

"Man is born free, but everywhere he is in chains".