Re: [Sframe] [UNVERIFIED SENDER] Re: MLS Integration Question

"Alwen, Joel" <alwenjo@amazon.com> Tue, 31 January 2023 14:13 UTC

Return-Path: <prvs=388e36f0a=alwenjo@amazon.com>
X-Original-To: sframe@ietfa.amsl.com
Delivered-To: sframe@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 581B6C1516FF for <sframe@ietfa.amsl.com>; Tue, 31 Jan 2023 06:13:49 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -14.587
X-Spam-Level:
X-Spam-Status: No, score=-14.587 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H2=-0.001, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_KAM_HTML_FONT_INVALID=0.01, URIBL_BLOCKED=0.001, URIBL_DBL_BLOCKED_OPENDNS=0.001, URIBL_ZEN_BLOCKED_OPENDNS=0.001, USER_IN_DEF_SPF_WL=-7.5] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=amazon.com
Received: from mail.ietf.org ([50.223.129.194]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Fc_FGwfnYeXd for <sframe@ietfa.amsl.com>; Tue, 31 Jan 2023 06:13:45 -0800 (PST)
Received: from smtp-fw-6001.amazon.com (smtp-fw-6001.amazon.com [52.95.48.154]) (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 37AAFC14F693 for <sframe@ietf.org>; Tue, 31 Jan 2023 06:13:45 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1675174426; x=1706710426; h=from:to:cc:date:message-id:references:in-reply-to: mime-version:subject; bh=vujy+db/rkXi3vuUwlSCyaU5z9YaByQcB6i271XdDJk=; b=B9sHdv4hzCemV/JIrbJXr81MdoFnpfwfUdsBKuY8IL3aTMi0OrD/wCYi 6lPrepqtM1FY/XJDLvEP2s376nI5H1Js9BwBTkOyCNUbfd1N81ddnY+ST PI4J6dFPDanpAQFidLfSKsEP59FBZ0m12nSaR7v3OyJB663R+2+JS+Tpm 8=;
X-IronPort-AV: E=Sophos;i="5.97,261,1669075200"; d="scan'208,217";a="293886248"
Thread-Topic: [UNVERIFIED SENDER] Re: [Sframe] MLS Integration Question
Received: from iad12-co-svc-p1-lb1-vlan2.amazon.com (HELO email-inbound-relay-iad-1d-m6i4x-153b24bc.us-east-1.amazon.com) ([10.43.8.2]) by smtp-border-fw-6001.iad6.amazon.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Jan 2023 14:13:42 +0000
Received: from EX13D50EUA002.ant.amazon.com (iad12-ws-svc-p26-lb9-vlan3.iad.amazon.com [10.40.163.38]) by email-inbound-relay-iad-1d-m6i4x-153b24bc.us-east-1.amazon.com (Postfix) with ESMTPS id 758B9CC8E0; Tue, 31 Jan 2023 14:13:39 +0000 (UTC)
Received: from EX19D048EUA001.ant.amazon.com (10.252.50.157) by EX13D50EUA002.ant.amazon.com (10.43.165.201) with Microsoft SMTP Server (TLS) id 15.0.1497.45; Tue, 31 Jan 2023 14:13:38 +0000
Received: from EX19D048EUA001.ant.amazon.com (10.252.50.157) by EX19D048EUA001.ant.amazon.com (10.252.50.157) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.21; Tue, 31 Jan 2023 14:13:38 +0000
Received: from EX19D048EUA001.ant.amazon.com ([fe80::911d:ff7e:89cc:df88]) by EX19D048EUA001.ant.amazon.com ([fe80::911d:ff7e:89cc:df88%3]) with mapi id 15.02.1118.021; Tue, 31 Jan 2023 14:13:38 +0000
From: "Alwen, Joel" <alwenjo@amazon.com>
To: Richard Barnes <rlb@ipv.sx>
CC: "sframe@ietf.org" <sframe@ietf.org>
Thread-Index: AQHZLCCwvye029Nvlki1kRUVkOgzsa6yx9eAgAXb2hQ=
Date: Tue, 31 Jan 2023 14:13:38 +0000
Message-ID: <27cfc82e95b94a0badd4f57fa7000372@amazon.com>
References: <de394d35aa2b4909876434abf42cde0f@amazon.com>, <CAL02cgQTwgCbOUJArZivkFsvt0Fu_X=KOszdwajUf1Y6Y9V5ZQ@mail.gmail.com>
In-Reply-To: <CAL02cgQTwgCbOUJArZivkFsvt0Fu_X=KOszdwajUf1Y6Y9V5ZQ@mail.gmail.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-originating-ip: [10.252.51.153]
Content-Type: multipart/alternative; boundary="_000_27cfc82e95b94a0badd4f57fa7000372amazoncom_"
MIME-Version: 1.0
Archived-At: <https://mailarchive.ietf.org/arch/msg/sframe/5ICdZfPzotLeJiQFR9M5qNQ0ID0>
Subject: Re: [Sframe] [UNVERIFIED SENDER] Re: MLS Integration Question
X-BeenThere: sframe@ietf.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: Secure Media Frames <sframe.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/sframe>, <mailto:sframe-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/sframe/>
List-Post: <mailto:sframe@ietf.org>
List-Help: <mailto:sframe-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/sframe>, <mailto:sframe-request@ietf.org?subject=subscribe>
X-List-Received-Date: Tue, 31 Jan 2023 14:13:49 -0000

Hey Richard,

1. Re: domain (key, nonce) domain separation for sources from same user.

> If that looks good to you, let's work on getting it ported over to draft-ietf-sframe-enc.

While it looks like it works we have another suggestion. In section 4.3.2 replace salt derivation with:

sframe_salt = HKDF-Expand(sframe_secret, 'salt'+SSRC, AEAD.Nn)

where + denotes string concatenation and SSRC = synchronization source. i.e. a unique ID for the stream (received from the encoder).

This has 2 advantages over the KID construction in your draft doc.
- It solves the problem once-and-for-all regardless of how keying is done rather than just solving it when integrating MLS with SFrame.
- It leaves more room in the KID for other uses. (E.g. the random challenge we proposed in 2.)


2. Re: Crash/resumption leading to (key, nonce) reuse.

Fair enough.


3. Re: calling MLS.export for each sender separately

Both solutions have advantages. An advantage of using MLS.export for each sender is that this way one can build an application using black-box an SFrame library and a MLS library without needing an HKDF.Expand dependency (MLS & SFrame do all HKDFing for them).


- Joël & Marta



________________________________
From: Sframe <sframe-bounces@ietf.org> on behalf of Richard Barnes <rlb@ipv.sx>
Sent: Friday, January 27, 2023 9:43 PM
To: Alwen, Joel
Cc: sframe@ietf.org
Subject: [EXTERNAL] [UNVERIFIED SENDER] Re: [Sframe] MLS Integration Question


CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you can confirm the sender and know the content is safe.


Hi Joël,

(Accidentally sent this unicast, retransmitting to the list)

Glad this is looking useful to you, and thanks for the nudge to make some updates to the document.

1. The problem you describe is definitely real.  In addition to A/V, there are things like endpoints with multiple cameras that don't share state.  I wrote up the solution that we're using in Webex, which is basically what you suggest -- stealing a few more bits of KID to indicate the context within the sender.  Unfortunately, I apparently forgot that we had moved the MLS keying into the main spec, so I only wrote up the solution in the separate predecessor document:

https://github.com/bifurcation/sframe-mls/blob/main/draft-barnes-sframe-mls.md#multiple-sender-contexts

If that looks good to you, let's work on getting it ported over to draft-ietf-sframe-enc.

2. This situation seems a little different from the MLS reuse_guard situation, since it depends on whether MLS group memberships persist across restarts.  In a system where MLS joins/leaves correspond to meeting joins/leaves, this is not an issue, because if the client crashes, then it will rejoin the group, and thus have a different base key.  So your issue would only come up in a case where MLS state was preserved across restarts, but the CTR state was lost/corrupted.  (Right?)  In any case, it seems this is something an implementation could do using the context value discussed above -- generate a different context / set of contexts every time you restart.  Maybe we could add a recommendation, but it seems like the application-defined context ID gives the application the tools it needs.

3. The main reason for the current design is API cleanliness -- you just export an SFrame key once when the epoch changes and generate the remaining keys internal to the SFrame library, instead of having interaction between the SFrame and MLS layers each time SFrame needs a new key.

Hope that helps,
--Richard

On Thu, Jan 19, 2023 at 11:25 AM Alwen, Joel <alwenjo=40amazon.com@dmarc.ietf.org<mailto:40amazon.com@dmarc.ietf.org>> wrote:

 _Hey everyone,


As Marta Mularczyk and I have been looking at using MLS to key SFrame we came across the following two questions/suggestions for the SFrame mailinglist.


1) Section 5.2 recommends how KIDs can be defined when using MLS as the key source. It domain separates between (epoch, leaf) pairs which is good. But by "only" domain separating on this it seems to imply that when encrypting frames from different streams (e.g. audio & video) from the same sender implementations need to coordinate the counter values in the SFrame header (lest the same IV is used more than once by the sender).  So, to make implementation easier / more flexible, we were thinking KID should also domain separate streams. E.g. the KID has an extra byte indicating the stream. That way encrypting different streams can be done independently and concurrently. Does that sound like a good idea to everyone? If so maybe we should update the SFrame MLS integration recommendation accordingly.

2) Another question about how KIDs are derived in section 5.2: to avoid reuse of the same key/nonce pairs in encryption due to "failure\crash -> resumption"  type scenarios maybe it would be a good idea to add a bit of entropy (say a byte) into KID that then goes in to the base_key generation. Basically, the suggestion is to have a similar mechanism to the nonce reuse guard in MLS (only this time its a key reuse guard).


3) Why recommend first generating sframe_epoch_secret as an Exporter and then doing HKDF-Expand again to generate individual base_keys? Is there an issue with just generating the base_keys directly as Exporter keys?


- Joël




Amazon Development Center Austria GmbH
Brueckenkopfgasse 1
8020 Graz
Oesterreich
Sitz in Graz
Firmenbuchnummer: FN 439453 f
Firmenbuchgericht: Landesgericht fuer Zivilrechtssachen Graz


--
Sframe mailing list
Sframe@ietf.org<mailto:Sframe@ietf.org>
https://www.ietf.org/mailman/listinfo/sframe


Amazon Development Center Austria GmbH
Brueckenkopfgasse 1
8020 Graz
Oesterreich
Sitz in Graz
Firmenbuchnummer: FN 439453 f
Firmenbuchgericht: Landesgericht fuer Zivilrechtssachen Graz