Re: Digest, trailers and buffering was: Re: Updating Digest header RFC3230 using "selected representation"

Roberto Polli <roberto@teamdigitale.governo.it> Wed, 24 July 2019 09:09 UTC

Return-Path: <ietf-http-wg-request+bounce-httpbisa-archive-bis2juki=lists.ie@listhub.w3.org>
X-Original-To: ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com
Delivered-To: ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 2A1AE120127 for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Wed, 24 Jul 2019 02:09:29 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.751
X-Spam-Level:
X-Spam-Status: No, score=-2.751 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.249, MAILING_LIST_MULTI=-1, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=teamdigitale.governo.it
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 lusnr1nWRHCg for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Wed, 24 Jul 2019 02:09:25 -0700 (PDT)
Received: from frink.w3.org (frink.w3.org [IPv6:2603:400a:ffff:804:801e:34:0:38]) (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 121E8120124 for <httpbisa-archive-bis2Juki@lists.ietf.org>; Wed, 24 Jul 2019 02:09:23 -0700 (PDT)
Received: from lists by frink.w3.org with local (Exim 4.89) (envelope-from <ietf-http-wg-request@listhub.w3.org>) id 1hqDEL-0001UX-T0 for ietf-http-wg-dist@listhub.w3.org; Wed, 24 Jul 2019 09:06:37 +0000
Resent-Date: Wed, 24 Jul 2019 09:06:37 +0000
Resent-Message-Id: <E1hqDEL-0001UX-T0@frink.w3.org>
Received: from titan.w3.org ([2603:400a:ffff:804:801e:34:0:4c]) by frink.w3.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from <roberto@teamdigitale.governo.it>) id 1hqDEI-0001Th-Ev for ietf-http-wg@listhub.w3.org; Wed, 24 Jul 2019 09:06:34 +0000
Received: from mail-ed1-x544.google.com ([2a00:1450:4864:20::544]) by titan.w3.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from <roberto@teamdigitale.governo.it>) id 1hqDEE-00072D-LB for ietf-http-wg@w3.org; Wed, 24 Jul 2019 09:06:34 +0000
Received: by mail-ed1-x544.google.com with SMTP id w20so46415904edd.2 for <ietf-http-wg@w3.org>; Wed, 24 Jul 2019 02:06:09 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=teamdigitale.governo.it; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=/T5U8Dk1f8N79IWrOPLN9DmjDF0En5u07Y6go6qicKU=; b=RDr/kgW9a+zAayWj6kaqGmrucIJNufgntdGf6lm+nTX+b/jA6DCxFiZbAU8f3bTXhr cTiNBVboEbPhKQWW44aoRktHC1NiAfN6DEIizwvn9Wp081dsVpr7b5b+RRBopq3MlqH4 mt2eYgaegb76XJG1g92rNhOCImdhdzIjT7+xdmj6QgE/mfco592J6gYc+D8sexd70XWy qSMq15mWVjaWhR6iNxL6dYM2Ut7bXUtnctaeVonuR/EqoTYe8CfcWc1TX1jAEwCIEh3s mJxpx3lKwmmfeTFn4W4efEkDqlN9gugNJ+3faYP/SFcWAhLmDaFqdpIwyfsmz2T5j5AO DJZQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=/T5U8Dk1f8N79IWrOPLN9DmjDF0En5u07Y6go6qicKU=; b=Zzh0qn96LfLzJ13IbyeSC2kOB5CYBc8VWfBr2hiUgLc14dDVJgDnXI6xE2vyAOy2Hm Vof/KPaehayNMqiQ7yye/4jasuJNymN59Sx11WsUgty9JZhCr5QsoJNnnh6jS0ykU77b 68fYv51EDC9N5CnfluqyG3EuDPq369cc9v8sGGHKtGW1smRcvN5az3CCrOh8lDLwH5qW PJMYp7CEQYY7smRXwk8pGesRKkZqg8qUvZW1ZuXVP+VpcsVgGoN/vWb2s2Mxvogtmt7E ehbYgbXywh39RixC74Pju3TEUzsdgnfnkSHfs+bVoxrKm+QrKz+ytiw/q2E/MiPg+u3S 1E1g==
X-Gm-Message-State: APjAAAXPJhanxVEqKfM578mW/89T3LrvykVxP9QjJFh5Dg2bX79mjAOs MAZR/bPTx8SqO0Wg17Iv1eXXCjJVX4n9k/xiWoA=
X-Google-Smtp-Source: APXvYqxAbC1GuQC9Fi6ybNZtMmFXg0Ku0ebNzRGuiNLIuyyCGhDSJLXghIrZ6OzAW1/RBq7a8WC92ISyd6livgH0FlQ=
X-Received: by 2002:a50:d1c6:: with SMTP id i6mr69188752edg.110.1563959168349; Wed, 24 Jul 2019 02:06:08 -0700 (PDT)
MIME-Version: 1.0
References: <CAMRHeuyk-xv2oRmcVrFaesneVi4F-EcuttsJU5PKtGrVtP+gSA@mail.gmail.com> <CALGR9obe6mPMCW2O1gf0muWgoT4Nusy8CsoixgENWKTSEf4rGA@mail.gmail.com> <CAMRHeux6=i0Xkg5XPXp8PCZiiLopGkYGTPWztghfzgUx+XF5=Q@mail.gmail.com> <CALGR9oYbZpKMThSJqSAheRfE8NVnDkhMYSbRP-gYnc5-5k8LmQ@mail.gmail.com> <CAChr6SyxGEfV1rHjX8oMLvB-osdgsbjWjkeWAWbPfGAFdC4Zwg@mail.gmail.com> <CAChr6SynBvPB+6yBnKk9z9FFZs0ZynremyntGGyT2Q3S0tmY1g@mail.gmail.com> <CALGR9oavnNtKXhAAs8aR02TTrWzPVyuW0oQcxe+qqHei7n-pCQ@mail.gmail.com> <CAChr6SzUzJpVH=Jz43DkbZq9gyf1RtYdQPReyweo5kA76yECDQ@mail.gmail.com> <CALGR9obz3e_os3MXyW9hBU8PLPjhuAUYy5UeYq3_5tW46nqEeA@mail.gmail.com> <CAChr6Swq-DTseOMc=n61vPYz4XmmRD3Yx7NKWAX5p6QqCwUJdA@mail.gmail.com>
In-Reply-To: <CAChr6Swq-DTseOMc=n61vPYz4XmmRD3Yx7NKWAX5p6QqCwUJdA@mail.gmail.com>
From: Roberto Polli <roberto@teamdigitale.governo.it>
Date: Wed, 24 Jul 2019 11:05:57 +0200
Message-ID: <CAMRHeuxPnBrVHK=bHG+dh5UcEZn+_5A5TAgSwTnFrWmUyDGwEA@mail.gmail.com>
To: Rob Sayre <sayrer@gmail.com>
Cc: Lucas Pardue <lucaspardue.24.7@gmail.com>, HTTP Working Group <ietf-http-wg@w3.org>
Content-Type: text/plain; charset="UTF-8"
Received-SPF: pass client-ip=2a00:1450:4864:20::544; envelope-from=roberto@teamdigitale.governo.it; helo=mail-ed1-x544.google.com
X-W3C-Hub-Spam-Status: No, score=-1.3
X-W3C-Hub-Spam-Report: AWL=2.683, BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, W3C_AA=-1, W3C_WL=-1
X-W3C-Scan-Sig: titan.w3.org 1hqDEE-00072D-LB 1b70cceb373bd440b70362f28550690b
X-Original-To: ietf-http-wg@w3.org
Subject: Re: Digest, trailers and buffering was: Re: Updating Digest header RFC3230 using "selected representation"
Archived-At: <https://www.w3.org/mid/CAMRHeuxPnBrVHK=bHG+dh5UcEZn+_5A5TAgSwTnFrWmUyDGwEA@mail.gmail.com>
Resent-From: ietf-http-wg@w3.org
X-Mailing-List: <ietf-http-wg@w3.org> archive/latest/36831
X-Loop: ietf-http-wg@w3.org
Resent-Sender: ietf-http-wg-request@w3.org
Precedence: list
List-Id: <ietf-http-wg.w3.org>
List-Help: <https://www.w3.org/Mail/>
List-Post: <mailto:ietf-http-wg@w3.org>
List-Unsubscribe: <mailto:ietf-http-wg-request@w3.org?subject=unsubscribe>

Hi Rob,

thanks for your feedback! I try to reply per-point.


0- Digest use cases
> Rob: If the message is small, it's also likely that TLS is good enough in that case
> Lucas: Digest allows for integrity protection of the object over multiple hops and, importantly, at rest.
Lucas is right. Digest is mainly used to provide  a basic form of
non-repudiation of origin.

1- send a digest header with the "payload checksum"
2- send a signature protected http message where the signature covers
the digest header;
3- store the message, digest and signature.

See https://github.com/httpwg/http-extensions/blame/master/draft-ietf-httpbis-digest-headers.md#L129
See https://github.com/httpwg/http-extensions/blame/master/draft-ietf-httpbis-digest-headers.md#L686-L690

1- about HTTP/1.1 trailers.
> One issue that prevented the adoption of this header and related ones (e.g. Content-MD5) was that
> HTTP/1.1 trailers had a lot of interoperability problems
> Sending the digest as a trailer reduces costs for the sender, whether it's an upload or download. .

If you mean https://tools.ietf.org/html/rfc7230#section-4.4, they
apply to transfer coded messages, so iiuc
the only reasonable way to send Digest in a trailer was if the message
was transfer-coded from the
beginning by the Origin-Server. Do you agree?

2- about huge payload
> This made it expensive for large files, or impossible to use for message bodies that couldn't be pre-calculated.
I stubbed a reply in the section "Server resource exhaustion for
calculating Digest on huge representation-data"
of  https://github.com/httpwg/http-extensions/issues/852#issuecomment-514541274
You can comment there!

Suggestion and clarifications hints are very welcome!

Your comments are very interesting
and appreciated!

Thanks Rob,
R:
--