Re: [TLS] new version of draft-dthakore-tls-authz

Darshak Thakore <d.thakore@cablelabs.com> Mon, 28 January 2013 01:12 UTC

Return-Path: <d.thakore@cablelabs.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 8EF7A21F8F30 for <tls@ietfa.amsl.com>; Sun, 27 Jan 2013 17:12:10 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -0.462
X-Spam-Level:
X-Spam-Status: No, score=-0.462 tagged_above=-999 required=5 tests=[BAYES_00=-2.599, HELO_EQ_MODEMCABLE=0.768, HOST_EQ_MODEMCABLE=1.368, HTML_MESSAGE=0.001]
Received: from mail.ietf.org ([64.170.98.30]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id sc5J6zZKUU3l for <tls@ietfa.amsl.com>; Sun, 27 Jan 2013 17:12:09 -0800 (PST)
Received: from ondar.cablelabs.com (ondar.cablelabs.com [192.160.73.61]) by ietfa.amsl.com (Postfix) with ESMTP id 7EDBC21F8D75 for <tls@ietf.org>; Sun, 27 Jan 2013 17:12:07 -0800 (PST)
Received: from kyzyl.cablelabs.com (kyzyl [10.253.0.7]) by ondar.cablelabs.com (8.14.5/8.14.5) with ESMTP id r0S1C5g4017665 for <tls@ietf.org>; Sun, 27 Jan 2013 18:12:05 -0700
Received: from exchange.cablelabs.com (10.5.0.19) by kyzyl.cablelabs.com (F-Secure/fsigk_smtp/407/kyzyl.cablelabs.com); Sun, 27 Jan 2013 18:12:05 -0700 (MST)
X-Virus-Status: clean(F-Secure/fsigk_smtp/407/kyzyl.cablelabs.com)
Received: from EXCHANGE.cablelabs.com ([fe80::797a:96d1:3c53:18ee]) by EXCHANGE.cablelabs.com ([fe80::797a:96d1:3c53:18ee%11]) with mapi id 14.02.0328.009; Sun, 27 Jan 2013 18:12:05 -0700
From: Darshak Thakore <d.thakore@cablelabs.com>
To: "tls@ietf.org" <tls@ietf.org>
Thread-Topic: [TLS] new version of draft-dthakore-tls-authz
Thread-Index: AQHN+lww1j1ydBJL9UG687qxsPpFQJhZd/0AgAR8PwA=
Date: Mon, 28 Jan 2013 01:12:05 +0000
Message-ID: <0E515E8C52A54F4DBDF51AB79386333517F3EC6B@EXCHANGE.cablelabs.com>
In-Reply-To: <003601cdfa7b$af477670$0dd66350$@redphonesecurity.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
user-agent: Microsoft-MacOutlook/14.2.5.121010
x-originating-ip: [10.5.0.27]
Content-Type: multipart/alternative; boundary="_000_0E515E8C52A54F4DBDF51AB79386333517F3EC6BEXCHANGEcablela_"
MIME-Version: 1.0
X-Approved: ondar
Subject: Re: [TLS] new version of draft-dthakore-tls-authz
X-BeenThere: tls@ietf.org
X-Mailman-Version: 2.1.12
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: <http://www.ietf.org/mail-archive/web/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, 28 Jan 2013 01:12:11 -0000

Hi Mark,

Thanks for the feedback and the link to the paper. I agree that the dtcp_authz_data structure currently defined excludes the RandomNonce (or the equivalent running hash as you suggested) out of the signature and it should have included it. I can update the struct accordingly. Given that modification, would there still be a need to put in a running hash of all the messages?
My primary concern with including a running hash in the struct is that this structure is a payload of the SupplementalData message and as per RFC4680, it is an application's responsibility to provide this information. I'm not sure if we can assume that an application always has access to all messages at the TLS protocol layer.

Also one point of clarification, the client will not be generating its own nonce, rather it will take the nonce it has received from the server in the server's SupplementalData message and include it in its own SupplementalData message.

With that modification, the struct would be something like

      struct {
          opaque random_bytes[32];
      } RandomNonce;

      struct {
          RandomNonce nonce;
          opaque DTCPCert<1..2^24-1>;
          opaque ASN.1Cert<0..2^24-1>;
      } DigitallySigned;

      struct {
          DigitallySigned certs;
          opaque signature[40];
      } dtcp_authz_data;

When the server sends this in its SupplementalData message, it will generate the RandomNonce. When the client sends back its own SupplementalData message, it will include the one it received from the server.

With that, if we only consider the scenario of the client sending its DTCP Certificate, there are two possible options, one in which the client is also using its X.509 certificate (i.e. it will send its ClientCertificate and CertificateVerify messages also) and the other is where the client does not have an X.509 certificate to send.
For the first case, an example exchange would be something like:

  1.  Client sends ClientHello, Server Sends ServerHello
  2.  Server sends SupplementalData that only has a RandomNonce (N1)
  3.  Server sends Certificate, CertificateRequest and ServerHelloDone
  4.  Client sends SupplementalData that has [(N1, DTCP Cert, X.509 Cert) Signature covering all three elements]
  5.  Client sends Certificate message (needs to be the same X.509 Cert as above)
  6.  Client sends ClientKeyExchange, ChangeCipherSpec and Finished
  7.  Server sends ChangeCipherSpec and Finished

Would this address the replay attack?

Regards,
Darshak


From: Mark Brown <mark@redphonesecurity.com<mailto:mark@redphonesecurity.com>>
Date: Thursday, January 24, 2013 2:42 PM
To: Darshak Thakore <d.thakore@cablelabs.com<mailto:d.thakore@cablelabs.com>>, "tls@ietf.org<mailto:tls@ietf.org>" <tls@ietf.org<mailto:tls@ietf.org>>
Subject: RE: [TLS] new version of draft-dthakore-tls-authz

Hi Darshak,

I’m still concerned with replay attacks, despite the updates.

The structures in 3.2 haven’t changed materially, and the explanations make me more sure there’s this problem: the specified RandomNonce won’t prevent replay attacks. You might consider prior protocol analyses, for example this paper: http://www2.cs.uidaho.edu/~jimaf/papers/replay02.pdf

To (over)simplify, follow the example of TLS CertificateVerify used for client authentication: instead of an arbitrary nonce, take a hash over *all* of the handshake messages sent/received so far (i.e. the output from the hash function run over these concatenated messages). Doing so gives a more useful session-identifying  “nonce”. Since the session messages “so far at this point” include client nonce, server nonce and server certificate, I’d estimate that you’ve overcome the 1995 Lowe attack (see http://en.wikipedia.org/wiki/Needham%E2%80%93Schroeder_protocol#Fixing_the_man-in-the-middle_attack ).

How to say this well? The text for CV gives a template, see: http://tools.ietf.org/html/rfc5246#section-7.4.8.
Your structures might be:

                The set of all Handshake Messages in the run so far, using http://tools.ietf.org/html/rfc5246#section-7.4 :

         handshake_hash      = Hash(handshake_messages);

                Your client_authz must contain an assertion as a component, such as:
         struct {
             opaque handshake_hash[hash_length];
             opaque DTCPCert<1..2^24-1>;
             [[opaque ASN.1Cert<1..2^24-1>]];
         } DTCPClientAssertion;

                Your client_authz SupplementalData message should contain the assertion plus its signature, e.g.:

         assertion_hash      = Hash(DTCPClientAssertion);

         signature          = ECDSA_Sign(assertion_hash);

         struct {
             DTCPClientAuthz client_assertion;
             opaque signature<1..2^16-1>;
         } dtcp_authz_data;


This last struct is very similar to http://tools.ietf.org/html/rfc5246#section-4.7 “DigitallySigned”, but omits the SignatureAndHashAlgorithm identifier for two reasons: 1) the signature and hash algorithms are DTCP’s not TLS’s and so the registry and code points may differ 2) the DTCPClientAssertion.DTCPCert should contain this information, and currently it’s a mandatory-include part of the message.

At this point, I’ve only presented an assertion that’s appropriate for client_authz, but I think that’s all that *should* be specified. I would eliminate sending server_authz from the server to the client for your use case.

Sincerely,
mark