Re: [http-auth] Richard Barnes' Discuss on draft-ietf-httpauth-hoba-09: (with DISCUSS and COMMENT)

Richard Barnes <rlb@ipv.sx> Thu, 08 January 2015 10:23 UTC

Return-Path: <rlb@ipv.sx>
X-Original-To: http-auth@ietfa.amsl.com
Delivered-To: http-auth@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id EF41F1ACD03 for <http-auth@ietfa.amsl.com>; Thu, 8 Jan 2015 02:23:30 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.977
X-Spam-Level:
X-Spam-Status: No, score=-1.977 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, FM_FORGED_GMAIL=0.622, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-0.7] autolearn=unavailable
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 otVCYJFP-L_l for <http-auth@ietfa.amsl.com>; Thu, 8 Jan 2015 02:23:27 -0800 (PST)
Received: from mail-lb0-f177.google.com (mail-lb0-f177.google.com [209.85.217.177]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id D11341ACD00 for <http-auth@ietf.org>; Thu, 8 Jan 2015 02:23:26 -0800 (PST)
Received: by mail-lb0-f177.google.com with SMTP id b6so2036692lbj.8 for <http-auth@ietf.org>; Thu, 08 Jan 2015 02:23:25 -0800 (PST)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=IUyWYgz09cdH9MN9Y/d9zjubZyxW6AmdXTADesf3jdc=; b=IfF7DDy78ToVTbnqD7b37YrNJEOrN3+RuIbRguQX4BJbCJRUV9qePvW0sEeHN69687 fmFCy3dg7vw+pKSHoYAqhr2rl/xoUpzBuLO6sHgUybX8gndGX/wzhHdvnyr/cG+4+R62 AegRBnwJFFcJsmOiHIiK3u7aMa+KkWk0FybIOpsVFw1noIGMYVlIBAHD/RlkbKUriOX3 4L53hTKP7JZNiX8/bqyUznVZDRzMLMLZYxQk8+wUy4oQzeVE7Egcf/RsBo8isYb6Xt50 uKZOMjjFiCRIbblCQHEYm2qlvAu6as3xA8AP+is6Usblu+rIdLsEf7ES1ACt9dcIazKf qyMA==
X-Gm-Message-State: ALoCoQlRYzVtT0uGhMU5trQIS/kjFIBEpk25eE/eSV+4cB30o4OZy0eSqzQOs07jEfnQwAXTYDqw
MIME-Version: 1.0
X-Received: by 10.152.29.129 with SMTP id k1mr12198370lah.10.1420712605184; Thu, 08 Jan 2015 02:23:25 -0800 (PST)
Received: by 10.25.12.215 with HTTP; Thu, 8 Jan 2015 02:23:25 -0800 (PST)
In-Reply-To: <54ADDC98.4000009@cs.tcd.ie>
References: <20150108002015.24345.3508.idtracker@ietfa.amsl.com> <CAEB21E0-EF1C-4F48-8434-1B85AEC3C113@vpnc.org> <54ADDC98.4000009@cs.tcd.ie>
Date: Thu, 08 Jan 2015 10:23:25 +0000
Message-ID: <CAL02cgTg4UJ80_032eEgjnBZ4OBLUwXReg50Vmi-A1eDHsLqAQ@mail.gmail.com>
From: Richard Barnes <rlb@ipv.sx>
To: Stephen Farrell <stephen.farrell@cs.tcd.ie>
Content-Type: multipart/alternative; boundary="089e0160b7da290c13050c216ee2"
Archived-At: <http://mailarchive.ietf.org/arch/msg/http-auth/MGB-KvUYIyfiOpVbINaxBLJFUiU>
Cc: draft-ietf-httpauth-hoba.all@tools.ietf.org, http-auth@ietf.org, httpauth-chairs@tools.ietf.org, Paul Hoffman <paul.hoffman@vpnc.org>, The IESG <iesg@ietf.org>
Subject: Re: [http-auth] Richard Barnes' Discuss on draft-ietf-httpauth-hoba-09: (with DISCUSS and COMMENT)
X-BeenThere: http-auth@ietf.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: HTTP authentication methods <http-auth.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/http-auth>, <mailto:http-auth-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/http-auth/>
List-Post: <mailto:http-auth@ietf.org>
List-Help: <mailto:http-auth-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/http-auth>, <mailto:http-auth-request@ietf.org?subject=subscribe>
X-List-Received-Date: Thu, 08 Jan 2015 10:23:31 -0000

Hey guys,

Thanks for responding productively to a DISCUSS that I admit was not
written very politely.  Sorry about that.

Couple of comments inline.

On Thu, Jan 8, 2015 at 1:25 AM, Stephen Farrell <stephen.farrell@cs.tcd.ie>
wrote:

>
> FWIW, I'm fine that Paul's recollection of the WG stuff is better
> than mine and with his putting the pkcs#1 stuff in too.
>
> S
>
> On 08/01/15 01:19, Paul Hoffman wrote:
> > On Jan 7, 2015, at 4:20 PM, Richard Barnes <rlb@ipv.sx> wrote:
> >> (1) It does not seem to me that the mechanism defined in this document
> >> actually conforms to the framework for HTTP authentication.  The general
> >> framework defined in RFC 7235 is all scoped to a resource -- you can
> >> implement authorization for a specific resource, without impacting
> >> anything else on the server.  HOBA, by contrast, requires the
> >> authenticating resource to be also be correlated to several resource
> >> under .well-known, meaning that it will not be usable in a large number
> >> of deployment circumstances.  Was this issue discussed in the WG, and
> was
> >> there input from the broader HTTP community?
> >
> > Yes and yes. (Stephen is wrong that it was not.) The "authenticating
> resource" in HOBA is purposely more expressive than that in RFC 7235, and
> thus takes more primitives than HTTP auth. There was plenty of WG
> discussion around this.
>

If you happen to have a pointer to that discussion, it would help me feel
more comfortable.

To be a little clearer about my concern, it seems like the fact that you
don't carry the public key in the Authorization header means that the
authenticating resource has to be tied to the .well-known/hoba/register/
resource.



> >> (2) What is your justification for using a SHA-1 based signature in a
> new
> >> protocol, when it is being actively deprecated elsewhere, in particular
> >> the web PKI?
> >
> > RSA-SHA1 is widely implemented, and thus it seemed appropriate for a
> MAY-level definition when there is a more popular algorithm (RSA-SHA256) at
> MUST-level. Until RSA-SHA1 is a "MUST NOT" everywhere, there is no danger
> to having it here.
>

But if you're REQUIRED to support RSA-SHA256, why would you ever use
RSA-SHA1?

Color me pretty skeptical that there are implementations that can't support
SHA-2 nowadays.  I just saw a presentation yesterday about an IoT crypto
libary that fits within 64K and supports SHA-256 along with a bunch of
other algorithms.



> >> (3) "RSA modulus lengths of at least 2048 bits SHOULD be used." -> MUST
> >
> > There is no interoperability mandate for particular RSA key lengths, so
> "SHOULD" is more appropriate here (until the IESG finally gets around to
> updating RFC 2119...).
>

This is not about interop, it's about achieving an appropriate security
level.  That is another thing for which MUSTs are commonly used.

(If we're going to talk about 2119, the phrasing is "absolute requirement
of the specification", not "absolutely required for interop".)

To Stephen's point on JS performance: I made a little empirical test:
http://www.ipv.sx/tmp/rsa-2048.html

On a good laptop, a good phone, and a crappier phone, the time to generate
a 2048-bit key is roughly (choosing representative values after a few
clicks):
MacBook Pro: 5340ms
iPhone 6: 7192ms
FirefoxOS Flame: 31084ms

These values are not great, but they're within the range of asynchronous
operations that web pages already have to deal with, especially given that
keygen is a once-per-origin operation.  As far as sign() operations, the
worst case among these devices was ~500ms, which is again not terrible.



> >> (4) Given that the size of the header seems to be a concern (since
> you're
> >> not passing the key in the header), why are there no ECC signing
> >> algorithms defined?  It seems like if you used any of the normal curves,
> >> you could comfortably pass the key along with the authentication value.
> >
> > Because there is not yet agreement on which ECC signing algorithms are
> likely to be popular in a year or two. We're watching the CFRG discussion,
> and it is not yet coming to consensus. When it does, this Experimental RFC
> can be updated.
>

This is pretty weak sauce.  It's not like ECDSA with P-256 is going to go
away overnight when CFRG make up their minds.

Maybe I'm overly worried about the complexity here, but it seems like using
ECC could allow you to just shove the public key in the Authorization
header.  That would obviate the need for the registration resource,
resolving point 1 above, and generally make HOBA easier to implement.

Nonetheless, I moved this point to a COMMENT.


>> (5) For that matter, why bother defining a new algorithm registry at all,
> >> when JWA provides a perfectly nice one that only costs you 4 characters.
> >
> > We did not want to be tied to the JWA registry, given that JOSE could go
> in quite different directions.
>

Fair enough.  Cleared this one.



> >
> >> ----------------------------------------------------------------------
> >> COMMENT:
> >> ----------------------------------------------------------------------
> >>
> >> The HOBA-TBS construction seems really unnecessarily complicated.  Other
> >> than in the "origin" component, there are no ":" characters allowed in
> >> any of the components, so if you could remove the unnecessarily pretty
> >> serialization of the origin, you could just use ':' as a delimiter.  Or
> >> leave the origin, and delimit with something like %x20.  Either way,
> this
> >> length construction seems like a pain to implement by comparison.
> >
> > We started with a less complex construction, and the WG specifically
> asked for this.
> >
> >> "alg = 1*2DIGIT" - In general, it seems unwise to limit code point
> spaces
> >> unnecessarily.
> >
> > It is also unwise to have more than 99 possible algorithms for signing.
>

Sure, but that seems like a process issue, not one to enshrine in syntax.



> >> In addition to the funny title of Section 6.2.2, the contents seem kind
> >> of risible as well.  Making a OTP is 100% equivalent to the mechanism
> >> recommended in Section 6.2.3, and arguably more likely to deploy (since
> >> the OTP doesn't have special semantics of being a URI).
> >
> > There is wide disagreement on what is more likely to deploy. Also, I'm
> pretty sure Stephen is correct about your view on OTP here.
> >
> >> Please update the algorithms so that the reader doesn't have to go look
> >> up which algorithm this is (PKCS1 vs. PSS).
> >>
> >> OLD: "RSA is defined in Section 8.2 of [RFC3447]"
> >>
> >> NEW: "RSA indicates the RSASSA-PKCS1-v1_5 defined in Section 8.2 of
> >> [RFC3447]"
> >
> > Sounds good; now fixed in the post-IESG version.
> >
> >> Given how convoluted the use case is here, an example would be very
> >> helpful.  At the very least to demonstrate the syntax of the
> >> WWW-Authenticate header.
> >
> > This doesn't seem all that needed, regardless of your view of
> convolution.
> >
> > --Paul Hoffman
> > _______________________________________________
> > http-auth mailing list
> > http-auth@ietf.org
> > https://www.ietf.org/mailman/listinfo/http-auth
> >
>