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

David Mazieres <dm-list-tcpcrypt@scs.stanford.edu> Sun, 23 August 2015 06:12 UTC

Return-Path: <dm-list-tcpcrypt@scs.stanford.edu>
X-Original-To: tcpinc@ietfa.amsl.com
Delivered-To: tcpinc@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 3A8A91AC419 for <tcpinc@ietfa.amsl.com>; Sat, 22 Aug 2015 23:12:09 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: YES
X-Spam-Score: 5.89
X-Spam-Level: *****
X-Spam-Status: Yes, score=5.89 tagged_above=-999 required=5 tests=[BAYES_50=0.8, HK_RANDOM_ENVFROM=0.001, HK_RANDOM_FROM=1, J_CHICKENPOX_16=0.6, J_CHICKENPOX_37=0.6, J_CHICKENPOX_39=0.6, MANGLED_BACK=2.3, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01] autolearn=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 PzjMEf-nxMQl for <tcpinc@ietfa.amsl.com>; Sat, 22 Aug 2015 23:12:08 -0700 (PDT)
Received: from market.scs.stanford.edu (www.scs.stanford.edu [IPv6:2001:470:806d:1::9]) (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 31EF71AC417 for <tcpinc@ietf.org>; Sat, 22 Aug 2015 23:12:08 -0700 (PDT)
Received: from market.scs.stanford.edu (localhost.scs.stanford.edu [127.0.0.1]) by market.scs.stanford.edu (8.14.7/8.14.7) with ESMTP id t7N6C6o5018923; Sat, 22 Aug 2015 23:12:06 -0700 (PDT)
Received: (from dm@localhost) by market.scs.stanford.edu (8.14.7/8.14.7/Submit) id t7N6C5bg002607; Sat, 22 Aug 2015 23:12:05 -0700 (PDT)
X-Authentication-Warning: market.scs.stanford.edu: dm set sender to dm-list-tcpcrypt@scs.stanford.edu using -f
From: David Mazieres <dm-list-tcpcrypt@scs.stanford.edu>
To: Watson Ladd <watsonbladd@gmail.com>
In-Reply-To: <CACsn0ckQskjLqo0=YfJrmBEsyCaq0jpcSzGUwKhRo0BzzQ=wDA@mail.gmail.com>
References: <CABcZeBNEFVkDi38y3G-C2nQF=dzW2mGDsj5DVK_OKVkPwK=G0g@mail.gmail.com> <878u92oadf.fsf@ta.scs.stanford.edu> <CACsn0ckQskjLqo0=YfJrmBEsyCaq0jpcSzGUwKhRo0BzzQ=wDA@mail.gmail.com>
Date: Sat, 22 Aug 2015 23:12:05 -0700
Message-ID: <871teuo7nu.fsf@ta.scs.stanford.edu>
MIME-Version: 1.0
Content-Type: text/plain
Archived-At: <http://mailarchive.ietf.org/arch/msg/tcpinc/GX30ZtWblVPVoQSX8BARhVpu838>
Cc: tcpinc <tcpinc@ietf.org>
Subject: Re: [tcpinc] Review of draft-bittau-tcpinc-tcpeno-01
X-BeenThere: tcpinc@ietf.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: "Discussion list for adding encryption to TCP." <tcpinc.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/tcpinc>, <mailto:tcpinc-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/tcpinc/>
List-Post: <mailto:tcpinc@ietf.org>
List-Help: <mailto:tcpinc-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/tcpinc>, <mailto:tcpinc-request@ietf.org?subject=subscribe>
X-List-Received-Date: Sun, 23 Aug 2015 06:12:09 -0000

Watson Ladd <watsonbladd@gmail.com> 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.

>> 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.

David