Re: [TLS] Encrypt-then-MAC again (was Re: padding bug)

mrex@sap.com (Martin Rex) Tue, 19 November 2013 01:43 UTC

Return-Path: <mrex@sap.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 17C741AE986 for <tls@ietfa.amsl.com>; Mon, 18 Nov 2013 17:43:28 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -6.552
X-Spam-Level:
X-Spam-Status: No, score=-6.552 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, HELO_EQ_DE=0.35, RCVD_IN_DNSWL_HI=-5, SPF_HELO_PASS=-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 kPG8tIVMRzPg for <tls@ietfa.amsl.com>; Mon, 18 Nov 2013 17:43:25 -0800 (PST)
Received: from smtpde01.sap-ag.de (smtpde01.sap-ag.de [155.56.68.170]) by ietfa.amsl.com (Postfix) with ESMTP id 7E3A51AE95B for <tls@ietf.org>; Mon, 18 Nov 2013 17:43:25 -0800 (PST)
Received: from mail06.wdf.sap.corp by smtpde01.sap-ag.de (26) with ESMTP id rAJ1hFwX022938 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 19 Nov 2013 02:43:15 +0100 (MET)
In-Reply-To: <1384400970.2092.7.camel@aspire.lan>
To: Nikos Mavrogiannopoulos <nmav@gnutls.org>
Date: Tue, 19 Nov 2013 02:43:15 +0100
X-Mailer: ELM [version 2.4ME+ PL125 (25)]
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="US-ASCII"
Message-Id: <20131119014315.7A5831AAB1@ld9781.wdf.sap.corp>
From: mrex@sap.com
X-SAP: out
Cc: "tls@ietf.org" <tls@ietf.org>
Subject: Re: [TLS] Encrypt-then-MAC again (was Re: padding bug)
X-BeenThere: tls@ietf.org
X-Mailman-Version: 2.1.15
Precedence: list
Reply-To: mrex@sap.com
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: <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: Tue, 19 Nov 2013 01:43:28 -0000

Nikos Mavrogiannopoulos wrote:
> > > 
> > > http://tools.ietf.org/html/draft-mavrogiannopoulos-new-tls-padding-00
> 
> There are two options. (a) Minor changes to the application protocol
> (for all application protocols), or (b) minor changes to the TLS
> protocol. The draft above takes the latter approach.

Personally, I prefer to seperate true fixes
(such as changing mac-pad-encrypt -> pad-mac-encrypt) from
new features.


> 
> I also don't understand what do you mean by heading TLSv1.2-only. The
> proposal in the above draft works from SSL 3.0 to TLS 1.2. There is
> nothing TLS 1.2-specific there.

The AES-CCM and AES-GCM specs take the extreme position that everything
that refers to GenericAEADCipher PDU must be TLSv1.2 exclusively.

I would very much welcome if we could kill this, and let implementors
use GenericAEADCipher with whatever TLS version they see fit.
Such a relaxation should be negotiated, though, to avoid confusion
(and interop problems) with excessively pedantic implementations
that follow obviously flawed suggestions in immature specifications.


> 
> > You proposal adds the padding at the beginning only.  Since the
> > problem exhibited by RC4 is inherent to any XOR-encryption with
> > a pseudo-random-pad, AES-CCM, AES-GCM, etc. I would make such an
> > extension use random fraction, random content, authenticated padding
> > on both sides of the plaintext, with a combined minimum padding length of
> > at least 16 bytes, in order to mitigate statistical attacks on
> > any bias that may be found in the pseudo-random-pad.
> 
> The above draft does:
> 1. prevent padding oracle attacks
> 2. hide the length of the plaintext
> 
> What you propose there is having the plaintext appear and finish in an
> unpredictable position. That's an interesting approach, not handled by
> the draft above.
> 
> In simple terms you're asking for more bells and whistles :)

If you can't be good, at least be good at it.  :)

If you want to retrofit random padding into TLS (and into the stream and
aead cipher PDUs specifically), then you could at least try to mitigate
the most obvious problems with XOR-encryption schemes: the problems with
biases/patterns in the pseudo-random-pad and the possibility to accurately
flip individual bits in the plaintext.


-Martin