[TLS] Inconsistency/redundant length encoding of RenegotiationInfo structure

"Brian Smith" <brian@briansmith.org> Thu, 28 January 2010 04:30 UTC

Return-Path: <brian@briansmith.org>
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 603AE28B56A for <tls@core3.amsl.com>; Wed, 27 Jan 2010 20:30:15 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.599
X-Spam-Level:
X-Spam-Status: No, score=-2.599 tagged_above=-999 required=5 tests=[BAYES_00=-2.599]
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 drArcdesZNXv for <tls@core3.amsl.com>; Wed, 27 Jan 2010 20:30:14 -0800 (PST)
Received: from mxout-08.mxes.net (mxout-08.mxes.net [216.86.168.183]) by core3.amsl.com (Postfix) with ESMTP id C4A0E3A6991 for <tls@ietf.org>; Wed, 27 Jan 2010 20:30:13 -0800 (PST)
Received: from T60 (unknown [70.245.70.178]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by smtp.mxes.net (Postfix) with ESMTPSA id 90E93509B4 for <tls@ietf.org>; Wed, 27 Jan 2010 23:30:23 -0500 (EST)
From: Brian Smith <brian@briansmith.org>
To: tls@ietf.org
Date: Wed, 27 Jan 2010 22:30:18 -0600
Message-ID: <000501ca9fd2$9db45470$d91cfd50$@org>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
X-Mailer: Microsoft Office Outlook 12.0
Content-Language: en-us
thread-index: Acqf0pg+dkubdL9jRrepksMr2EMc8A==
Subject: [TLS] Inconsistency/redundant length encoding of RenegotiationInfo structure
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: Thu, 28 Jan 2010 04:30:15 -0000

An "empty" RegenotiationInfo structure is encoded like this:

    0xff 0x01 extension_type
    0x00 0x01 extension_data length
    0x00      redundant length byte

Why does RenegotiationInfo needs this redundant length byte? It seems to me
that it adds nothing except extra code in the implementation--in particular,
more cases that have to be tested.

An empty RFC5077 session ticket extension is encoded like this:

    0x00 0x23 extension_type
    0x00 0x00 extension_data length

An empty server name extension is similarly encoded:

    0x00 0x00 extension_type
    0x00 0x00 extension_data length

The extensions from RFC4366--Server Name Indication, Truncated HMAC, Client
Certificate URL, Trusted CA Key, and Certificate Status extensions are all
encoded like the RFC5077 extension--that is, without a redundant length
byte. I think the RenegotiationInfo extension should be encoded similarly,
because it lets implementations reuse more already-tested parsing code.

To be clear, I'm not talking about just the case where RenegotiationInfo is
empty. The redundant length byte seems to be a useless complication in all
cases.

Regards,
Brian