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

"Hodges, Jeff" <jeff.hodges@paypal.com> Wed, 20 January 2016 18:47 UTC

Return-Path: <jeff.hodges@paypal.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 7D2FD1ACD09 for <tls@ietfa.amsl.com>; Wed, 20 Jan 2016 10:47:17 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -16.302
X-Spam-Level:
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 mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 3ad7Ln1ssjhh for <tls@ietfa.amsl.com>; Wed, 20 Jan 2016 10:47:15 -0800 (PST)
Received: from den-ipout-02-data1.paypalcorp.com (den-ipout-02-data1.paypalcorp.com [173.224.160.155]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id BDEF11ACD0F for <tls@ietf.org>; Wed, 20 Jan 2016 10:47:15 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=paypal.com; i=@paypal.com; 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 den-ipcld-02-data1.paypalcorp.com) ([10.184.246.164]) by den-ipout-02-data1.paypalcorp.com 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 mail-bn1lp0142.outbound.protection.outlook.com (HELO na01-bn1-obe.outbound.protection.outlook.com) ([207.46.163.142]) by den-ipcld-02-data1.paypalcorp.com with ESMTP/TLS/AES256-SHA256; 20 Jan 2016 11:47:14 -0700
Received: from CO2PR06MB457.namprd06.prod.outlook.com (10.141.196.142) by CO2PR06MB460.namprd06.prod.outlook.com (10.141.196.154) with Microsoft SMTP Server (TLS) id 15.1.390.13; Wed, 20 Jan 2016 18:47:12 +0000
Received: from CO2PR06MB457.namprd06.prod.outlook.com ([10.141.196.142]) by CO2PR06MB457.namprd06.prod.outlook.com ([10.141.196.142]) with mapi id 15.01.0361.006; Wed, 20 Jan 2016 18:47:12 +0000
From: "Hodges, Jeff" <jeff.hodges@paypal.com>
To: Benjamin Kaduk <bkaduk@akamai.com>, Jong-Shian Wu <js@crypto.tw>, "tls@ietf.org" <tls@ietf.org>
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: <D2C5128F.5D7C9%jehodges@paypalcorp.com>
References: <CA+_zv04F0EiLdcbkhyNo9P8dR3BW3JAsDys_WKFXXUW92x=LcQ@mail.gmail.com> <5696B946.3050405@akamai.com>
In-Reply-To: <5696B946.3050405@akamai.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
authentication-results: spf=none (sender IP is ) smtp.mailfrom=jeff.hodges@paypal.com;
x-ms-exchange-messagesentrepresentingtype: 1
x-originating-ip: [73.202.80.238]
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: <CO2PR06MB460F86C64881750F365DFE093C20@CO2PR06MB460.namprd06.prod.outlook.com>
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; H:CO2PR06MB457.namprd06.prod.outlook.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en;
received-spf: None (protection.outlook.com: paypal.com does not designate permitted sender hosts)
spamdiagnosticoutput: 1:23
spamdiagnosticmetadata: NSPM
Content-Type: text/plain; charset="us-ascii"
Content-ID: <4DF77D3825CB7449B51FC9B80B228F11@namprd06.prod.outlook.com>
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-OriginatorOrg: paypal.com
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: <http://mailarchive.ietf.org/arch/msg/tls/XhWLPDtgXmXDW0uxr-ABBopYWtY>
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, 20 Jan 2016 18:47:17 -0000

On 1/13/16, 12:53 PM, "Benjamin Kaduk" <bkaduk@akamai.com> 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
above..

  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 :)

HTH,

=JeffH