Re: [TLS] Wrapping up cached info (and PRF WTF)

Martin Rex <mrex@sap.com> Mon, 17 May 2010 20:18 UTC

Return-Path: <mrex@sap.com>
X-Original-To: tls@core3.amsl.com
Delivered-To: tls@core3.amsl.com
Received: from localhost (localhost [127.0.0.1]) by core3.amsl.com (Postfix) with ESMTP id D47083A6B38 for <tls@core3.amsl.com>; Mon, 17 May 2010 13:18:48 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -7.769
X-Spam-Level:
X-Spam-Status: No, score=-7.769 tagged_above=-999 required=5 tests=[AWL=-0.120, BAYES_50=0.001, HELO_EQ_DE=0.35, RCVD_IN_DNSWL_HI=-8]
Received: from mail.ietf.org ([64.170.98.32]) by localhost (core3.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Q1mIEbVbAocQ for <tls@core3.amsl.com>; Mon, 17 May 2010 13:18:47 -0700 (PDT)
Received: from smtpde03.sap-ag.de (smtpde03.sap-ag.de [155.56.68.140]) by core3.amsl.com (Postfix) with ESMTP id D29C33A6BA2 for <tls@ietf.org>; Mon, 17 May 2010 13:18:33 -0700 (PDT)
Received: from mail.sap.corp by smtpde03.sap-ag.de (26) with ESMTP id o4HKINK3010683 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 17 May 2010 22:18:23 +0200 (MEST)
From: Martin Rex <mrex@sap.com>
Message-Id: <201005172018.o4HKIMbR011949@fs4113.wdf.sap.corp>
To: DPKemp@missi.ncsc.mil
Date: Mon, 17 May 2010 22:18:22 +0200
In-Reply-To: <201005171945.o4HJjNtp008322@stingray.missi.ncsc.mil> from "Kemp, David P." at May 17, 10 03:45:19 pm
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Scanner: Virus Scanner virwal07
X-SAP: out
Cc: tls@ietf.org
Subject: Re: [TLS] Wrapping up cached info (and PRF WTF)
X-BeenThere: tls@ietf.org
X-Mailman-Version: 2.1.9
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/listinfo/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: Mon, 17 May 2010 20:18:48 -0000

Kemp, David P. wrote:
> 
> And on a different topic, What is This Function?
> 
> 
> RFC 5246 section 4.3 defines the notation for two types of vectors:
>   Fixed length:     T T'[n];
>   Variable length:  T T'<floor..ceiling>;
> 
> and section 7.4.9 defines the structure of the Finished message:
> 
>       struct {
>           opaque verify_data[verify_data_length];
>       } Finished;
> 
>       verify_data
>          PRF(master_secret, finished_label, Hash(handshake_messages))
>             [0..verify_data_length-1];
> 
> 
> What sort of notation is a function PRF() followed by a floor and
> ceiling expression enclosed in square brackets []?

The output of the PRF() is substantially larger than the size
of the finished message.  The notation is probbly meant to
refer to the initial verify_data_length octets from the
opaque result of PRF().

The "verify_data" vector in the finished message has a fixed size,
which means that it is encoded without a seperate length field.

But since the verify_data is also the only content of the finished
handshake message, the size of verify_data is the same as the
sized handshake message body given in the handshake message header.


> 
> Assuming it means that the PRF output is truncated to some variable
> number of bytes, why is the floor 0 bytes and the ceiling 11 bytes when
> all verify_data vectors MUST be either exactly 12 (current ciphersuites)
> or at least 12 (future ciphersuites) bytes???

The existing spec does not allow verify_data to be of variable size.
(variable size objects would require an additional length field
 preceding the value).

verify_data must always be fixed size, but that fixed size can be defined
in the specification of a cipher suite to be larger than 12 octets.

-Martin