Re: [TLS] Comments on

Adam Langley <agl@imperialviolet.org> Tue, 18 February 2014 02:05 UTC

Return-Path: <alangley@gmail.com>
X-Original-To: tls@ietfa.amsl.com
Delivered-To: tls@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 37EF01A0431 for <tls@ietfa.amsl.com>; Mon, 17 Feb 2014 18:05:50 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.278
X-Spam-Level:
X-Spam-Status: No, score=-1.278 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FM_FORGED_GMAIL=0.622, FREEMAIL_FROM=0.001, SPF_PASS=-0.001] autolearn=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 kIIKvvQkgvmQ for <tls@ietfa.amsl.com>; Mon, 17 Feb 2014 18:05:48 -0800 (PST)
Received: from mail-la0-x235.google.com (mail-la0-x235.google.com [IPv6:2a00:1450:4010:c03::235]) by ietfa.amsl.com (Postfix) with ESMTP id 8B7C81A02E4 for <tls@ietf.org>; Mon, 17 Feb 2014 18:05:48 -0800 (PST)
Received: by mail-la0-f53.google.com with SMTP id e16so11582294lan.26 for <tls@ietf.org>; Mon, 17 Feb 2014 18:05:45 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=xxWunYlq9B+Ns7u7lY5fjwE/2RyHuf0Zj4E7q8YbyVc=; b=tuBObRO0zZg+e28+dX29RANDxhRogARFhP9tzZZJUAi5eCTZKuWxvv9j8ko24XHvaN NCPa9FFp4H+FMh9N5fMsJ7e5xAbXRdJV9Fo6RJx+qFvfcpGBuOleVSi0W6eNX4p2ZtZI OqvuWnb/6dZTGdM0p23zKNvZApU2Mo6ScAeVMF6wFFSSYvXk0WGKc0XC4jm8sHtkR+gm RSgdk6X327vc7B9kwbaIvMj0uMn9HDzfKDcPTmvCo9ELwmI8LGjOkmKpGYqHdmVCYZA7 tr70YbB3FlDgw1Zel01q9c4C14hf2JhPyRCOvrpF+nHjxALA6ICe4kVx0iIFJR+vn97c Jwnw==
MIME-Version: 1.0
X-Received: by 10.153.3.2 with SMTP id bs2mr19563652lad.5.1392689145040; Mon, 17 Feb 2014 18:05:45 -0800 (PST)
Sender: alangley@gmail.com
Received: by 10.112.33.199 with HTTP; Mon, 17 Feb 2014 18:05:44 -0800 (PST)
In-Reply-To: <CACsn0cncSn61Z3FkbcF_S32mah=3DtNkygHMB31+_UgQr6n5Ag@mail.gmail.com>
References: <nnha83nwy9.fsf@bacon.lysator.liu.se> <CAL9PXLyWhqSdG5YRyrOprW5wgCYCwHn7_a=R2sb+mN-irkMYbA@mail.gmail.com> <nna9dum6fk.fsf@bacon.lysator.liu.se> <CAL9PXLyC98rc73x7o4gDeu-UBz1k0VP_qTdbCqgSSObuKf9+LA@mail.gmail.com> <nnsirlldyf.fsf@bacon.lysator.liu.se> <CAL9PXLzgHqguYfKwhiVyjDeSCUkqwbsoujAcz8UPN0FQyfaodg@mail.gmail.com> <1392624588.30995.10.camel@dhcp-2-127.brq.redhat.com> <CACsn0cncSn61Z3FkbcF_S32mah=3DtNkygHMB31+_UgQr6n5Ag@mail.gmail.com>
Date: Mon, 17 Feb 2014 21:05:44 -0500
X-Google-Sender-Auth: SOnr1KCdFtPjNpvbBCHWUknqowY
Message-ID: <CAMfhd9VzWwR1tepdMGVUFGDm=skHT_NHSFPPySdN1z6vMeLUcw@mail.gmail.com>
From: Adam Langley <agl@imperialviolet.org>
To: Watson Ladd <watsonbladd@gmail.com>
Content-Type: text/plain; charset="UTF-8"
Archived-At: http://mailarchive.ietf.org/arch/msg/tls/DdPqBHtMjMC-ukKXg_S4UDG3t_w
Cc: Niels Möller <nisse@lysator.liu.se>, "tls@ietf.org" <tls@ietf.org>
Subject: Re: [TLS] Comments on
X-BeenThere: tls@ietf.org
X-Mailman-Version: 2.1.15
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, 18 Feb 2014 02:05:50 -0000

On Mon, Feb 17, 2014 at 10:45 AM, Watson Ladd <watsonbladd@gmail.com> wrote:
> Alternatively, we can
> encrypt the entire file as one big chunk and decrypt on receipt.  I've
> still not found a case where one of these doesn't work.

I don't believe that there's any disagreement about the fact that
operating on the file as one, large chunk works, technically.

The problem is that I believe that it results in dangerous APIs. For
example, OpenPGP does this and I was very unhappy about it when
writing this[1] implementation which returns unverified plaintext. I
called the Reader "UnverifiedBody" and put a big comment in there but
I think we should be able to do better. The point of AEADs was to
provide a safer abstraction in the first place, no?

(Niels suggested buffering everything before returning anything and
that's certainly safe. But I feel that it's somewhat anti-social for a
library to do so.)

[1] https://code.google.com/p/go/source/browse/openpgp/read.go?repo=crypto#38


Cheers

AGL

-- 
Adam Langley agl@imperialviolet.org http://www.imperialviolet.org