Re: [Acme] ACME signature mechanics

Anders Rundgren <anders.rundgren.net@gmail.com> Wed, 17 December 2014 04:53 UTC

Return-Path: <anders.rundgren.net@gmail.com>
X-Original-To: acme@ietfa.amsl.com
Delivered-To: acme@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id C9B5A1A1BED for <acme@ietfa.amsl.com>; Tue, 16 Dec 2014 20:53:49 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2
X-Spam-Level:
X-Spam-Status: No, score=-2 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, SPF_PASS=-0.001] autolearn=ham
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 ZFAFPZZKBuxq for <acme@ietfa.amsl.com>; Tue, 16 Dec 2014 20:53:47 -0800 (PST)
Received: from mail-wg0-x22b.google.com (mail-wg0-x22b.google.com [IPv6:2a00:1450:400c:c00::22b]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 8D2BE1A1BCF for <acme@ietf.org>; Tue, 16 Dec 2014 20:53:47 -0800 (PST)
Received: by mail-wg0-f43.google.com with SMTP id l18so19268798wgh.16 for <acme@ietf.org>; Tue, 16 Dec 2014 20:53:46 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=aKb35QcuCSGjc7SduwGuPI7hzs8UpKfSz6K6hgSo6Es=; b=XXEWqU9EdAdbRDJ6653kkCqaVYOxD6MQxhGZ/e6mD5Ove5LXocA/vvwcCRBwbL5sGk oRo0IhKWuecwyM7b3KPYq47QmWE7Vdpd/Fvy/+yqkab+7hRm2mh0zYgWUYydLQhZ6q+N 0+vWXMkBZV8YZ1TFLMmN6UvnjRcJ5hbCaInLYwVkCyniyvTcA3R2fRYbLSrX2A/OXwI7 aBu4zd2MDf3zkr/CvPBccXkcFAI3ePyNLaIy5574DL346xIQ3J5mVOGQqq1lf10x0I1Q Of2bjU1QE/bEczoNEVcO/gShFdwPb1TafEpcmrmJ/W6KJ4/aXaxWgW4kJcefmEN8Z6+2 STJw==
X-Received: by 10.180.20.106 with SMTP id m10mr10614860wie.1.1418792026243; Tue, 16 Dec 2014 20:53:46 -0800 (PST)
Received: from [192.168.1.79] (52.16.14.81.rev.sfr.net. [81.14.16.52]) by mx.google.com with ESMTPSA id t6sm3514927wjf.49.2014.12.16.20.53.45 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 16 Dec 2014 20:53:45 -0800 (PST)
Message-ID: <54910C53.7000107@gmail.com>
Date: Wed, 17 Dec 2014 05:53:39 +0100
From: Anders Rundgren <anders.rundgren.net@gmail.com>
User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0
MIME-Version: 1.0
To: Richard Barnes <rlb@ipv.sx>
References: <548FF9E3.1020703@gmail.com> <CAL02cgT9iYqtX2Ui5XQYnj=yeF_QnSkKn-jE0D5d56WMzB5bBg@mail.gmail.com>
In-Reply-To: <CAL02cgT9iYqtX2Ui5XQYnj=yeF_QnSkKn-jE0D5d56WMzB5bBg@mail.gmail.com>
Content-Type: text/plain; charset="UTF-8"; format="flowed"
Content-Transfer-Encoding: 7bit
Archived-At: http://mailarchive.ietf.org/arch/msg/acme/FO2_JoMh_h5voUqQBsN9PKaOIMs
Cc: "acme@ietf.org" <acme@ietf.org>
Subject: Re: [Acme] ACME signature mechanics
X-BeenThere: acme@ietf.org
X-Mailman-Version: 2.1.15
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: <http://www.ietf.org/mail-archive/web/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: Wed, 17 Dec 2014 04:53:50 -0000

On 2014-12-16 17:27, Richard Barnes wrote:
> I think there might be a middle way here.  I've been musing about making a "Content-Signature" header that just carries a JWS signature over the payload (no HTTP headers).  Since HTTP has to carry the payload bit-exact, there's no c14n nonsense, so this could be much simpler than other HTTP signing proposals.  It's sort of like JCS, except that there is actually a guarantee that the payload stays the same ;)

I see.  This looks possible but is also a bit of a hack since such signatures can only be verified in a HTTP context.  I would stick to your original JWS transition plan.

BTW, JCS does not depend on any c14n nonsense; it only requires that JSON property order is respected by the serializer/deserializer while whitespace is entirely insignificant.  You can even verify pretty-printed signatures!


>
> That said, if your concern is really human readability, I don't think it's a tragedy to make someone copy/paste into a base64 decoder.

Human readability happens on several levels from documentation to debugging.
That headers and payload are disjunct makes these things slightly less appealing.
It also means that you can't make a unified JSON schema for a message object.

But it surely isn't a show-stopper :-)

For KeyGen2 and my payment related work-items the situation is different since these schemes use multiple and wrapping signatures which JWS doesn't handle in a way that I feel would be acceptable.

If the CSR would be rewritten in JSON, ACME would be in a comparable position...

Cheers,
Anders

>
> On Tue, Dec 16, 2014 at 4:22 AM, Anders Rundgren <anders.rundgren.net@gmail.com <mailto:anders.rundgren.net@gmail.com>> wrote:
>
>     When the transition to JWS has been made, human-readable ACME messages like
>
>        {
>          "type": "certificateRequest",
>          "csr": "5jNudRx6Ye4HzKEqT5...FS6aKdZeGsysoCo4H9P",
>          "signature": {
>            "alg": "RS256",
>            "nonce": "h5aYpWVkq-xlJh6cpR-3cw",
>            "sig": "KxITJ0rNlfDMAtfDr8eAw...fSSoehDFNZKQKzTZPtQ",
>            "jwk": {
>              "kty":"RSA",
>              "e":"AQAB",
>              "n":"KxITJ0rNlfDMAtfDr8eAw...fSSoehDFNZKQKzTZPtQ"
>       }  }  }
>
>     will rather look like
>
>     {
>       "payload":"<base64>",
>       "protected":"<base64>",
>       "header":<base64>,
>       "signature":"<base64>"
>     }
>
>     Which apart from being ugly JWS also requires a JSON schema validator (or similar
>     mechanism) to work on separate, unpacked parts of the message.
>
>     Although I don't expect this to change, you may (or may not) want to know that
>     clear-text JSON signatures (without the complexity of XML DSig), is not black magic,
>     you only have to use JSON parsers that doesn't "manipulate" input data:
>     https://openkeystore.googlecode.com/svn/resources/trunk/docs/jcs.html#Sample_Signature
>
>     Cheers
>     AndersR
>
>     _______________________________________________
>     Acme mailing list
>     Acme@ietf.org <mailto:Acme@ietf.org>
>     https://www.ietf.org/mailman/listinfo/acme
>