Re: [OAUTH-WG] SPOP: Code Challenge Discussion

Nat Sakimura <sakimura@gmail.com> Wed, 03 December 2014 11:44 UTC

Return-Path: <sakimura@gmail.com>
X-Original-To: oauth@ietfa.amsl.com
Delivered-To: oauth@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 104FA1A1A74 for <oauth@ietfa.amsl.com>; Wed, 3 Dec 2014 03:44:17 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -0.799
X-Spam-Level:
X-Spam-Status: No, score=-0.799 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, J_CHICKENPOX_45=0.6, J_CHICKENPOX_46=0.6, 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 7m-Yg5Z4_5-y for <oauth@ietfa.amsl.com>; Wed, 3 Dec 2014 03:44:15 -0800 (PST)
Received: from mail-ie0-x235.google.com (mail-ie0-x235.google.com [IPv6:2607:f8b0:4001:c03::235]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id F17241A1A4E for <oauth@ietf.org>; Wed, 3 Dec 2014 03:44:14 -0800 (PST)
Received: by mail-ie0-f181.google.com with SMTP id tp5so13436322ieb.40 for <oauth@ietf.org>; Wed, 03 Dec 2014 03:44:14 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:references:from:date:message-id:subject:to:cc :content-type; bh=e495ACgo3Iu1SdCuO/ql9lsOEUR0VHUbLIcXTq8uNtM=; b=jEkUDT1M+qZJadWft1CNaLoiTWwObrwh6F6P8yeOmlXDC4DhPFwqJJV2YxrEdbFlXp 7ZXOQBgvGR7I0++taQr0VGjBzABe2lHjyym/OF0Wswu9Tp9dKzMyx+jj3tNCfK7ztngV 00oMuICAYiCygjImbTkREFB8Y/futkB1NJ41qwEDDrzqMTPg77hBj8GnS3bpzHenozjP 9vQ4sPhNy4yISBVvrM4PjmxGNAzKdf3CJ3EJJzFSPGAOkBHO+MvANfIzcCqRPznEoyzl 2jKFhsGi7LYd7aGXJHLDlrpSTM3HMBgYCu9HA2OKic0l0BVUPj/gKHONQtmW8KsSfbPI ZyCA==
X-Received: by 10.107.16.130 with SMTP id 2mr3924328ioq.81.1417607054128; Wed, 03 Dec 2014 03:44:14 -0800 (PST)
MIME-Version: 1.0
References: <547EF145.5030501@gmx.net> <B0DA0AD6-DE2C-4ECB-B2E2-04F369AAD610@ve7jtb.com>
From: Nat Sakimura <sakimura@gmail.com>
Date: Wed, 03 Dec 2014 11:44:13 +0000
Message-ID: <CABzCy2Cycth8CJww4B=ELDKhZAXR=9XVr0bgOQ-acv2oPt=Tkw@mail.gmail.com>
To: John Bradley <ve7jtb@ve7jtb.com>, Hannes Tschofenig <hannes.tschofenig@gmx.net>
Content-Type: multipart/alternative; boundary="001a113fbe2ee47dd305094e5c35"
Archived-At: http://mailarchive.ietf.org/arch/msg/oauth/HJLlnp41bhjXpSPxBbm6HHDIHb8
Cc: "oauth@ietf.org" <oauth@ietf.org>
Subject: Re: [OAUTH-WG] SPOP: Code Challenge Discussion
X-BeenThere: oauth@ietf.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: OAUTH WG <oauth.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/oauth>, <mailto:oauth-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/oauth/>
List-Post: <mailto:oauth@ietf.org>
List-Help: <mailto:oauth-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/oauth>, <mailto:oauth-request@ietf.org?subject=subscribe>
X-List-Received-Date: Wed, 03 Dec 2014 11:44:17 -0000

Thanks Hannes.

One question: we are recommending 32 octetes=256 bits to fill the sha256
range. Is there a reason for asking for a lesser entropy?
On 2014年12月3日(水) at 20:37 John Bradley <ve7jtb@ve7jtb.com> wrote:

> Thanks Hannes.
>
> Other methods such as different hashes need to be added via extension
> specs.
>
> Are you saying that we should set minimum recommendations for them.
>
> It is also possible that those methods might use something other than
> hashing.  Key agreement might be a possibility.
>
> Those properties would all be requirements for selecting a different hash
> function.   We could add that as a requirement for extensions if you think
> that is appropriate.
>
> John B.
>
> > On Dec 3, 2014, at 8:17 AM, Hannes Tschofenig <hannes.tschofenig@gmx.net>
> wrote:
> >
> > Hi all,
> >
> > I am trying to figure out how to progress the SPOP document and
> > therefore I read through the discussion about the code challenge, see
> >
> > I wanted to share my view about this topic.
> >
> > As a summary, the mechanism works as follows:
> >
> > C: Compute code_verifier:=rand()
> > C: Compute code_challenge:=func(code_verifier)
> >
> > (For this discussion, the function func() is SHA-256.)
> >
> > C: Send(Authz Request + code_challenge,S)
> >
> > S: store code_challenge
> > S: Send(Authz Grant,C)
> >
> > C: Send(Access Token Request || code_verifier, S)
> >
> > S: Compute code_challenge':=func(code_verifier)
> > S: IF (code_challenge'==code_challenge) THEN SUCCESS ELSE FAIL.
> >
> > The document currently does not say how much entropy the random number
> > has to have.
> >
> > The text only talks about the output size and SHA-256 indeed produces a
> > 256 bit output.
> >
> > Here is the relevant text:
> >
> > "
> >   NOTE: code verifier SHOULD have enough entropy to make it impractical
> >   to guess the value.  It is RECOMMENDED that the output of a suitable
> >   random number generator be used to create a 32-octet sequence.
> > "
> >
> > I suggest to recommend at least 128 bits, which is inline with the
> > recommendations for symmetric ciphers in
> > http://tools.ietf.org/html/draft-ietf-uta-tls-bcp-07
> >
> > I would also suggest to reference RFC 4086 concerning the creation of
> > random numbers.
> >
> > Furthermore, since you allow other hash functions to be used as well it
> > would be good to give guidance about what the properties of those hash
> > functions should be. You definitely want a cryptographic hash function
> > that provides pre-image resistance, second pre-image resistance, and
> > collision resistance.
> >
> > Given the size of the input and output it is impractical to compute a
> > table that maps code_verifies to code_challenges.
> >
> > This mechanism provides better properties than the "plain" mechanism
> > since it deals with an attacker that can see responses as well as
> > requests (but cannot modify them). It does not provide any protection
> > against a true man-in-the-middle attacker.
> >
> > Ciao
> > Hannes
> >
> >
> > _______________________________________________
> > OAuth mailing list
> > OAuth@ietf.org
> > https://www.ietf.org/mailman/listinfo/oauth
>
> _______________________________________________
> OAuth mailing list
> OAuth@ietf.org
> https://www.ietf.org/mailman/listinfo/oauth
>