Re: [TLS] rfc7366: is encrypt-then-mac implemented?

Nikos Mavrogiannopoulos <nmav@redhat.com> Thu, 30 October 2014 08:06 UTC

Return-Path: <nmav@redhat.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 A384B1AD04E for <tls@ietfa.amsl.com>; Thu, 30 Oct 2014 01:06:13 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -6.912
X-Spam-Level:
X-Spam-Status: No, score=-6.912 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_HI=-5, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01] 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 qt4SPs386_zf for <tls@ietfa.amsl.com>; Thu, 30 Oct 2014 01:06:12 -0700 (PDT)
Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (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 036F91AD04C for <tls@ietf.org>; Thu, 30 Oct 2014 01:06:11 -0700 (PDT)
Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s9U865FS003465 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 30 Oct 2014 04:06:05 -0400
Received: from [10.34.2.127] (dhcp-2-127.brq.redhat.com [10.34.2.127]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s9U8615l002506 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NO); Thu, 30 Oct 2014 04:06:03 -0400
Message-ID: <1414656361.4213.9.camel@dhcp-2-127.brq.redhat.com>
From: Nikos Mavrogiannopoulos <nmav@redhat.com>
To: mrex@sap.com
Date: Thu, 30 Oct 2014 09:06:01 +0100
In-Reply-To: <20141030001346.AF51B1AF69@ld9781.wdf.sap.corp>
References: <20141030001346.AF51B1AF69@ld9781.wdf.sap.corp>
Content-Type: text/plain; charset="UTF-8"
Mime-Version: 1.0
Content-Transfer-Encoding: 7bit
X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26
Archived-At: http://mailarchive.ietf.org/arch/msg/tls/OvHlMroxyE1OQPiD3eFJBz6sBiw
Cc: "<tls@ietf.org>" <tls@ietf.org>
Subject: Re: [TLS] rfc7366: is encrypt-then-mac implemented?
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: <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: Thu, 30 Oct 2014 08:06:13 -0000

On Thu, 2014-10-30 at 01:13 +0100, Martin Rex wrote:

> > TLSCiphertext is defined in RFC7366 as follows:
> > 
> >    struct {
> >           ContentType type;
> >           ProtocolVersion version;
> >           uint16 length;
> >           GenericBlockCipher fragment;
> >           opaque MAC;
> >           } TLSCiphertext;
> > 
> > (for block ciphers at least). That TLSCiphertext.length send on the wire
> > contains both fragment and MAC length, doesn't it?
> 
> 
> This is the rfc5246 definition of TLSCiphertext and the explanation
> of the "length" element within that structure:
> 
> http://tools.ietf.org/html/rfc5246#section-6.2.3
> 
>       struct {
>           ContentType type;
>           ProtocolVersion version;
>           uint16 length;
>           select (SecurityParameters.cipher_type) {
>               case stream: GenericStreamCipher;
>               case block:  GenericBlockCipher;
>               case aead:   GenericAEADCipher;
>           } fragment;
>       } TLSCiphertext;
> 
>    type
>       The type field is identical to TLSCompressed.type.
> 
>    version
>       The version field is identical to TLSCompressed.version.
> 
>    length
>       The length (in bytes) of the following TLSCiphertext.fragment.
>       The length MUST NOT exceed 2^14 + 2048.
> 
>    fragment
>       The encrypted form of TLSCompressed.fragment, with the MAC.
> 
> 
> In rfc5246, the "length" element of the TLSCiphertext structure
> contains the length of the "fragment" element directly following it,
> and rfc7366.   But rfc7366 moves the MAC outside of the fragment,
> so its length will no longer be included in the TLSCiphertext.length
> count.

Correct. Thus the length sent on the wire must also not include the MAC
size. So is my understanding correct that no deployed implementation is
compliant to rfc7366 so far?

regards,
Nikos