Re: [MLS] Include signature in the confirmed transcript hash?

Marta Mularczyk <mumarta@ethz.ch> Sat, 19 September 2020 19:35 UTC

Return-Path: <marta.mularczyk@inf.ethz.ch>
X-Original-To: mls@ietfa.amsl.com
Delivered-To: mls@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id CF2043A02BD for <mls@ietfa.amsl.com>; Sat, 19 Sep 2020 12:35:20 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.896
X-Spam-Level:
X-Spam-Status: No, score=-1.896 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, HTML_MESSAGE=0.001, SPF_HELO_NONE=0.001, SPF_NONE=0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
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 QKAN93HgDy93 for <mls@ietfa.amsl.com>; Sat, 19 Sep 2020 12:35:18 -0700 (PDT)
Received: from mailg210.ethz.ch (mailg210.ethz.ch [IPv6:2001:67c:10ec:5606::21]) (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 82C013A02BC for <mls@ietf.org>; Sat, 19 Sep 2020 12:35:16 -0700 (PDT)
Received: from mailm213.d.ethz.ch (2001:67c:10ec:5603::27) by mailg210.ethz.ch (2001:67c:10ec:5606::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2044.4; Sat, 19 Sep 2020 21:35:08 +0200
Received: from DESKTOPTGVF3SH (87.239.204.48) by mailm213.d.ethz.ch (2001:67c:10ec:5603::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2044.4; Sat, 19 Sep 2020 21:35:12 +0200
From: Marta Mularczyk <mumarta@ethz.ch>
To: 'Richard Barnes' <rlb@ipv.sx>
CC: 'Messaging Layer Security WG' <mls@ietf.org>
References: <003401d68cf9$d7c5d420$87517c60$@ethz.ch> <CAL02cgSajyjn9+k27bsJBeOVPmHLM8-=q1M8jkc0HvpHrL0-cQ@mail.gmail.com>
In-Reply-To: <CAL02cgSajyjn9+k27bsJBeOVPmHLM8-=q1M8jkc0HvpHrL0-cQ@mail.gmail.com>
Date: Sat, 19 Sep 2020 21:35:10 +0200
Message-ID: <004701d68ebb$fcbde420$f639ac60$@ethz.ch>
MIME-Version: 1.0
Content-Type: multipart/alternative; boundary="----=_NextPart_000_0048_01D68ECC.C049C160"
X-Mailer: Microsoft Outlook 16.0
Thread-Index: AQKEn35NUWowfkKK/gX/P1TDRsvbcQFmf4uBqAkE9XA=
Content-Language: en-us
X-Originating-IP: [87.239.204.48]
X-ClientProxiedBy: mailm213.d.ethz.ch (2001:67c:10ec:5603::27) To mailm213.d.ethz.ch (2001:67c:10ec:5603::27)
X-TM-SNTS-SMTP: 84FC7CDF2F721AD2FE0644B1A72827B5A1C9F37CC48FE2B324BC23ABA518FBCE2000:8
Archived-At: <https://mailarchive.ietf.org/arch/msg/mls/jdEQke0YQDUu5f-dsKVEP-hqw5s>
X-Mailman-Approved-At: Tue, 22 Sep 2020 06:49:27 -0700
Subject: Re: [MLS] Include signature in the confirmed transcript hash?
X-BeenThere: mls@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: Messaging Layer Security <mls.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/mls>, <mailto:mls-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/mls/>
List-Post: <mailto:mls@ietf.org>
List-Help: <mailto:mls-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/mls>, <mailto:mls-request@ietf.org?subject=subscribe>
X-List-Received-Date: Sat, 19 Sep 2020 19:35:21 -0000

Hi Richard,

  

Thank you for the comments and for pointing to TLS! It's reassuring that TLS uses a very similar mechanism. 

  

Yes, the order you gave is exactly what I meant. But I'm not sure about including the confirmation tag in the interim_transcript: if the MAC is unique given the key and the message (since for many MACs, including HMAC, verification works by deterministically re-computing the tag, this seems reasonable), then there's no need to include it. And if it's not unique, then we get the same problem as with signatures but with confirmation tags, right?

Another option (discussed at some point in the list) would be to publish the confirmation key instead of the MAC.

  

Anyway, we'll think what to do with the syntax issue :-)

  

Best,

Marta

  

  

From: Richard Barnes [mailto:rlb@ipv.sx] 
Sent: Friday, September 18, 2020 12:22 AM
To: Marta Mularczyk <mumarta@ethz.ch>
Cc: Messaging Layer Security WG <mls@ietf.org>
Subject: Re: [MLS] Include signature in the confirmed transcript hash?

 �

Hi Marta,

 �

Thanks for writing this up. � This analysis seems sound to me. It reminds me of the structure of the server's first flight post-ServerHello in TLS [1]:

 �

 � � � AEAD(EncryptedExtensions Certificate CertificateVerify Finished)

 �

That means you end up with (1) message content, (2) signature over message content, (3) MAC that confirms agreement on the derived secrets (4) AEAD authentication tag that verifies membership in the prior group (established by the ClientHello/ServerHello). � Which I think is the same order you're proposing here. � Just to restate to confirm I'm understanding:

 �

MLSPlaintext.signature = Sign(sig_private_key; MLSPlaintext.group_id, ... MLSPlaintext.proposal/commit/application)

confirmed_transcript_hash = Hash(confirmed_transcript_hash, MLSPlaintext.group_id...MLSPlaintext.signature)

MLSPlaintext.confirmation_tag = MAC(confirmation_key, confirmed_transcript_hash)

 �

I don't think this completely gets us out of the need for the interim_transcript_hash. � We will still need it if we want to include the confirmation_tag in the transcript. � This seems like a good idea, analogous to TLS including the Finished message in the transcript for post-handshake messages [2]. � (For the same reason, I would argue that the membership_tag would *not* need to go in the transcript.)

 �

There's also a bit of weirdness here arising from the fact that we use the same framing for Commits, Proposals, and application data (MLSPlaintext/MLSCiphertext). � In particular, the signature part is shared. � So on the one hand, the natural syntax given the above is to put the confirmation_tag after the signature (so that the signature covers everything above it). � But on the other hand, that's weird because what do you do with the confirmation_tag for non-Commit messages? � ("Leave it empty" would be the obvious answer.). You could leave the confirmation_tag where it is syntactically, and just change the computations, but that would break the (admittedly aesthetic) property that the signature covers everything above it.

 �

Overall, though, I think this is worth writing up a PR on. � I look forward to your proposal for how to resolve the syntax issue :)

 �

Thanks again,

--Richard

 �

[1] https://github.com/tlswg/tls13-spec/blob/master/draft-ietf-tls-tls13.md#protocol-overview

[2] https://github.com/tlswg/tls13-spec/blob/master/draft-ietf-tls-tls13.md#authentication-messages

 �

 �

 �

On Thu, Sep 17, 2020 at 1:43 PM Marta Mularczyk <mumarta@ethz.ch <mailto:mumarta@ethz.ch> > wrote:

Hi all,

 �

Together with Joël Alwen and Daniel Jost, we noticed some unexpected (at least to us) effects of the way transcript hash is computed. What are your thoughts on this?

 �

Details: Say Alice and Bob each processes a commit packet and they end up with the same epoch secrets. Expected guarantee: agreement on the secrets implies being in sync -- agreement on the group state, and being able to continue progressing epochs.

Problem: the latter is false if the packets processed by Alice and Bob only differ in the signature string (it's easy to come up with many equivalent ECDSA signatures, given only the signer's public key). Now Alice and Bob agree on the confirmed_transcript_hash, and hence on the current secrets, but not on the interim_transcript_hash, so they won't agree on the next epoch secrets. Result: they will never accept the same commit (due to not matching confirmation_tag) and so they'll never be in sync in the next epoch.

 �

This can be solved by including the signature in the confirmed_transcript_hash and not signing the confirmation_tag (the tag is also not part of the transcript_hash). We claim that this doesn't affect security. Assume Alice sends a commit and the adversary intercepts the packet. Consider these 3 cases:

- if the adversary doesn't know the current epoch secrets, then he can't modify any part of Alice's packet (due to AEAD/MAC security of the message framing).

- if he knows the epoch secrets but not Alice's signing key, then the only thing he can, in principle, modify is the confirmation_tag. However, the tag is fully determined by the signed part of the commit (and the transcript history).

- if he knows both, then the adversary can already produce any packet he wants on behalf of Alice.

 �

An additional advantage of this solution is that it simplifies the protocol by removing the interim_transcript_hash.

 �

In detail, a commit now proceeds as follows:

1. construct the MLSPlaintext with the Commit object and confirmation_tag=0,

2. sign the MLSPlaintext and include the result in the confirmed_transcript_hash,

3. advance the key schedule and update the confirmation_tag in the MLSPlaintext.

 �

If the working group generally agrees on the above approach, we'll be happpy to draft a PR.

 �

Best,

Marta

_______________________________________________
MLS mailing list
MLS@ietf.org <mailto:MLS@ietf.org> 
https://www.ietf.org/mailman/listinfo/mls