Re: [Acme] Specify which JWS serialization is used

Logan Widick <logan.widick@gmail.com> Sat, 13 January 2018 00:08 UTC

Return-Path: <logan.widick@gmail.com>
X-Original-To: acme@ietfa.amsl.com
Delivered-To: acme@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id B1D8F124205 for <acme@ietfa.amsl.com>; Fri, 12 Jan 2018 16:08:51 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.698
X-Spam-Level:
X-Spam-Status: No, score=-2.698 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-0.7, 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=gmail.com
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 nyO7GCv8fsWn for <acme@ietfa.amsl.com>; Fri, 12 Jan 2018 16:08:49 -0800 (PST)
Received: from mail-io0-x22d.google.com (mail-io0-x22d.google.com [IPv6:2607:f8b0:4001:c06::22d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 13BD0120725 for <acme@ietf.org>; Fri, 12 Jan 2018 16:08:49 -0800 (PST)
Received: by mail-io0-x22d.google.com with SMTP id f34so2369467ioi.13 for <acme@ietf.org>; Fri, 12 Jan 2018 16:08:49 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=Wmv+8bm8b3hMxb0dV/P1DOKVl4yq2aiHNuA7VJUExcg=; b=Jq+TebXDTk2J7WBUdyMlh14XgTgwRL7DMgtzfP2dAl8SoTPHqZ572H0qNPxov1P4AD 0E7iMwyLSp3eigk4S966te8r9qqV/It0EPPoWIULA80atjHO76GBg/o+p8jWOl6DYv4x kSE2hp6M7axBtLZ8VNcaTvE1T3ULskOUaPEI1OGgiceBwam50j2QtiY9nMC8EoFKSG4P ZUJa/wAtPFcQXe9cqQ7s/sEIaNUGgQESlp5aJ0DnBJ7QPEAl7l8Xzr1pdDVQlzcNot5z gZRuqzv+TpCOaKjBrcOyinFFhtwF0MU4BLR3aGUlaIVfmo9I1zC8m32SqF2FKD1t6kgI gpXw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=Wmv+8bm8b3hMxb0dV/P1DOKVl4yq2aiHNuA7VJUExcg=; b=nSCSwa3XlXUgqPSv1su2QINVHD5NAmTg9l++sPuSNxhZ3O/NwpcxDr/rXnDG/9t3h7 wpm2CuaG8nTyPWXdHWpG1z2QMcoY7JNU2h8DWqS2fL8i3kng9fQlrYLSETR5ARER3AQh ZTvaIkwvb3WuzCJ1w9XkEtyHv8UU6MbIqf7+Q/RCE2qzy5M1NQJXri89rLwm1a05OfJO 8ZeSsuH5iakvHLKzrWjWC4EuacB3MDk3EyNd+lUay6D2CE+ZenaUVn8L7Hk6VsTfk0ZA NNV3BqubSB+4cH3GYe2pjZx+1crKBuh5PF1R8XvKIYfUMU49uKrYdcwOAfLUA8c0DX8Z qYtg==
X-Gm-Message-State: AKwxyte17pmFRuSfvUnq1Xvd4PDK48qrqAZHOAgVwOCuLp5SWpt8jpYz q3qGZAtN2EyLlrybifB66ThsEIq65uF2Zfjx/bNZZQ==
X-Google-Smtp-Source: ACJfBosh+sfmSLgdIQtVeqyfJOVDRO+j8jIh78DuAGb6D3W4ZW2JcI5xObnHYAOd+ZmOHRaQ4uaKYHehVzoZpjz0tU4=
X-Received: by 10.107.79.2 with SMTP id d2mr25407427iob.170.1515802128131; Fri, 12 Jan 2018 16:08:48 -0800 (PST)
MIME-Version: 1.0
Received: by 10.2.152.59 with HTTP; Fri, 12 Jan 2018 16:08:47 -0800 (PST)
In-Reply-To: <20180106001126.GB3076@carrot.tutnicht.de>
References: <20180103230734.GM21695@carrot.tutnicht.de> <20180103234718.GA1340@bacardi.hollandpark.frase.id.au> <CAMmAzEKj33xOVhUK+i2UrHpvTBj=hz89DRyaFvTqAig4f66K-Q@mail.gmail.com> <CAMmAzEKSv1pbKC80JLpRQxTrGApc7KVu6A7cqDp-Tmrcq4vvLg@mail.gmail.com> <20180104110204.GP21695@carrot.tutnicht.de> <CAMmAzEKJhMaUBtCWSNZyGv-f+-edZ-WTq3=WFD_b1bXfvua89A@mail.gmail.com> <20180106001126.GB3076@carrot.tutnicht.de>
From: Logan Widick <logan.widick@gmail.com>
Date: Fri, 12 Jan 2018 19:08:47 -0500
Message-ID: <CAMmAzELgjpAmVCX6YB0VMvNQV3NH3NDdM_pdcz6d+h=ZO2rJww@mail.gmail.com>
To: Jörn Heissler <acme-specs@joern.heissler.de>
Cc: ACME WG <acme@ietf.org>, Fraser Tweedale <frase@frase.id.au>
Content-Type: multipart/alternative; boundary="f4f5e803beb065ac9505629d2f1d"
Archived-At: <https://mailarchive.ietf.org/arch/msg/acme/amjy9_iztD5TdPep8mLLU2sWX2c>
Subject: Re: [Acme] Specify which JWS serialization is used
X-BeenThere: acme@ietf.org
X-Mailman-Version: 2.1.22
Precedence: list
List-Id: Automated Certificate Management Environment <acme.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/acme>, <mailto:acme-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/acme/>
List-Post: <mailto:acme@ietf.org>
List-Help: <mailto:acme-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/acme>, <mailto:acme-request@ietf.org?subject=subscribe>
X-List-Received-Date: Sat, 13 Jan 2018 00:08:51 -0000

Last night, I briefly surveyed the listings of JWT implementations on jwt.io.
I could find only a small handful that appeared to support all
serializations, and even fewer that appeared to give programmers control
over what serialization was produced. Thus, assuming jwt.io is a
sufficiently accurate and comprehensive listing of implementations of all
and/or part of the JOSE specs, the developers of many ACME client and
server implementations may find themselves needing to convert between
serializations before and/or after using JOSE libraries. Such conversion
processes, if needed, should be well-documented somewhere.

I've started on a very rough draft of a possible JWS and JWE serialization
conversion guide at
https://github.com/uhhhh2/jwe-jws-serialization-conversion-guide. I made
the conversion guide draft by copying a few items from the ACME GitHub
repository (the Markdown file, the makefile, and the .gitignore), replacing
the text from the Markdown file, and renaming the Markdown file. I designed
the conversion guide draft to be non-ACME specific, so I've tried to
include things like unencoded JWS payloads, JWEs, multiple signatures,
detached payloads, etc. If you have any changes or suggestions, please let
me know.

Logan

On Fri, Jan 5, 2018 at 7:11 PM, Jörn Heissler <acme-specs@joern.heissler.de>
wrote:

> On Thu, Jan 04, 2018 at 08:03:55 -0600, Logan Widick wrote:
> > What do you think of the following:
>
> > Content type application/jose+json: MUST be supported. If used, the JWS
> > will need to be in the Flattened or General serialization. Flattened MUST
> > be supported; General MAY be supported.
>
> > Content type application/jose: MAY be supported. If used, the JWS MUST
> use
> > the Compact serialization. Or should this content type not be allowed?
>
> Agreed. I wouldn't disallow "compact". And it could be clarified:
>
> The server SHOULD use the "Content-Type" HTTP header as an indication
> for the request format.
>
> > JWS Unprotected Header: Not currently used in ACME. Should this be banned
> > in ACME?
>
> I don't see much sense in those. But some client implementations might
> automatically add an unprotected header like e.g. "cty".
> Maybe with a "SHOULD NOT"?
>
> > Multiple signatures: MAY be supported.
>
> > Should messages signed by both MAC keys and private keys be allowed?
>
> This is already forbidden.
>
> > What about Key IDs not issued by the CA?
> > Or are multiple signatures more trouble than they're worth to the point
> of
> > banning them entirely?
> >
> > Multiple signatures on messages that need to be signed by account key: At
> > least one signature MUST be from the account key
> >
> > Multiple signatures on revokeCert: Should this be allowed?
> >
> > Multiple signatures on externalAccountBinding field of newAccount: Should
> > it be possible to bind to multiple pre-existing accounts? Or should this
> > not be allowed?
> >
> > Multiple signatures on newAccount: Not allowed?
> >
> > Multiple signatures on keyChange: Not allowed for outer or inner JWS?
>
> I see no use case. All the authentication is based on accounts and those
> have exactly one keypair. Having multiple signatures would equal using
> multiple accounts at the same time. That makes no sense to me.
> Client libs would probably not generate multiple signatures
> automatically.
> Multiple signatures should be banned in my opinion.
>
> > JWS Unencoded Payload Option (RFC 7797): Not allowed?
>
> Yep, they would make things very complicated.
>
> > Conversion guide between the different JWS serialization formats: Is it
> > completely safe to assume that any and all programmers given the JWS RFC,
> > pre-existing JWS implementations with sufficient documentation, and
> > pre-existing JSON libraries with sufficient documentation could figure
> out
> > how to convert the serialization formats as needed?
>
> Why, yes! Of course every programmer can do that! ;-)
>
> > Or is the conversion
> > guide necessary? If the guide is necessary, then include a reference to a
> > separate new or pre-existing conversion guide. If the guide is necessary,
> > and there is no pre-existing conversion guide, how should the new
> > conversion guide be published? Should the new conversion guide be
> > ACME-specific, or more general (possibly with coverage of JWE as well as
> > JWS features not utilized in ACME)?
>
> It's not necessary, *most* programmers can figure it out. But it would
> doubtlessly be helpful. E.g. I didn't consider the possibility to do
> this conversion in an ACME implementation before/after using a preexisting
> JOSE lib.
> If such a guide were to be published, it should not be ACME-specific.
>
>
> Cheers
> Jörn
>