Re: [TLS] Length of a variable-length vector: Could it be an odd multiple?

Benjamin Kaduk <bkaduk@akamai.com> Wed, 13 January 2016 20:53 UTC

Return-Path: <bkaduk@akamai.com>
X-Original-To: tls@ietfa.amsl.com
Delivered-To: tls@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id D9A661B3264 for <tls@ietfa.amsl.com>; Wed, 13 Jan 2016 12:53:28 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.702
X-Spam-Level:
X-Spam-Status: No, score=-2.702 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001] autolearn=ham
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 r1hFFaDsSze3 for <tls@ietfa.amsl.com>; Wed, 13 Jan 2016 12:53:27 -0800 (PST)
Received: from prod-mail-xrelay07.akamai.com (prod-mail-xrelay07.akamai.com [23.79.238.175]) by ietfa.amsl.com (Postfix) with ESMTP id 904061B3253 for <tls@ietf.org>; Wed, 13 Jan 2016 12:53:27 -0800 (PST)
Received: from prod-mail-xrelay07.akamai.com (localhost.localdomain [127.0.0.1]) by postfix.imss70 (Postfix) with ESMTP id A71E6433446; Wed, 13 Jan 2016 20:53:26 +0000 (GMT)
Received: from prod-mail-relay10.akamai.com (prod-mail-relay10.akamai.com [172.27.118.251]) by prod-mail-xrelay07.akamai.com (Postfix) with ESMTP id 8F4AE433437; Wed, 13 Jan 2016 20:53:26 +0000 (GMT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=akamai.com; s=a1; t=1452718406; bh=ZQG3UlhRd4+jrdr1UDKezgEEFn79eFPMNf0JdR/VbCE=; l=535; h=To:References:From:Date:In-Reply-To:From; b=ij/zm+aXp4L8PvMPa/oRV/N5azVHj3jHIvHC6wFEZ/rll56wfzzlsKLkxFmYmxeoY kAea5TuJjtINOjzOrPNvCEMvqAwvFf+H9bWBb3e2gg/lWhLkfIWwne8juthQxz/AoD ip5N+ZoAA+jLO8Vk/+3HwZ6525BL4T2n8FUsFV6E=
Received: from [172.19.0.25] (bos-lpczi.kendall.corp.akamai.com [172.19.0.25]) by prod-mail-relay10.akamai.com (Postfix) with ESMTP id 54DB92026; Wed, 13 Jan 2016 20:53:26 +0000 (GMT)
To: Jong-Shian Wu <js@crypto.tw>, tls@ietf.org
References: <CA+_zv04F0EiLdcbkhyNo9P8dR3BW3JAsDys_WKFXXUW92x=LcQ@mail.gmail.com>
From: Benjamin Kaduk <bkaduk@akamai.com>
Message-ID: <5696B946.3050405@akamai.com>
Date: Wed, 13 Jan 2016 14:53:26 -0600
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0
MIME-Version: 1.0
In-Reply-To: <CA+_zv04F0EiLdcbkhyNo9P8dR3BW3JAsDys_WKFXXUW92x=LcQ@mail.gmail.com>
Content-Type: text/plain; charset=windows-1252
Content-Transfer-Encoding: 7bit
Archived-At: <http://mailarchive.ietf.org/arch/msg/tls/573F8ckZaiLZ5sh0EQ3OUmThst4>
Subject: Re: [TLS] Length of a variable-length vector: Could it be an odd multiple?
X-BeenThere: tls@ietf.org
X-Mailman-Version: 2.1.15
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: <https://mailarchive.ietf.org/arch/browse/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, 13 Jan 2016 20:53:29 -0000

On 01/13/2016 02:44 PM, Jong-Shian Wu wrote:
> I have a question about the even-vs-odd restrictions on the length of
> a valid variable-length vector defined in TLS specification after
> reading the section 4.3 of RFC 5246 [1] which states that: "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)."
>

It means "whole-number" as opposed to fractional, i.e., there should not
be unused "junk bytes" at the end.

-Ben