Re: [TLS] New Cached info draft

Stefan Santesson <stefan@aaa-sec.com> Wed, 31 March 2010 23:26 UTC

Return-Path: <stefan@aaa-sec.com>
X-Original-To: tls@core3.amsl.com
Delivered-To: tls@core3.amsl.com
Received: from localhost (localhost [127.0.0.1]) by core3.amsl.com (Postfix) with ESMTP id CBC753A68FA for <tls@core3.amsl.com>; Wed, 31 Mar 2010 16:26:30 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.696
X-Spam-Level:
X-Spam-Status: No, score=-1.696 tagged_above=-999 required=5 tests=[AWL=0.423, BAYES_00=-2.599, DNS_FROM_OPENWHOIS=1.13, HELO_EQ_SE=0.35, RCVD_IN_DNSWL_LOW=-1]
Received: from mail.ietf.org ([64.170.98.32]) by localhost (core3.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id dpoXur6Xr3s1 for <tls@core3.amsl.com>; Wed, 31 Mar 2010 16:26:30 -0700 (PDT)
Received: from s87.loopia.se (s87.loopia.se [194.9.95.115]) by core3.amsl.com (Postfix) with ESMTP id E5DC83A68CC for <tls@ietf.org>; Wed, 31 Mar 2010 16:26:29 -0700 (PDT)
Received: from s42.loopia.se (s34.loopia.se [194.9.94.70]) by s87.loopia.se (Postfix) with ESMTP id 59E6B33F9EB for <tls@ietf.org>; Thu, 1 Apr 2010 01:27:08 +0200 (CEST)
Received: (qmail 22060 invoked from network); 31 Mar 2010 23:26:58 -0000
Received: from 213-64-142-247-no153.business.telia.com (HELO [192.168.1.16]) (stefan@fiddler.nu@[213.64.142.247]) (envelope-sender <stefan@aaa-sec.com>) by s42.loopia.se (qmail-ldap-1.03) with DES-CBC3-SHA encrypted SMTP for <marsh@extendedsubset.com>; 31 Mar 2010 23:26:58 -0000
User-Agent: Microsoft-Entourage/12.24.0.100205
Date: Thu, 01 Apr 2010 01:26:56 +0100
From: Stefan Santesson <stefan@aaa-sec.com>
To: Marsh Ray <marsh@extendedsubset.com>, tls@ietf.org
Message-ID: <C7D9A6E0.9CA7%stefan@aaa-sec.com>
Thread-Topic: [TLS] New Cached info draft
Thread-Index: AcrRKacNgiOPvdA6fkyqpKkZEHzxrg==
In-Reply-To: <4BB3AD23.5040407@extendedsubset.com>
Mime-version: 1.0
Content-type: text/plain; charset="US-ASCII"
Content-transfer-encoding: 7bit
Subject: Re: [TLS] New Cached info draft
X-BeenThere: tls@ietf.org
X-Mailman-Version: 2.1.9
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/listinfo/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: Wed, 31 Mar 2010 23:26:30 -0000

On 10-03-31 9:14 PM, "Marsh Ray" <marsh@extendedsubset.com> wrote:

>> While Marsh explanation sounded quite reasonable to me,
>> the implementors have a technical advantage of being more
>> accustomed to the TLS spec syntax for defining a vector size:
>> 
>> http://tools.ietf.org/html/rfc5246#section-4.3
> 
> It says:
>>    The length of
>>    an encoded vector must be an even multiple of the length of a single
>>    element (for example, a 17-byte vector of uint16 would be illegal).
> 
> This requirement does not seem to allow a vector to be made up of
> variable-sized elements as in Stefan's suggestion.

I don't believe this is discussing the same thing.

This is discussing an encoded vector, which is different from the min-max
values of the vector.

As long as it is possible to encode the actual value of the vector within
the min-max values, you can encode the vector with appropriate length.

Example:

      opaque A<1..2^24-1>;

      struct {
          A b<0..2^24-1>;
      } C;

Is legal  <3byte b len><<3byte A len><A>..<3byte A len><A>>

(compare with definition of the Certificate handshake message having this
syntax structure)

while:

      opaque A[16];

      struct {
          A b<23..24>;
      } C;

Would be impossible to encode b correctly since no multiple of A (16 bytes)
can be 23 or 24 bytes.

I don't see the buffer overflow issue. If the receiver receives a vector of
greater length than the max value, it should simply discard the data and
fail the handshake. I'm sure this exception case is defined somewhere.

The only issue I can see is whether the suggested max length is sufficient.
I.e. Is it realistic that a client will send more than 102 digest values of
cached objects.

/Stefan