Re: [TLS] Query regarding generating client_write_key.

Simon Josefsson <simon@josefsson.org> Tue, 27 September 2011 14:02 UTC

Return-Path: <simon@josefsson.org>
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 30C0021F8C64 for <tls@ietfa.amsl.com>; Tue, 27 Sep 2011 07:02:54 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -104.599
X-Spam-Level:
X-Spam-Status: No, score=-104.599 tagged_above=-999 required=5 tests=[AWL=-2.000, BAYES_00=-2.599, USER_IN_WHITELIST=-100]
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 Q7GiNjImmDoG for <tls@ietfa.amsl.com>; Tue, 27 Sep 2011 07:02:53 -0700 (PDT)
Received: from yxa-v.extundo.com (yxa-v.extundo.com [213.115.69.139]) by ietfa.amsl.com (Postfix) with ESMTP id BB33621F8C5D for <tls@ietf.org>; Tue, 27 Sep 2011 07:02:52 -0700 (PDT)
Received: from latte.josefsson.org (c-4f92e255.46-3-64736c14.cust.bredbandsbolaget.se [85.226.146.79]) (authenticated bits=0) by yxa-v.extundo.com (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id p8RE5Q34010657 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Tue, 27 Sep 2011 16:05:28 +0200
From: Simon Josefsson <simon@josefsson.org>
To: nilesh <nilesh.tayade@netscout.com>
References: <4E818EF3.4090206@netscout.com>
OpenPGP: id=B565716F; url=http://josefsson.org/key.txt
X-Hashcash: 1:22:110927:nilesh.tayade@netscout.com::DZ/kU5jjuZ0eHZ08:6xtu
X-Hashcash: 1:22:110927:tls@ietf.org::aZMTu6ogopu9naW9:JYIS
Date: Tue, 27 Sep 2011 16:05:21 +0200
In-Reply-To: <4E818EF3.4090206@netscout.com> (nilesh's message of "Tue, 27 Sep 2011 14:23:07 +0530")
Message-ID: <87ty7yt71a.fsf@latte.josefsson.org>
User-Agent: Gnus/5.110018 (No Gnus v0.18) Emacs/23.2 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Virus-Scanned: clamav-milter 0.97.2 at yxa-v
X-Virus-Status: Clean
Cc: tls@ietf.org
Subject: Re: [TLS] Query regarding generating client_write_key.
X-BeenThere: tls@ietf.org
X-Mailman-Version: 2.1.12
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: Tue, 27 Sep 2011 14:02:54 -0000

nilesh <nilesh.tayade@netscout.com> writes:

> Hi,
>
> I am new to the TLS/Cryptography and started working on decrypting the
> packets over SSL/TLS.
> I have followed the RFC2246, 5246.
...
> Queries:
> 1. The md5 generates 16bytes and SHA1 generates 20bytes so xor will be
> 20bytes.
> But the key we expect should be 32bytes (iterated the MD5/SHA1 twice
> for that). How could this be achieved?
> 2. Any suggestions on if the PRF() is designed somewhere? Pointers on
> how it could be designed?
>
> I tried several ways, but getting the wrong key. Could someone please
> advice?

Did you read section 5 of RFC 5246?  It explains how the PRF function
works.

/Simon