<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE rfc SYSTEM 'rfc2629.dtd' []>
<rfc ipr="trust200902" category="info" docName="draft-ietf-tcpinc-api-01">
<?rfc toc="yes"?>
<?rfc symrefs="yes"?>
<?rfc sortrefs="yes"?>
<?rfc compact="yes"?>
<?rfc subcompact="no"?>
<?rfc private=""?>
<?rfc topblock="yes"?>
<?rfc comments="no"?>
<front>
<title abbrev="tcpinc-api">Interface Extensions for TCP-ENO and tcpcrypt</title>

<author initials="A." surname="Bittau" fullname="Andrea Bittau">
<organization>Google</organization>
<address>
<postal>
<street>345 Spear Street</street>
<city>San Francisco, CA</city>
<code>94105</code>
<country>US</country>
<region></region>
</postal>
<phone></phone>
<email>bittau@google.com</email>
<uri></uri>
</address>
</author>
<author initials="D." surname="Boneh" fullname="Dan Boneh">
<organization>Stanford University</organization>
<address>
<postal>
<street>353 Serra Mall, Room 475</street>
<city>Stanford, CA</city>
<code>94305</code>
<country>US</country>
<region></region>
</postal>
<phone></phone>
<email>dabo@cs.stanford.edu</email>
<uri></uri>
</address>
</author>
<author initials="D." surname="Giffin" fullname="Daniel B. Giffin">
<organization>Stanford University</organization>
<address>
<postal>
<street>353 Serra Mall, Room 288</street>
<city>Stanford, CA</city>
<code>94305</code>
<country>US</country>
<region></region>
</postal>
<phone></phone>
<email>dbg@scs.stanford.edu</email>
<uri></uri>
</address>
</author>
<author initials="M." surname="Handley" fullname="Mark Handley">
<organization>University College London</organization>
<address>
<postal>
<street>Gower St.</street>
<city>London</city>
<code>WC1E 6BT</code>
<country>UK</country>
<region></region>
</postal>
<phone></phone>
<email>M.Handley@cs.ucl.ac.uk</email>
<uri></uri>
</address>
</author>
<author initials="D." surname="Mazieres" fullname="David Mazieres">
<organization>Stanford University</organization>
<address>
<postal>
<street>353 Serra Mall, Room 290</street>
<city>Stanford, CA</city>
<code>94305</code>
<country>US</country>
<region></region>
</postal>
<phone></phone>
<email>dm@uun.org</email>
<uri></uri>
</address>
</author>
<author initials="E." surname="Smith" fullname="Eric W. Smith">
<organization>Kestrel Institute</organization>
<address>
<postal>
<street>3260 Hillview Avenue</street>
<city>Palo Alto, CA</city>
<code>94304</code>
<country>US</country>
<region></region>
</postal>
<phone></phone>
<email>eric.smith@kestrel.edu</email>
<uri></uri>
</address>
</author>
<date year="2016" month="October" day="31"/>

<area>Internet</area>
<workgroup></workgroup>
<keyword>tcp</keyword>
<keyword>encryption</keyword>


<abstract>
<t>TCP-ENO and tcpcrypt perform encryption at the transport layer.  They
also define a few parameters that are intended to be used or
configured by applications.  This document specifies operating system
interfaces for access to these parameters.  We describe the interfaces
in terms of socket options, the de facto standard API for adjusting
per-connection behavior in TCP/IP, and sysctl, a popular mechanism for
setting global defaults.  Operating systems that lack socket or sysctl
functionality can implement similar interfaces in their native
frameworks, but should ideally adapt their interfaces from those
presented in this document.
</t>
</abstract>


</front>

<middle>

<section anchor="introduction" title="Introduction">
<t>The TCP Encryption Negotiation Option (TCP-ENO)
<xref target="I-D.ietf-tcpinc-tcpeno"/> permits hosts to negotiate encryption of a
TCP connection.  One of TCP-ENO's use cases is to encrypt traffic
transparently, unbeknownst to legacy applications.  Transparent
encryption requires no changes to existing APIs.  However, other use
cases require applications to interact with TCP-ENO.  In particular:
</t>
<t>
<list style="symbols">
<t>Transparent encryption protects only against passive eavesdroppers.
Stronger security requires applications to authenticate a <spanx style="emph">Session
ID</spanx> value associated with each encrypted connection.</t>
<t>Applications that have been updated to authenticate Session IDs must
somehow advertise this fact to peers in a backward-compatible way.
TCP-ENO carries an &quot;application-aware&quot; bit for this purpose, but the
bit is not accessible through existing interfaces.</t>
<t>Applications employing TCP's simultaneous open feature need a way to
configure a passive-role bit to break symmetry for TCP-ENO.</t>
<t>System administrators and applications may wish to set and examine
negotiation preferences, such as which encryption schemes (and
perhaps versions) to enable and disable.</t>
<t>Applications that perform their own encryption may wish to disable
TCP-ENO entirely.</t>
</list>
</t>
<t>The tcpcrypt protocol <xref target="I-D.ietf-tcpinc-tcpcrypt"/> may be negotiated
via TCP-ENO, and can operate without configuration.  But users may
wish to control a few operational details of the protocol:
</t>
<t>
<list style="symbols">
<t>Users or system administrators may wish to specify which symmetric
ciphers they accept or prefer, or to inspect which cipher has been
negotiated for a particular connection.  (The key-exchange schemes
used by tcpcrypt may be configured via the TCP-ENO API.)</t>
<t>If connection tampering has been detected via session authentication
failure, it may be prudent to purge cached session keys.</t>
</list>
</t>
<t>The remainder of this document describes APIs through which systems
can meet the above needs.  The API extensions relate back to
quantities defined by TCP-ENO and tcpcrypt.
</t>
</section>

<section anchor="tcpeno-api-extensions" title="TCP-ENO API extensions">
<t>This section describes an API for per-connection options, followed by
a discussion of system-wide configuration options.
</t>

<section anchor="perconnection-options" title="Per-connection options">
<t><xref target="tab-sockopt"/> summarizes a set of options that TCP-ENO
implementations should provide on a per-socket basis.  For each
option, the table lists whether it is read-only (R) or read-write
(RW), as well as the type of the option's value.  Read-write options,
when read, always return the previously successfully written value or
the default if they have not been written.  Options of type <spanx style="verb">bytes</spanx>
consist of a variable-length array of bytes, while options of type
<spanx style="verb">int</spanx> consist of a small integer with the exact range indicated in
parentheses.  We discuss each option in more detail below.
</t>
<texttable anchor="tab-sockopt" title="Suggested per-connection options
">
<ttcol align="left">Option name</ttcol>
<ttcol align="left">RW</ttcol>
<ttcol align="left">Type</ttcol>

<c>TCP_ENO_ENABLED</c><c>RW</c><c>int (-1, 0, or 1)</c>
<c>TCP_ENO_SESSID</c><c>R</c><c>bytes</c>
<c>TCP_ENO_NEGSPEC</c><c>R</c><c>int (32-127, 160-255)</c>
<c>TCP_ENO_SPECS</c><c>RW</c><c>bytes</c>
<c>TCP_ENO_SELF_GOPT</c><c>RW</c><c>int (0-31)</c>
<c>TCP_ENO_PEER_GOPT</c><c>R</c><c>int (0-31)</c>
<c>TCP_ENO_AA_MANDATORY</c><c>RW</c><c>int (0 or 1)</c>
<c>TCP_ENO_ROLE</c><c>R</c><c>int (0 or 1)</c>
<c>TCP_ENO_SELF_NAME</c><c>R</c><c>bytes</c>
<c>TCP_ENO_PEER_NAME</c><c>R</c><c>bytes</c>
<c>TCP_ENO_RAW</c><c>RW</c><c>bytes</c>
<c>TCP_ENO_TRANSCRIPT</c><c>R</c><c>bytes</c>
</texttable>
<t>The socket options must return errors under certain circumstances.
These errors are mapped to three suggested error codes shown in
<xref target="tab-errors"/>.  Systems based on sockets already have constants for
these errors.  Non-socket systems should use existing error codes
corresponding to the same conditions.  <spanx style="verb">EINVAL</spanx> is the existing error
returned when attempting to set options or otherwise operate on a
closed socket.  <spanx style="verb">EISCONN</spanx> corresponds to calling connect a second
time, while <spanx style="verb">ENOTCONN</spanx> corresponds to requesting the peer address of
an unconnected socket.
</t>
<texttable anchor="tab-errors" title="Suggested error codes
">
<ttcol align="left">Symbol</ttcol>
<ttcol align="left">Description</ttcol>

<c>EINVAL</c><c>General error signifying bad parameters</c>
<c>EISCONN</c><c>Option no longer valid because connection established</c>
<c>ENOTCONN</c><c>Option not (yet) valid because no connection established</c>
</texttable>
<t>Unless otherwise specified, all of the read-only options (R) return an
error if ENO is disabled (<spanx style="verb">EINVAL</spanx>), the connection is not yet
established (<spanx style="verb">ENOTCONN</spanx>), the connection is established and ENO failed
to negotiate encryption (<spanx style="verb">EINVAL</spanx>), or the connection is in raw mode
(<spanx style="verb">EINVAL</spanx>).
</t>
<t>
<list style="hanging">
<t hangText="TCP_ENO_ENABLED">
<vspace />
When set to 0, completely disables TCP-ENO regardless of any other
socket option settings except <spanx style="verb">TCP_ENO_RAW</spanx>.  When set to 1, enables
TCP-ENO.  When set to -1, uses a system-wide default determined at the
time of an <spanx style="verb">accept</spanx> or <spanx style="verb">connect</spanx> system call, as described in
<xref target="global-options"/>.  This option must return an error (<spanx style="verb">EISCONN</spanx>) after
a SYN segment has already been sent.</t>
<t hangText="TCP_ENO_SESSID">
<vspace />
Returns the session ID of the connection, as defined by the
encryption spec in use.</t>
<t hangText="TCP_ENO_NEGSPEC">
<vspace />
Returns a byte in which the lower 7 bits correspond to the spec
identifier of the negotiated encryption spec for the current
connection, and the high bit is 1 if there was suboption data present.
As defined by TCP-ENO, the negotiated spec is the last valid TEP
suboption in the SYN segment sent by host &quot;B&quot;.</t>
<t hangText="TCP_ENO_SPECS">
<vspace />
Allows the application to specify an ordered list of encryption
specs different from the system default list.  If the list is empty,
TCP-ENO is disabled for the connection.  Each byte in the list
specifies one suboption type from 0x20-0x7f (32-127).  For future
extensibility, the high bit (<spanx style="verb">v</spanx>) in these bytes should be set to 0 by
applications and ignored by implementations.  The order of the list
matters only for the host playing the &quot;B&quot; role.  Implementations must
return an error (<spanx style="verb">EISCONN</spanx>) if an application attempts to set this
option after the SYN segment has been sent.  Implementations should
return an error (<spanx style="verb">EINVAL</spanx>) if any of the bytes are below 0x20, are
between 0x80-0xa0, or are not implemented by the TCP stack.</t>
<t hangText="TCP_ENO_SELF_GOPT">
<vspace />
Sets the 5-bit value of the hosts global suboption.  The default
value should initially be 0.  In accordance the ENO specification,
regardless of any value set by the application, the least significant
bit--termed the <spanx style="emph">passive role bit</spanx>--is forced to 1 when a connection
is configured for passive open (i.e., following a <spanx style="verb">listen</spanx> call).
Implementations must return an error (<spanx style="verb">EISCONN</spanx>) if an application
attempts to set this option after a SYN segment has been sent.</t>
<t hangText="TCP_ENO_AA_MANDATORY">
<vspace />
If set to 1, enables mandatory application-aware mode in which the
local host will disable TCP-ENO unless the remote host has set the
application-aware bit (the second-least significant bit in its global
suboption).  The default value is 0.  Implementations must return an
error (<spanx style="verb">EISCONN</spanx>) if an application attempts to set this option after
a SYN segment has been sent.</t>
<t hangText="TCP_ENO_PEER_GOPT">
<vspace />
Returns an integer from 0-31 reporting the value of the global
suboption in the peer's SYN segment.</t>
<t hangText="TCP_ENO_ROLE">
<vspace />
Returns 0 on host &quot;A&quot; and 1 on host &quot;B&quot;, according to the roles
defined by TCP-ENO.  When successful, the value is always equal to the
least significant bit of the value returned by TCP_ENO_SELF_GOPT.</t>
<t hangText="TCP_ENO_SELF_NAME">
<vspace />
Returns one byte containing the value of TCP_ENO_ROLE (0 or 1)
prepended to the TCP_ENO_SESSID, thereby providing a unique name for
the local end of the connection.</t>
<t hangText="TCP_ENO_PEER_NAME">
<vspace />
Like TCP_ENO_SELF_NAME, but negates the first byte, thereby
providing a unique name for the remote end of the connection.  (When
successful, TCP_ENO_SELF_NAME at one end of a connection should always
equal TCP_ENO_PEER_NAME at the other.)</t>
<t hangText="TCP_ENO_RAW">
<vspace />
This option is for use by library-level TEP implementations.  It
allows applications to make use of the TCP-ENO option, potentially
including encryption specs not supported by the transport layer, and
then entirely bypass any TCP-level encryption so as to encrypt above
the transport layer.  The default value of this option is a 0-byte
vector, which disables RAW mode.  If the option is set to any other
value, it disables all other socket options described in this section
except for TCP_ENO_TRANSCRIPT.
<vspace/>

<vspace/>
The value of the option is a raw ENO option contents (without the kind
and length) to be included in the host's SYN segment.  In raw mode,
the TCP layer considers negotiation successful when the two SYN
segments both contain a suboption with the same encryption spec value
<spanx style="verb">cs</spanx> &gt;= 0x20.  For an active opener in raw mode, the TCP layer
automatically sends a two-byte minimal ENO option when negotiation is
successful.  Note that raw mode performs no sanity checking on the <spanx style="verb">v</spanx>
bits or any suboption data, and hence provides slightly less
flexibility than a true TCP-level implementation.</t>
<t hangText="TCP_ENO_TRANSCRIPT">
<vspace />
Returns the negotiation transcript as specified by TCP-ENO.
Unlike any of the other read-only options, this option works in
conjunction with TCP_ENO_RAW to allow application-layer encryption to
determine what was negotiated.</t>
</list>
</t>
</section>

<section anchor="global-options" title="Global options">
<t>In addition to these per-socket options, implementations should use a
global configuration mechanism to allow administrators to configure a
default value for <spanx style="verb">TCP_ENO_SPECS</spanx>, as well as default behavior for
when <spanx style="verb">TCP_ENO_ENABLED</spanx> is -1.  These defaults can be system-wide, or
per network namespace on systems that provide network namespaces.
</t>
<t><xref target="tab-sysctls"/> provides a table of suggested parameters.  The type
<spanx style="verb">words</spanx> corresponds to a list of 16-bit unsigned words representing
TCP port numbers (similar to the <spanx style="verb">baddynamic</spanx> sysctls that, on some
operating systems, blacklist automatic assignment of particular port
numbers).
</t>
<texttable anchor="tab-sysctls" title="Suggested global parameters
">
<ttcol align="left">Name</ttcol>
<ttcol align="left">Type</ttcol>

<c>eno_specs</c><c>bytes</c>
<c>eno_enable_connect</c><c>int (0 - 1)</c>
<c>eno_enable_listen</c><c>int (0 - 1)</c>
<c>eno_bad_connect_ports</c><c>words</c>
<c>eno_bad_listen_ports</c><c>words</c>
</texttable>
<t><spanx style="verb">eno_specs</spanx> is simply a string of bytes, and provides the default
value for the <spanx style="verb">TCP_ENO_SPECS</spanx> socket option.  If <spanx style="verb">TCP_ENO_SPECS</spanx> is
non-empty, the remaining sysctls determine whether to attempt TCP-ENO
negotiation when the <spanx style="verb">TCP_ENO_ENABLED</spanx> option is -1 (the default),
using the following rules.
</t>
<t>
<list style="symbols">
<t>On active openers: If <spanx style="verb">eno_enable_connect</spanx> is 0, then TCP-ENO is
disabled.  If the remote port number is in <spanx style="verb">eno_bad_connect_ports</spanx>,
then TCP-ENO is disabled.  Otherwise, the host attempts to use
TCP-ENO.</t>
<t>On passive openers:  If <spanx style="verb">eno_enable_listen</spanx> is 0, then TCP-ENO is
disabled.  Otherwise, if the local port is in
<spanx style="verb">eno_bad_listen_ports</spanx>, then TCP-ENO is disabled.  Otherwise, if the
host receives an SYN segment with an ENO option containing
compatible encryption specs, it attempts negotiation.</t>
</list>
</t>
<t>Because initial deployment may run into issues with middleboxes or
incur slowdown for unnecessary double-encryption, sites may wish to
blacklist particular ports.  For example setting
<spanx style="verb">eno_bad_connect_ports</spanx> to 443,993 would disable ENO encryption on
outgoing connections to ports 443 and 993 (which use application-layer
encryption for HTTP and IMAP, respectively).  If the per-socket
<spanx style="verb">TCP_ENO_ENABLED</spanx> is not -1, it overrides the sysctl values.
</t>
<t>Similarly, on a server, setting <spanx style="verb">eno_bad_listen_ports</spanx> to 443 makes it
possible to disable TCP-ENO for incoming HTTPS connection without
modifying the web server to set <spanx style="verb">TCP_ENO_ENABLED</spanx> to 0.
</t>
</section>
</section>

<section anchor="tcpcrypt-api-extensions" title="tcpcrypt API extensions">
<t>This section recommends further extensions to the API set forth in
<xref target="tcpeno-api-extensions"/> that are specific to the tcpcrypt TEP.
Future TEPs may similarly provide TEP-specific options.
</t>

<section anchor="perconnection-options-1" title="Per-connection options">
<texttable anchor="tab-tcpcrypt-sockopt" title="Suggested per-connection tcpcrypt-specific options
">
<ttcol align="left">Option name</ttcol>
<ttcol align="left">RW</ttcol>
<ttcol align="left">Type</ttcol>

<c>TCP_CRYPT_CONF</c><c>R</c><c>int (0-255)</c>
<c>TCP_CRYPT_CACHE_FLUSH</c><c>W</c><c>int (1)</c>
<c>TCP_CRYPT_ACONF</c><c>RW</c><c>bytes</c>
<c>TCP_CRYPT_BCONF</c><c>RW</c><c>bytes</c>
</texttable>
<t><xref target="tab-tcpcrypt-sockopt"/> summarizes the proposed tcpcrypt-specific
per-connection options.
</t>
<t>
<list style="hanging">
<t hangText="TCP_CRYPT_CONF">
<vspace />
Returns the one-byte specifier for the authenticated encryption
algorithm in use by the connection.</t>
<t hangText="TCP_CRYPT_CACHE_FLUSH">
<vspace />
Setting this option to the value 1 wipes cached session keys as
specified in section &quot;Session caching&quot; of
<xref target="I-D.ietf-tcpinc-tcpcrypt"/>.  Useful if application-level
authentication discovers a man in the middle attack, to prevent the
next connection from using session caching.</t>
<t hangText="TCP_CRYPT_ACONF">
<vspace />
Set of allowed symmetric ciphers (AEAD algorithms) this host
advertises in <spanx style="verb">Init1</spanx> messages.  These bytes are encoded exactly as
the bytes <spanx style="verb">sym-cipher0 ... sym-cipherK</spanx> in section &quot;Key exchange
messages&quot; of <xref target="I-D.ietf-tcpinc-tcpcrypt"/>; that is, each is one of the
<spanx style="verb">sym-cipher</spanx> bytes from the table of AEAD algorithms.  The order of
these bytes is immaterial.</t>
<t hangText="TCP_CRYPT_BCONF">
<vspace />
Order of preference of symmetric ciphers.  These bytes are encoded
in the same way as for <spanx style="verb">TCP_CRYPT_ACONF</spanx> above, except they indicate
the decreasing order of preference used to determine which
<spanx style="verb">sym-cipher</spanx> value to choose when sending an <spanx style="verb">Init2</spanx> message.</t>
</list>
</t>
</section>

<section anchor="global-options-1" title="Global options">
<texttable anchor="tab-tcpcrypt-sysctls" title="Suggested tcrypt-specific global parameters
">
<ttcol align="left">Name</ttcol>
<ttcol align="left">Type</ttcol>

<c>crypt_aconf</c><c>bytes</c>
<c>crypt_bconf</c><c>bytes</c>
</texttable>
<t>System administrators should also be able to set defaults for the
per-socket connection parameters.  <xref target="tab-tcpcrypt-sysctls"/> lists the
system-wide parameters for doing so, which can exist along side the
general ENO parameters described in <xref target="tab-sysctls"/>.
</t>
</section>
</section>

<section anchor="example-api-mappings" title="Example API mappings">
<t>The previous sections presented abstract APIs for per-connection and
global options.  One implementation strategy would be to map these
APIs to existing per-socket and global configuration mechanisms.  By
way of example, this section describes a way to map the per-connection
settings to BSD sockets options and global configuration to the Unix
<spanx style="verb">sysctl</spanx> interface.
</t>

<section anchor="socket-options-for-perconnection-settings" title="Socket options for per-connection settings">
<t>Systems with sockets can allow applications to configure TCP-ENO
through the same mechanism they use for other TCP connection
configuration such as <spanx style="verb">TCP_NODELAY</spanx> <xref target="RFC0896"/>, namely the
<spanx style="verb">getsockopt</spanx> and <spanx style="verb">setsockopt</spanx> system calls shown in <xref target="fig:sockopt"/>.
</t>

<figure anchor="fig:sockopt" align="center" title="Socket option API
"><artwork align="center" type="C">
int getsockopt(int socket, int level, int option_name,
               void *option_value, socklen_t *option_len);

int setsockopt(int socket, int level, int option_name,
               const void *option_value, socklen_t option_len);
</artwork></figure>
<t>Socket-based TCP-ENO implementations can define a set of new
<spanx style="verb">option_name</spanx> values accessible at <spanx style="verb">level</spanx> <spanx style="verb">IPPROTO_TCP</spanx> (generally
defined as 6, to match the IP protocol field), where each entry in
<xref target="tab-sockopt"/> corresponds to a unique <spanx style="verb">option_name</spanx> constant.
</t>
</section>

<section anchor="setting-systemwide-options-with-sysctl" title="Setting System-wide options with sysctl">
<t>User-level implementations of TCP-ENO can use a configuration file to
set global options.  However, such an approach may be awkward for
kernel-based implementations.  Instead, kernel-level implementations
can use the <spanx style="verb">sysctl</spanx> configuration tool.  With this approach, TCP-ENO
parameters should be placed alongside most TCP parameters.  For
example, on BSD derived systems a suitable name would be
<spanx style="verb">net.inet.tcp.eno.specs</spanx>, while on Linux a more appropriate name would
be <spanx style="verb">net.ipv4.tcp_eno_specs</spanx>.
</t>
</section>
</section>

<section anchor="examples" title="Examples">
<t>This section provides examples of how applications might authenticate
session IDs.  Authentication requires exchanging messages over the TCP
connection, and hence is not backwards compatible with existing
application protocols.  To fall back to opportunistic encryption in
the event that both applications have not been updated to authenticate
the session ID, TCP-ENO provides the application-aware bit.  To signal
it has been upgraded to support application-level authentication, an
application should set the second-least significant bit of
<spanx style="verb">TCP_ENO_SELF_GOPT</spanx> before opening a connection.  An application
should then check that <spanx style="verb">TCP_ENO_PEER_GOPT</spanx> has this bit set before
attempting to send authenticators that would otherwise be
misinterpreted as application data.
</t>

<section anchor="cookiebased-authentication" title="Cookie-based authentication">
<t>In cookie-based authentication, a client and server both share a
cryptographically strong random or pseudo-random secret known as a
&quot;cookie&quot;.  Such a cookie is preferably at least 128 bits long.  To
authenticate a session ID using a cookie, each host computes and sends
the following value to the other side:
</t>

<figure align="center"><artwork align="center">
authenticator = PRF(cookie, local-name)
</artwork></figure>
<t>Here <spanx style="verb">PRF</spanx> is a pseudo-random function such as HMAC-SHA-256
<xref target="RFC6234"/>.  <spanx style="verb">local-name</spanx> is the result of the <spanx style="verb">TCP_ENO_LOCAL_NAME</spanx>
socket option.  Each side must verify that the other side's
authenticator is correct.  To do so, software obtains the remote
host's name via the <spanx style="verb">TCP_ENO_PEER_NAME</spanx> socket option.  Assuming the
authenticators are correct, applications can rely on the TCP-layer
encryption for resistance against active network attackers.
</t>
<t>Note that if the same cookie is used in other contexts besides session
ID authentication, appropriate domain separation must be employed,
such as prefixing <spanx style="verb">local-name</spanx> with a unique prefix to ensure
<spanx style="verb">authenticator</spanx> cannot be used out of context.
</t>
</section>

<section anchor="signaturebased-authentication" title="Signature-based authentication">
<t>In signature-based authentication, one or both endpoints of a
connection possess a private signature key the public half of which is
known to or verifiable by the other endpoint.  To authenticate itself,
the host with a private key computes the following signature:
</t>

<figure align="center"><artwork align="center">
authenticator = Sign(PrivKey, local-name)
</artwork></figure>
<t>The other end verifies this value using the corresponding public key.
Whichever side validates an authenticator in this way knows that the
other side belongs to a host that possesses the appropriate signature
key.
</t>
<t>Once again, if the same signature key is used in other contexts
besides session ID authentication, appropriate domain separation
should be employed, such as prefixing <spanx style="verb">local-name</spanx> with a unique
prefix to ensure <spanx style="verb">authenticator</spanx> cannot be used out of context.
</t>
</section>
</section>

<section anchor="security-considerations" title="Security considerations">
<t>The TCP-ENO specification <xref target="I-D.ietf-tcpinc-tcpeno"/> discusses several
important security considerations that this document incorporates by
reference.  The most important one, which bears reiterating, is that
until and unless a session ID has been authenticated, TCP-ENO is
vulnerable to an active network attacker, through either a downgrade
or active man-in-the-middle attack.
</t>
<t>Because of this vulnerability to active network attackers, it is
critical that implementations return appropriate errors as suggested
in this document for socket options when TCP-ENO is not enabled.  An
example of an API design with potentially catastrophic consequences
would be to attempt to communicate TCP-ENO failure by successfully
returning a zero-length or zero-valued session ID.  Equally critical
is that applications must never use these socket options without
checking for errors.
</t>
<t>Applications with high security requirements that rely on TCP-ENO for
security must either fail or fall back to application-layer encryption
if TCP-ENO fails or session ID authentication fails.
</t>
</section>

<section anchor="acknowledgments" title="Acknowledgments">
<t>We are grateful for contributions, help, discussions, and feedback
from the TCPINC working group, including Marcelo Bagnulo, David Black,
Bob Briscoe, Jana Iyengar, Tero Kivinen, Mirja Kuhlewind, Yoav Nir,
Christoph Paasch, Eric Rescorla, Kyle Rose, and Joe Touch.  This work
was partially funded by DARPA CRASH and the Stanford Secure Internet
of Things Project.
</t>
</section>

</middle>
<back>
<references title="Normative References">
<?rfc include="http://xml2rfc.ietf.org/public/rfc/bibxml3/reference.I-D.ietf-tcpinc-tcpcrypt.xml"?>
<?rfc include="http://xml2rfc.ietf.org/public/rfc/bibxml3/reference.I-D.ietf-tcpinc-tcpeno.xml"?>
</references>
<references title="Informative References">
<?rfc include="http://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.0896.xml"?>
<?rfc include="http://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.6234.xml"?>
</references>

</back>
</rfc>
