Re: [kitten] Input on Paul's concerns about aes-cbc

"Paul Miller (NT)" <paumil@microsoft.com> Tue, 08 October 2013 00:22 UTC

Return-Path: <paumil@microsoft.com>
X-Original-To: kitten@ietfa.amsl.com
Delivered-To: kitten@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id C4EDB21E80EA for <kitten@ietfa.amsl.com>; Mon, 7 Oct 2013 17:22:17 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -3.299
X-Spam-Level:
X-Spam-Status: No, score=-3.299 tagged_above=-999 required=5 tests=[AWL=-0.300, BAYES_00=-2.599, J_CHICKENPOX_15=0.6, RCVD_IN_DNSWL_LOW=-1]
Received: from mail.ietf.org ([12.22.58.30]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id uZIl-zANHcrT for <kitten@ietfa.amsl.com>; Mon, 7 Oct 2013 17:22:13 -0700 (PDT)
Received: from na01-by2-obe.outbound.protection.outlook.com (mail-by2lp0237.outbound.protection.outlook.com [207.46.163.237]) by ietfa.amsl.com (Postfix) with ESMTP id 3A9A511E8136 for <kitten@ietf.org>; Mon, 7 Oct 2013 17:22:10 -0700 (PDT)
Received: from BLUPR03MB279.namprd03.prod.outlook.com (10.255.213.17) by BLUPR03MB278.namprd03.prod.outlook.com (10.255.213.16) with Microsoft SMTP Server (TLS) id 15.0.785.10; Tue, 8 Oct 2013 00:22:08 +0000
Received: from BLUPR03MB279.namprd03.prod.outlook.com ([169.254.1.181]) by BLUPR03MB279.namprd03.prod.outlook.com ([169.254.1.181]) with mapi id 15.00.0785.001; Tue, 8 Oct 2013 00:22:08 +0000
From: "Paul Miller (NT)" <paumil@microsoft.com>
To: Nico Williams <nico@cryptonector.com>, Greg Hudson <ghudson@mit.edu>
Thread-Topic: [kitten] Input on Paul's concerns about aes-cbc
Thread-Index: AQHOwQlTXptqPoViJUGgtI+QQU8PoJnkluGAgABzJwCABN8IkA==
Date: Tue, 08 Oct 2013 00:22:08 +0000
Message-ID: <064ca7780d4943b1868670461c2c7184@BLUPR03MB279.namprd03.prod.outlook.com>
References: <tslob752llm.fsf@mit.edu> <524ECE01.3060401@mit.edu> <CAK3OfOger4OxBoBc=jCVBRZeXO2OeJa5mRoONij98gnRFPGMyw@mail.gmail.com>
In-Reply-To: <CAK3OfOger4OxBoBc=jCVBRZeXO2OeJa5mRoONij98gnRFPGMyw@mail.gmail.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-originating-ip: [2001:4898:80e8:ed31::2]
x-forefront-prvs: 0993689CD1
x-forefront-antispam-report: SFV:NSPM; SFS:(377454003)(479174003)(189002)(199002)(51704005)(24454002)(13464003)(65816001)(74706001)(80022001)(47976001)(50986001)(54316002)(4396001)(49866001)(47736001)(83072001)(74366001)(69226001)(79102001)(561944002)(77982001)(63696002)(59766001)(74876001)(56776001)(31966008)(74502001)(74662001)(56816003)(47446002)(77096001)(81542001)(81342001)(76482001)(76786001)(76576001)(33646001)(76796001)(85306002)(46102001)(51856001)(19580395003)(53806001)(54356001)(83322001)(19580405001)(15975445006)(74316001)(80976001)(81686001)(81816001)(24736002)(3826001); DIR:OUT; SFP:; SCL:1; SRVR:BLUPR03MB278; H:BLUPR03MB279.namprd03.prod.outlook.com; CLIP:2001:4898:80e8:ed31::2; FPR:; RD:InfoNoRecords; MX:1; A:1; LANG:en;
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-OriginatorOrg: DuplicateDomain-a84fc36a-4ed7-4e57-ab1c-3e967bcbad48.microsoft.com
Cc: "kitten@ietf.org" <kitten@ietf.org>, Sam Hartman <hartmans-ietf@mit.edu>
Subject: Re: [kitten] Input on Paul's concerns about aes-cbc
X-BeenThere: kitten@ietf.org
X-Mailman-Version: 2.1.12
Precedence: list
List-Id: Common Authentication Technologies - Next Generation <kitten.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/kitten>, <mailto:kitten-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/kitten>
List-Post: <mailto:kitten@ietf.org>
List-Help: <mailto:kitten-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/kitten>, <mailto:kitten-request@ietf.org?subject=subscribe>
X-List-Received-Date: Tue, 08 Oct 2013 00:22:20 -0000

I don't have any information about specific application failures with padded ciphers.  If there were problems with a block cipher, it would not be possible to do a fallback just for impacted callers as the cipher of the subsession key is chosen during the context establishment which is before the first call to EncryptMessage (GSS_Wrap analogue).  By the time we knew that the caller was not providing for padding, it would be too late to select differently.

With the existing calling pattern used for DES in Windows, callers that did not pass in the SECBUFFER_PADDING into the EncryptMessage call would just fail when the buffer was not aligned.  Additionally, if the buffer was a multiple of the block size then it would not get the PKCS#7 padding and then would fail on the other end that expected the pad block.  I suspect this would break a whole lot of callers.

To reduce the application compatibility problem, I'd have to use the Rotate Right Count in the header to move padding into the header.  Up front, Kerberos on Windows would tell callers that they needed to allocate for the header one block more than they actually need.  Then, on output we would shorten the length to whatever portion was actually used.  This would fix the callers that do not handle padding for the first encryption, but making the header variable length causes a different set of problems.  Today, the header is always the same length so the caller can allocate that buffer and then reuse it throughout multiple encryption calls.  Making it variable length would require the caller to take the additional step of resetting the length field to the allocated size between calls, which not all applications may be doing today.

There are several reasons that I think this is a significant risk.  First of all, the documentation that Microsoft has for the EncryptMessage function for Kerberos has very little bearing on how the function should actually be used.  In fact, most of the document is incorrectly copied and pasted from SSL's documentation.  It'd be highly optimistic to expect developers to have used the API correctly while the documentation was incorrect.  This makes the risk that some application is broken quite high.

The second factor is that we only have the ability to control supported encryption types at the machine level.  This means that if there is one application in an enterprise, all impacted machines will have the new cipher supported.  This means that if a LOB app is  impacted, the enterprise is likely to disable the new cipher on all machines via policy.

If the problem is likely to occur and the impact of the problem is the disablement of the new ciphers for the entire realm, the objective of introducing the new cipher is compromised.  It is much safer to move forward with a cipher that is more likely broadly to be used.

-----Original Message-----
From: kitten-bounces@ietf.org [mailto:kitten-bounces@ietf.org] On Behalf Of Nico Williams
Sent: Friday, October 4, 2013 2:10 PM
To: Greg Hudson
Cc: kitten@ietf.org; Sam Hartman
Subject: Re: [kitten] Input on Paul's concerns about aes-cbc

On Fri, Oct 4, 2013 at 9:17 AM, Greg Hudson <ghudson@mit.edu> wrote:
> On 10/04/2013 09:48 AM, Sam Hartman wrote:
>>
>> 1) Do you need any additional information to evaluate Paul's message?
>
> I don't think so.  We are still curious about the details of legacy 
> application risk (i.e. what kinds of things might a legacy SSPI 
> application do wrong such that it works now but fails with a padded 
> enctype), but the conclusion is pretty clear.

I can't tell if Paul is acting out of [quite reasonable] conservatism, or if he's really identified actual failure modes of existing applications (or likely ones), nor has he indicated whether there's any way to work around such failures (by, e.g., downgrading to CTS enctypes), nor whether any such workarounds are acceptable.

I'm not going to insist on -say- proprietary evidence.  Indeed, I like the random IV CTS mode we cooked up.  I just think we need to understand the *actual* constraints, in so far as they can be published, so that we can a) not have this conversation again later,
b) understand how those constraints might apply to future proposals,
c) document how developers should write code so as not to impose these constraints on us.

> I have also spent some more time thinking about CTR mode as you 
> suggested earlier (where we pick a random 128-bit nonce and use some 
> function f(nonce,
> blocknum) to produce the counter for each block), and whether a nonce 
> or block counter collision is any worse than a CBC cipher-block 
> collision.  I noted that a CTR nonce collision would leak the XOR of 
> the entire plaintexts of two multi-block messages, while a CBC 
> cipher-block collision or only leaks the XOR of the plaintexts of the 
> two colliding blocks, and a CBC IV/confounder collision only leaks 
> information about how many blocks of two messages are identical.

I'm now convinced that what we need in order to make certain cipher modes usable in Kerberos is a change to RFC3961 so that the API knows whether a given key is a sub-session key or not.  I don't feel comfortable with CTR modes applied to long-term keys (or even Ticket session keys) without taking steps that would effectively kill performance for the GSS mechanism's per-msg tokens.  I don't think we should have *this* discussion in the context of CTS vs. CBC: we should first decide that we don't want either CTS nor CBC.

Nico
--
_______________________________________________
Kitten mailing list
Kitten@ietf.org
https://www.ietf.org/mailman/listinfo/kitten