Re: [rtcweb] Question about srtp_mki in DTLS/SRTP

Simon Perreault <sperreault@jive.com> Wed, 14 January 2015 18:43 UTC

Return-Path: <sperreault@jive.com>
X-Original-To: rtcweb@ietfa.amsl.com
Delivered-To: rtcweb@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id E74481ACD31 for <rtcweb@ietfa.amsl.com>; Wed, 14 Jan 2015 10:43:43 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.978
X-Spam-Level:
X-Spam-Status: No, score=-1.978 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, FM_FORGED_GMAIL=0.622, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-0.7, SPF_PASS=-0.001] 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 LhQOD08O9g8e for <rtcweb@ietfa.amsl.com>; Wed, 14 Jan 2015 10:43:42 -0800 (PST)
Received: from mail-lb0-f182.google.com (mail-lb0-f182.google.com [209.85.217.182]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 798C91ACD2A for <rtcweb@ietf.org>; Wed, 14 Jan 2015 10:43:40 -0800 (PST)
Received: by mail-lb0-f182.google.com with SMTP id u10so9409121lbd.13 for <rtcweb@ietf.org>; Wed, 14 Jan 2015 10:43:39 -0800 (PST)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=PbNL2M16cjy81ZrGGM0Z+o8q+9gix0YyBmGHSosCxHg=; b=nCDa6ezmHQFhYdugZAaJo6suvUTvesiz43QhEd6KYIvNiHfCJQP2xAtMWKR3zo+tNM rZJwsXwYheITUjXUWbpfarKtVvogHjhWmbo5hwKN7kG28Uomhzwx5GGnoCaY1a6LWuUk glNU7+LecWIcri0KucAL+AwrZ8zJsOnSfVJ+pFKfDEIy/3ciy49VA1caZjdJt72pl6w2 N7pVYhk2PqCoDg6qMMr9HHNYPDIcYl4JV9nw6x8D4+VXYpa1Vfmz2YQbEpiPHRxJs6GX Y7Odue+zGZfPEHfZsYwiC0f++nw3+aVyjHrfOVdslrBLqr1qqhin8D1rcOE7yCPwdPkM f+uA==
X-Gm-Message-State: ALoCoQmV9QG4D7w23gNI+xTAC1gJJRhiOsJBszqgnxLaU+y/EQrIzOIOScTj7u6re1jM5PTiST4o
MIME-Version: 1.0
X-Received: by 10.112.188.201 with SMTP id gc9mr5708576lbc.6.1421261018972; Wed, 14 Jan 2015 10:43:38 -0800 (PST)
Received: by 10.25.84.145 with HTTP; Wed, 14 Jan 2015 10:43:38 -0800 (PST)
In-Reply-To: <CAD5OKxu2X9+n5ZNvYxGZET4Pj1nACSCtb3_RXT3y4ce_f6pe5Q@mail.gmail.com>
References: <CAOW+2dvhEzAfyV51p1YWZoc41vih3TKhoArq3CGXzHvSdHEdcA@mail.gmail.com> <CANO7kWBjs4AwyTXXhOBSDqG=y9ThM=XkLyO_S1xPe3naL9za_Q@mail.gmail.com> <CAOW+2dt5k+dbxRbdodu5Sh+t6zzX0bVgXBUMnmSe+kJP2R+LLw@mail.gmail.com> <CANO7kWATfQdMapdCSDYdke+GFxh8OO6NJQob9hNQUDiASrpDtQ@mail.gmail.com> <CABkgnnV-irZn9N7WMTbvn4Vm1Ltqc7tzoCJo3_towfa6PSRwPw@mail.gmail.com> <CAD5OKxv1UnvZTkhxqc5mWnaBtm1=hagd0yreFz_A8dOs0p_P8A@mail.gmail.com> <CANO7kWBvmvh7y=Ba2Dx34HA229Ut274RH7SbT9p11ekmi+=VZQ@mail.gmail.com> <CAD5OKxu2X9+n5ZNvYxGZET4Pj1nACSCtb3_RXT3y4ce_f6pe5Q@mail.gmail.com>
Date: Wed, 14 Jan 2015 13:43:38 -0500
Message-ID: <CANO7kWA6Pek-=u79+AMfab934_Who4MZApxp3gB8bmUSVAsG8w@mail.gmail.com>
From: Simon Perreault <sperreault@jive.com>
To: Roman Shpount <roman@telurix.com>
Content-Type: multipart/alternative; boundary="001a11c373662b5817050ca11ec6"
Archived-At: <http://mailarchive.ietf.org/arch/msg/rtcweb/JvwX-bn7Z46sL_DAYSE5Zl9PS6M>
Cc: "rtcweb@ietf.org" <rtcweb@ietf.org>
Subject: Re: [rtcweb] Question about srtp_mki in DTLS/SRTP
X-BeenThere: rtcweb@ietf.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: Real-Time Communication in WEB-browsers working group list <rtcweb.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/rtcweb>, <mailto:rtcweb-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/rtcweb/>
List-Post: <mailto:rtcweb@ietf.org>
List-Help: <mailto:rtcweb-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/rtcweb>, <mailto:rtcweb-request@ietf.org?subject=subscribe>
X-List-Received-Date: Wed, 14 Jan 2015 18:43:44 -0000

On Wed, Jan 14, 2015 at 1:40 PM, Roman Shpount <roman@telurix.com> wrote:

> You can use the old key, until the first SRTP packet fails to verify, try
> to verify the SRTP packet using new key and record sequence number for this
> SSRC as the first sequence for which new key is used. For all subsequent
> packets use the new SRTP key. For all previous -- repeat the above process.
> This should work in the absence of MKI. At the end of the day this is
> simply optimization of trying to decode using multiple keys. You do need to
> maintain the list of old keys, time them out, and keep the sequence numbers
> for each SSRC where you start using each key.


Yes, that's the optimization described in the last paragraph of
https://tools.ietf.org/html/rfc5764#section-5.2. I didn't implement it
because I don't believe it actually optimizes anything. It certainly makes
code more complex, and could actually take more time to execute because of
branch misprediction.

Simon