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

"Hodges, Jeff" <> Wed, 20 January 2016 18:47 UTC

Return-Path: <>
Received: from localhost ( []) by (Postfix) with ESMTP id 7D2FD1ACD09 for <>; Wed, 20 Jan 2016 10:47:17 -0800 (PST)
X-Virus-Scanned: amavisd-new at
X-Spam-Flag: NO
X-Spam-Score: -16.302
X-Spam-Status: No, score=-16.302 tagged_above=-999 required=5 tests=[BAYES_20=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, ENV_AND_HDR_SPF_MATCH=-0.5, RCVD_IN_DNSWL_LOW=-0.7, SPF_PASS=-0.001, USER_IN_DEF_DKIM_WL=-7.5, USER_IN_DEF_SPF_WL=-7.5] autolearn=ham
Received: from ([]) by localhost ( []) (amavisd-new, port 10024) with ESMTP id 3ad7Ln1ssjhh for <>; Wed, 20 Jan 2016 10:47:15 -0800 (PST)
Received: from ( []) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by (Postfix) with ESMTPS id BDEF11ACD0F for <>; Wed, 20 Jan 2016 10:47:15 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;;; q=dns/txt; s=pp-dkim1; t=1453315635; x=1484851635; h=from:to:subject:date:message-id:references:in-reply-to: content-id:content-transfer-encoding:mime-version; bh=5SrB2USQih9NDYBYMLHZ7zQmvWhc5+w7KJOCjYwrI/8=; b=nn8LxqTnctsYGw2zNsMo0BkzbkCF3Y3Bmv4HK2BN1VQNUNgi32YnyYnL J3yGSA2SR2P9pDUEdaQO9T/LNsNZ8WPSzxEmlxRFH0PnzosepHQkMNBXx WJ4lImTQRoqlHSFkM2LeBGhV7uBiNY77KDllrmi6kTQaeSC3aAbWC6gGv H5nkY5z1LGqq3HN09ugKjJ1XhyupMly/jouQFE2lwiKsguSQWotboFmh3 9x/hX6Jbk7WVoaLO5fiNQOkWKqJe4m8INKuGzU/TWWaPEeCnpnMNkTqgn H9UNbz1EE8TBDphso3cLJioPR3fekZbjoPMZE4XQO24bo/TcnfPDCOL5p g==;
X-IronPort-AV: E=Sophos;i="5.22,322,1449558000"; d="scan'208";a="9025647"
Received: from unknown (HELO ([]) by with ESMTP; 20 Jan 2016 11:47:14 -0700
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="5.22,322,1449558000"; d="scan'208";a="4583638"
X-CloudService: Office365
Received: from (HELO ([]) by with ESMTP/TLS/AES256-SHA256; 20 Jan 2016 11:47:14 -0700
Received: from ( by ( with Microsoft SMTP Server (TLS) id 15.1.390.13; Wed, 20 Jan 2016 18:47:12 +0000
Received: from ([]) by ([]) with mapi id 15.01.0361.006; Wed, 20 Jan 2016 18:47:12 +0000
From: "Hodges, Jeff" <>
To: Benjamin Kaduk <>, Jong-Shian Wu <>, "" <>
Thread-Topic: [TLS] Length of a variable-length vector: Could it be an odd multiple?
Thread-Index: AQHRTkR4epX27goF9EGhvHqqCgIza58EQ2wA
Date: Wed, 20 Jan 2016 18:47:12 +0000
Message-ID: <>
References: <> <>
In-Reply-To: <>
Accept-Language: en-US
Content-Language: en-US
authentication-results: spf=none (sender IP is );
x-ms-exchange-messagesentrepresentingtype: 1
x-originating-ip: []
x-microsoft-exchange-diagnostics: 1; CO2PR06MB460; 5:F3qnKALuSDcLAE6loCd6jNvenaOWH5k4mfaxMcWEWTts3N/LmuEdjzSssfMhR/tTMRNAZcCMtpVd5po0W8uuRrPHYkVd91pn/jvgPsI6sQwl7FRdtpjER5gzvV0reAbQmGk4qxhp33b3R7SccPRRDw==; 24:J8dTLmkUqt3E4sUSLVOF8ZdxR0P226z9b4ClnAG0YGWwwPSh7M2xgb1e++7x10NW6Jcaep47zbFcRChC0Ooz1CTCqk1VLKUr2DryqmGbGRU=
x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:CO2PR06MB460;
x-ms-office365-filtering-correlation-id: 6e410789-9877-44ef-6ef6-08d321ca1c32
x-microsoft-antispam-prvs: <>
x-exchange-antispam-report-test: UriScan:;
x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(123027)(601004)(2401047)(5005006)(520078)(8121501046)(3002001)(10201501046); SRVR:CO2PR06MB460; BCL:0; PCL:0; RULEID:; SRVR:CO2PR06MB460;
x-forefront-prvs: 0827D7ACB9
x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(6009001)(479174004)(24454002)(377454003)(199003)(189002)(10400500002)(10130500003)(5002640100001)(10290500002)(101416001)(5004730100002)(10300500001)(189998001)(86362001)(77072002)(66066001)(5001770100001)(87936001)(97736004)(81156007)(54356999)(76176999)(5001960100002)(107886002)(50986999)(99286002)(92566002)(19580405001)(19580395003)(105586002)(2501003)(2950100001)(2900100001)(106116001)(77096005)(102836003)(106356001)(6116002)(3846002)(36756003)(10770500003)(5008740100001)(73692002)(11100500001)(1220700001)(40100003)(4500500003)(1096002)(82432001)(10630500004)(122556002)(586003)(2906002)(56826009); DIR:OUT; SFP:1102; SCL:1; SRVR:CO2PR06MB460;; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en;
received-spf: None ( does not designate permitted sender hosts)
spamdiagnosticoutput: 1:23
spamdiagnosticmetadata: NSPM
Content-Type: text/plain; charset="us-ascii"
Content-ID: <>
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-MS-Exchange-CrossTenant-originalarrivaltime: 20 Jan 2016 18:47:12.7830 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: fb007914-6020-4374-977e-21bac5f3f4c8
X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO2PR06MB460
X-CFilter: Scanned den1
Archived-At: <>
Subject: Re: [TLS] Length of a variable-length vector: Could it be an odd multiple?
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." <>
List-Unsubscribe: <>, <>
List-Archive: <>
List-Post: <>
List-Help: <>
List-Subscribe: <>, <>
X-List-Received-Date: Wed, 20 Jan 2016 18:47:17 -0000

On 1/13/16, 12:53 PM, "Benjamin Kaduk" <> wrote:
>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.

In case it's helpful, here's a suggested re-write of that quoted sentence

  The length of an encoded variable-length vector must be an
  exact multiple of the length of a single element. For example,
  an encoded 17-byte vector of uint16 would be illegal, and an
  encoded variable-length vector of four 32 byte elements,
  having a ceiling of 2^16-1, will be 130 bytes long overall
  (2 byte length field followed by 128 bytes of data).

..assuming I'm correctly understanding variable-length vectors :)