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

mrex@sap.com (Martin Rex) Tue, 12 November 2013 22:29 UTC

Return-Path: <mrex@sap.com>
X-Original-To: tls@ietfa.amsl.com
Delivered-To: tls@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id AE1C411E8112 for <tls@ietfa.amsl.com>; Tue, 12 Nov 2013 14:29:52 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -10.181
X-Spam-Level:
X-Spam-Status: No, score=-10.181 tagged_above=-999 required=5 tests=[AWL=0.068, BAYES_00=-2.599, HELO_EQ_DE=0.35, RCVD_IN_DNSWL_HI=-8]
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 ZW2tZqLqzQIN for <tls@ietfa.amsl.com>; Tue, 12 Nov 2013 14:29:48 -0800 (PST)
Received: from smtpde02.sap-ag.de (smtpde02.sap-ag.de [155.56.68.140]) by ietfa.amsl.com (Postfix) with ESMTP id 4AF2211E810B for <tls@ietf.org>; Tue, 12 Nov 2013 14:29:47 -0800 (PST)
Received: from mail06.wdf.sap.corp by smtpde02.sap-ag.de (26) with ESMTP id rACMTiK5002702 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 12 Nov 2013 23:29:44 +0100 (MET)
In-Reply-To: <CAJU7zaLsJe-B3gOF9BrROKPeLSvbNdM9RzJgYxRAZtBWofc8ew@mail.gmail.com>
To: Nikos Mavrogiannopoulos <nmav@gnutls.org>
Date: Tue, 12 Nov 2013 23:29:44 +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: <20131112222944.2B0FD1AA82@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.12
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, 12 Nov 2013 22:29:52 -0000

Nikos Mavrogiannopoulos wrote:
> Martin Rex <mrex@sap.com> wrote:
>> Personally, I would really prefer to _not_ move the MAC outside
>> of the encryption, i.e. leave it as pad-mac-encrypt like Serge Vaudenay
>> originally recommended.  In particular, keeping the hands off the
>> GenericStreamCipher PDU processing.
> 
> I prefer this approach too, so I've taken the parts from the
> length-hiding draft and moved them to a draft that simply describes a
> new padding approach to solve the padding oracles. In any case I still
> believe that something needs to be done about that, whether it is
> pad-encrypt-then-mac or pad-mac-then-encrypt.
> 
> http://tools.ietf.org/html/draft-mavrogiannopoulos-new-tls-padding-00

This is a whole new extension adding bells and whistles, not a fix to
any existing issues, and appears to be heading for TLSv1.2-only.

Padding with arbitrary length is something that every application
could do with every TLS implementation already in the installed base
and every existing cipher suite, no changes to TLS necessary,
requiring only minor changes of the application protocol.


I would really like to see a _simple_ TLS extension that fixes the two
CBC issues for the GenericBlockCipher PDU for *ALL* versions of TLS
including SSLv3, making _all_ protocol versions use the same
GenericblockCipher PDU format again (the way this should have been
done in 2003).


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.

But that is just an idea for what could be done if I had lots of free
time and nothing else important to do.


Seeing how slowly TLSv1.2(rfc5246) and TLS renegotiation extension (rfc5746)
are adopted by the installed base, I'm currently more interessted in
small changes and fixes to TLS that address real issues of the installed
base, such as interoperability problems (such as DHE parameter negotiation
and TLS protocol version intolerance and rsa premaster version goofs)
and weaknesses (published and unpublished).


-Martin