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

John Bradley <ve7jtb@ve7jtb.com> Wed, 03 December 2014 12:14 UTC

Return-Path: <ve7jtb@ve7jtb.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 C61981A1A82 for <oauth@ietfa.amsl.com>; Wed, 3 Dec 2014 04:14:34 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.401
X-Spam-Level:
X-Spam-Status: No, score=-1.401 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, J_CHICKENPOX_45=0.6, J_CHICKENPOX_46=0.6, RCVD_IN_DNSWL_LOW=-0.7, 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 lS42i_996LTP for <oauth@ietfa.amsl.com>; Wed, 3 Dec 2014 04:14:32 -0800 (PST)
Received: from mail-wi0-f171.google.com (mail-wi0-f171.google.com [209.85.212.171]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 664201A1A80 for <oauth@ietf.org>; Wed, 3 Dec 2014 04:14:32 -0800 (PST)
Received: by mail-wi0-f171.google.com with SMTP id bs8so31155809wib.4 for <oauth@ietf.org>; Wed, 03 Dec 2014 04:14:31 -0800 (PST)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:content-type:mime-version:subject:from :in-reply-to:date:cc:message-id:references:to; bh=IKNMKv0UWxtMaPtIIFA/PLrHVqyCTrg1/BNpunpVQK8=; b=MoyZkfJ+y8A+PXWK0lkOpofMN8LbhNmUusuCzwy9tf2TcFMhYUZWVg+jZA7II6PNgk jpbqzyGvtVPkD49qtJ/KcJ5LpZHMsch9FhSV/WAqV3b+hjWvRvL4PMWuIKhmOtmci1Hr vPO+/y4W7MPtuwFoH4tvakNC9fQDTvuoZnGTewhKYgVcRWtfysvwcSdzW+6qiXMQZXIT RqZtrK9FO8HgxTmekWtlkTwOz2seHq02MzmCf5pV/A0dlCcePAXnoH+64rXJxxmCdon1 xu1NuGNeNk5wwhbY4mmBWoTOm4ZGc/Hm7abtyUGNd9CKYa2SvnDtciYCsYwvcVnYHVEN HBYw==
X-Gm-Message-State: ALoCoQn2mR2GL+ZuMpGE6vDLKO2QEmLG16pnGhEVtOiutgimoIKL278qfIFBzEbw5Zzw03JPoZk3
X-Received: by 10.180.11.97 with SMTP id p1mr13254406wib.22.1417608871128; Wed, 03 Dec 2014 04:14:31 -0800 (PST)
Received: from [10.47.81.9] (host86-187-113-78.range86-187.btcentralplus.com. [86.187.113.78]) by mx.google.com with ESMTPSA id gy8sm12038214wib.23.2014.12.03.04.14.29 for <multiple recipients> (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 03 Dec 2014 04:14:30 -0800 (PST)
Content-Type: multipart/signed; boundary="Apple-Mail=_93F15B81-3682-4C30-9DEF-F8383B368C42"; protocol="application/pkcs7-signature"; micalg="sha1"
Mime-Version: 1.0 (Mac OS X Mail 8.1 \(1993\))
From: John Bradley <ve7jtb@ve7jtb.com>
In-Reply-To: <547EFD97.2040708@gmx.net>
Date: Wed, 03 Dec 2014 09:14:28 -0300
Message-Id: <5E44E18E-8BE2-4CE3-AD07-543D9A7619DE@ve7jtb.com>
References: <547EF145.5030501@gmx.net> <B0DA0AD6-DE2C-4ECB-B2E2-04F369AAD610@ve7jtb.com> <547EF82A.1050505@gmx.net> <BA1B0D79-E77B-4A46-8147-9FCBEBCFA8A4@ve7jtb.com> <547EFD97.2040708@gmx.net>
To: Hannes Tschofenig <hannes.tschofenig@gmx.net>
X-Mailer: Apple Mail (2.1993)
Archived-At: http://mailarchive.ietf.org/arch/msg/oauth/TpuX71iyUeiTyn87lkZVLlVwgbA
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 12:14:35 -0000

The only question is if the OAuth ext review list is the correct place for review.  

I don't have a problem with re using an existing review process for a new registry, if that works for people.

John B.

> On Dec 3, 2014, at 9:09 AM, Hannes Tschofenig <hannes.tschofenig@gmx.net> wrote:
> 
> I just looked at the IANA consideration section and I noticed that there
> is no policy defined for adding, or deprecating values from various
> registries, such as the code_challenge_method.
> 
> So, you can essentially decide about how easy or difficult you can make
> it for yourself.
> 
> I would think that 'Specification Required' would be appropriate.
> You can copy the relevant text from
> https://tools.ietf.org/html/rfc6749#section-11 and adjust it accordingly.
> 
> Ciao
> Hannes
> 
> On 12/03/2014 01:01 PM, John Bradley wrote:
>> We have been thinking that new hash functions and new mechanisms (eg ECDH-ES) would be treated the same and require a spec and review. 
>> 
>> (At some point I will do a asymmetric extension so that the key can also be used to encrypt POP keys back to the client,  but I don't want to make this spec look to complicated)
>> 
>> Any mechanism using a challenge & verifier approach could fit in to the defined parameters,  a different hash like SHA3 is simple in that it just be a replacement of the hash function.
>> 
>> I think guidance id fine as long as it doesn't limit future options.
>> 
>> John B.
>> 
>> 
>>> On Dec 3, 2014, at 8:46 AM, Hannes Tschofenig <hannes.tschofenig@gmx.net> wrote:
>>> 
>>> Hi John,
>>> 
>>> I believe it makes sense to give recommendations for extensions (if you
>>> envision them). Of course, I hope that we do not see a flood of
>>> extensions that all use different hash functions.
>>> 
>>> Changing the mechanism to something that provides even stronger security
>>> properties would definitely require a new specification and review.
>>> 
>>> Ciao
>>> Hannes
>>> 
>>> 
>>> On 12/03/2014 12:37 PM, John Bradley 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
>>>> 
>>> 
>> 
>