Re: [AVT] SRTCP key derivation
Mats Näslund <mats.naslund@ericsson.com> Fri, 22 July 2005 16:04 UTC
Received: from localhost.localdomain ([127.0.0.1] helo=megatron.ietf.org) by megatron.ietf.org with esmtp (Exim 4.32) id 1Dw00G-0007iw-2U; Fri, 22 Jul 2005 12:04:00 -0400
Received: from odin.ietf.org ([132.151.1.176] helo=ietf.org) by megatron.ietf.org with esmtp (Exim 4.32) id 1Dw00D-0007ii-V2 for avt@megatron.ietf.org; Fri, 22 Jul 2005 12:03:58 -0400
Received: from ietf-mx.ietf.org (ietf-mx [132.151.6.1]) by ietf.org (8.9.1a/8.9.1a) with ESMTP id MAA28289 for <avt@ietf.org>; Fri, 22 Jul 2005 12:03:54 -0400 (EDT)
Received: from mailgw3.ericsson.se ([193.180.251.60]) by ietf-mx.ietf.org with esmtp (Exim 4.43) id 1Dw0UU-0003E4-8K for avt@ietf.org; Fri, 22 Jul 2005 12:35:14 -0400
Received: from esealmw126.eemea.ericsson.se (unknown [153.88.254.123]) by mailgw3.ericsson.se (Symantec Mail Security) with ESMTP id 59AE310E5; Fri, 22 Jul 2005 18:03:47 +0200 (CEST)
Received: from esealmw128.eemea.ericsson.se ([153.88.254.172]) by esealmw126.eemea.ericsson.se with Microsoft SMTPSVC(6.0.3790.211); Fri, 22 Jul 2005 18:03:45 +0200
Received: from ericsson.com ([147.214.97.151]) by esealmw128.eemea.ericsson.se with Microsoft SMTPSVC(6.0.3790.211); Fri, 22 Jul 2005 18:03:45 +0200
Message-ID: <42E118E1.9080007@ericsson.com>
Date: Fri, 22 Jul 2005 18:03:45 +0200
From: Mats Näslund <mats.naslund@ericsson.com>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax)
X-Accept-Language: en-us, en
MIME-Version: 1.0
To: Guoqiang Lu <guoqian@nortel.com>
Subject: Re: [AVT] SRTCP key derivation
References: <183DD1B052A11A40B76125E42F1CBAAB04C3304A@zcarhxm1.corp.nortel.com>
In-Reply-To: <183DD1B052A11A40B76125E42F1CBAAB04C3304A@zcarhxm1.corp.nortel.com>
Content-Type: text/plain; charset="ISO-8859-1"; format="flowed"
X-OriginalArrivalTime: 22 Jul 2005 16:03:45.0411 (UTC) FILETIME=[F0357D30:01C58ED6]
X-Brightmail-Tracker: AAAAAA==
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: 0.0 (/)
X-Scan-Signature: 22bbb45ef41b733eb2d03ee71ece8243
Content-Transfer-Encoding: quoted-printable
Cc: "Karl Norrman (KI/EAB)" <karl.norrman@ericsson.com>, mcgrew@cisco.com, avt@ietf.org
X-BeenThere: avt@ietf.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: Audio/Video Transport Working Group <avt.ietf.org>
List-Unsubscribe: <https://www1.ietf.org/mailman/listinfo/avt>, <mailto:avt-request@ietf.org?subject=unsubscribe>
List-Post: <mailto:avt@ietf.org>
List-Help: <mailto:avt-request@ietf.org?subject=help>
List-Subscribe: <https://www1.ietf.org/mailman/listinfo/avt>, <mailto:avt-request@ietf.org?subject=subscribe>
Sender: avt-bounces@ietf.org
Errors-To: avt-bounces@ietf.org
Hi,
I think the RFC is quite clear on this issue. (Perhaps there
isn't a "one-liner" that tells you this in one shot, but all
information is there).
First, notice that what really matters is the format/size of
"index DIV key_derivation_rate", because that is what is input to
the KDF. The RFC says:
Let "a DIV t" denote integer division of a by t, rounded down, and
with the convention that "a DIV 0 = 0" for all a. We also make the
convention of treating "a DIV t" as a bit string of the same length
as a, and thus "a DIV t" will in general have leading zeros.
This means that when it later states:
* Let r = index DIV key_derivation_rate (with DIV as defined above).
* Let key_id = <label> || r.
r shall have the same bit-size as "index" has. For SRTP,
the index is clearly 48 bits, hence, so should the corresponding r be.
For SRTCP, a bit later it says:
Replate the SRTP index by the 32-bit quantity: 0 || SRTCP index
here it is explcitly stated that it is a 32-bit quantity, hence
the same size is used for the result of the DIV operation and the
result/input to the KDF is 32 bits, same as before the DIV took
place.
Of course, there may be better ways to do it form implementation point
of view.
Best,
/Mats
Guoqiang Lu wrote:
>>This means that, e.g., the labels will not be in the same octet position for SRTP and SRTCP.
>
>
> This seems to contradict the reference implementation by David McGrew found in srtp.sourceforge.net: The SRTCP key was derived as:
>
> srtp_kdf_generate(&kdf, (uint64_t) label_rtcp_encryption,
> tmp_key, cipher_get_key_length(srtp->rtcp_cipher));
> While SRTCP key was derived as:
>
> srtp_kdf_generate(&kdf, (uint64_t) label_rtp_encryption,
> tmp_key, cipher_get_key_length(srtp->rtp_cipher));
>
> And within the srtp_kdf_generate() function, the label is always assigned to nonce.octet[7].
>
> Thanks!
>
> Guoqiang Lu
> ESN: 39-36277
> Phone: (613) 763-6277
> guoqian@nortel.com
> --------------------------
> The contents of the this e-mail may be Nortel Confidential!
>
>
> -----Original Message-----
> From: Karl Norrman (KI/EAB) [mailto:karl.norrman@ericsson.com]
> Sent: Thursday, July 21, 2005 5:47 AM
> To: Lu, Guoqiang [CAR:9D40:EXCH]
> Cc: mcgrew@cisco.com; Mats Näslund (KI/EAB); avt@ietf.org
> Subject: RE: [AVT] SRTCP key derivation
>
>
> Hello!
>
> The SRTCP index should not be padded with zeros to be 48 bits long. This means that, e.g., the labels will not be in the same octet position for SRTP and SRTCP.
>
> Regards,
> Karl
>
>
>>-----Original Message-----
>>From: avt-bounces@ietf.org [mailto:avt-bounces@ietf.org]On Behalf Of
>>Guoqiang Lu
>>Sent: den 20 juli 2005 18:40
>>To: avt@ietf.org
>>Cc: mcgrew@cisco.com; Mats Näslund (KI/EAB)
>>Subject: [AVT] SRTCP key derivation
>>
>>
>>Hi,
>>In RFC3711, section 4.3.2. SRTCP Key Derivation, it says:
>>
>>"Replace the SRTP index by the 32-bit quantity: 0 || SRTCP index ..."
>>
>>My question is that SRTP index is a 48-bit quantity, should
>>the SRTCP 32-bit quantity "0 || SRTCP index" be patched with
>>16 leading zeros?
>>
>>Thanks!
>>
>>Guoqiang Lu
>>ESN: 39-36277
>>Phone: (613) 763-6277
>>guoqian@nortel.com
>>--------------------------
>>The contents of the this e-mail may be Nortel Confidential!
>>
>>
>>_______________________________________________
>>Audio/Video Transport Working Group
>>avt@ietf.org
>>https://www1.ietf.org/mailman/listinfo/avt
>>
--------------------------------------
Mats Näslund, PhD, Senior Specialist
Communications Security Lab
Ericsson Research
SE-16480 Stockholm, Sweden
Visiting adr: Torshamnsgatan 23, Kista
Phone/Fax: (+46 8) 58533739/4047020
_______________________________________________
Audio/Video Transport Working Group
avt@ietf.org
https://www1.ietf.org/mailman/listinfo/avt
- [AVT] SRTCP key derivation Guoqiang Lu
- RE: [AVT] SRTCP key derivation Karl Norrman (KI/EAB)
- RE: [AVT] SRTCP key derivation Guoqiang Lu
- Re: [AVT] SRTCP key derivation Mats Näslund