Subject: [COSE] 🔔 WGLC of draft-ietf-cose-webauthn-algorithms

From: ivaylo petrov <[email-masked]>
Date: Tue, 17 Sep 2019 16:31:10 +0200

Dear all,

This message starts the Working Group Last Call on
the draft-ietf-cose-webauthn-algorithms [1].

The working group last call will run for **two weeks**, ending on
October 1, 2019.

Please review and send any comments or feedback to the working group. Even
if your feedback is "this is ready", please let us know.

Thank you,

- Matthew and Ivaylo
COSE Chairs

[1]: https://datatracker.ietf.org/doc/draft-ietf-cose-webauthn-algorithms/

---

From: Jim Schaad <[email-masked]>
Date: Tue, 17 Sep 2019 18:46:22 -0700

I start this review by copying forward all of my comments on draft-jones-cose-additional-algorithms-00

1.  I was surprised that there are two algorithms still in the WebAuthn document that are not included here.  Is that intentional and what is the plan forward for them? This one was addressed

2.  The title of the document is not descriptive in terms of a standalone sentence on what this document is doing.  It should be more specific on the algorithms.  The new title is fine except for the fact that WebAuthn is not expanded to anything.

3.  Abstract:  A list of the algorithms being processed in this document would be reasonable.  Based on the current text, the abstract would need to be re-written as soon as the algorithms are registered because they would then be registered and thus the specification is not necessary.  It would also be slightly odd in the event that the CTAP or WebAuthn protocols are updated to add new algorithms as they would not be in this document.  (See issue #1.)  No Change

4.  Section 1:  See abstract comment.  No change

5.  Section 2: The recommended column needs to be added to the table.  No change

6.  Section 2:  The discussion on what is and is not recommended and why belongs in this section not in the security considerations.  No change

7.  Section 2: You are missing some checks that should be done on signing and verification.  Look at the standard text at the end of sections in RFC 8152 for a pattern.  You might also want to add a check on lengths of keys both for a maximum and a minimum length.  No change

8.  Section 3:  This should not be the first use of JOSE and COSE and therefore the expansions here make no sense.  That should be in the introduction.  No change

9. Section 3.1:  I have only rarely seen this curve as P-256K, it is almost always referred to as secp256k1.  I would ask that this be changed in the COSE representation.  I am agnostic about what should be in the JOSE representation.  Fixed

10. Section 3.1:  I don't understand the reason for the last paragraph in the section.  It seems to me that this should just refer to all of the items defined for EC2 in COSE.  No Change

11. Section 3.1:  Is there a recommendation on using compressed vs non-compressed points?  No change

12.  Section 3.1:  You need to talk about if this is going to be IETF recommended or not.   (And why)  No change

13.  Section 3.2:  I don't understand what this section is doing.  If you are really defining a new signature algorithm, then that should be noted as part of the requirements in section 3.1 on the key.  If you are not defining a new signature algorithm then this section makes zero sense.  (You are not saying what the hash algorithm is.)  Both options are reasonable.  This is partly dealt with:

A.	Step 1 is incorrect in terms of COSE, it is not the payload that is signed.
B.	The new signature algorithm is being defined without motivation.  There should be text describing why this is ES256K and not ES256 (ECDSA with SHA-256).  I do note that there may be different text being described here for JOSE than for COSE.
C.	Please include text related to deterministic ECDSA in this text.  
D.	Text similar to the end of section 2.1 in draft-ietf-cose-rfc8152bis-algs should be included to nail things down tighter

14. Section 3.2:  If this is a new signature algorithm then it should say what curves it operates with.  Else there should be an addition of the algorithms that are legal in section 3.1 Done, but see comment 13

15.  Section 4.1 - The correct term is 'provisional' not 'temporary'. Not of sufficient importance to worry about.  However you can just use the provisional numbers without any comment or TBD given they are assigned.

16. Section 5.4 - So if somebody changes the crv value, is there any way to tell the difference?  If so then that should be described here.  No change

17.  Section 5.3 - This text seems to be self-contradictory.  If you MUST NOT use it, then how can you then use it?  How does an implementation know when it is or is not acceptable practice to use this?  No change

New Items:

18.  FIDO2 not expanded on first use in abstract and introduction.   Ditto for WebAuthn, COSE,

19.  Abstract does not refer to JSON – should it?

20.  Should be pointing to the current drafts and not to RFC 8152 in this document.

21.  Given that the algorithms in section 2 are already defined in JOSE, there should be text that this section only applies to COSE so there is no confusion.

Jim

From: COSE <[email-masked]> On Behalf Of ivaylo petrov
Sent: Tuesday, September 17, 2019 7:31 AM
To: cose <[email-masked]>
Subject: [COSE] 🔔 WGLC of draft-ietf-cose-webauthn-algorithms

Dear all,

This message starts the Working Group Last Call on the draft-ietf-cose-webauthn-algorithms [1].

Please review and send any comments or feedback to the working group. Even if your feedback is "this is ready", please let us know.

Thank you,

- Matthew and Ivaylo

COSE Chairs

---

From: Mike Jones <[email-masked]>
Date: Wed, 18 Sep 2019 02:09:38 +0000

I believe that this specification is ready for publication.

                                                       -- Mike

Dear all,

Thank you,

- Matthew and Ivaylo
COSE Chairs

[1]: https://datatracker.ietf.org/doc/draft-ietf-cose-webauthn-algorithms/<https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdatatracker.ietf.org%2Fdoc%2Fdraft-ietf-cose-webauthn-algorithms%2F&data=02%7C01%7CMichael.Jones%40microsoft.com%7C8e5b4456281d4ae5431808d73b7bc738%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C1%7C637043275117292372&sdata=UE8Pk9ZkKj36%2FKhFkrIRiUTuF3yAgJ1%2FbdbCcrHDF9I%3D&reserved=0>

---

From: Neil Madden <[email-masked]>
Date: Fri, 20 Sep 2019 10:35:29 +0100

Thanks, I wasn't aware of this draft. It looks ok, just a few comments from me:

secp256k1 is mentioned in the context of signatures and the new ES256K JWS algorithm, but when it is registered in the JOSE Elliptic Curve registry it will also be usable for ECDH-ES encryption. The current draft mentions JOSE but only links to RFC 7515 (JWS). Is the intention that the curve be only used for signatures, or is it also intended for encryption?

I'm glad RS1 is not being registered for JOSE, although I'm still a bit surprised that it is being registered (even as deprecated) for a standard as new as COSE. I can't find any justification in the linked WebAuthn or CTAP specs for why this algorithm needs to exist at all. Section 5.3 says that it needs to be registered because some WebAuthn TPM attestations use it, but the very same section says that the algorithm MUST NOT be used by COSE implementations (is a WebAuthn implementation not a COSE implementation?). If the normative language in the spec is obeyed then the algorithm will never be used and so the registered identifier isn't needed.

-- Neil

> On 19 Sep 2019, at 16:40, ivaylo petrov <[email-masked]> wrote:
> 
> Dear JOSE WG,
> 
> As was suggested (thank you Jim), I am forwarding you this message about the COSE WGLC on draft-ietf-cose-webauthn-algorithms [1] as it has actions on "JSON Web Signature and Encryption Algorithms" and "JSON Web Key Elliptic Curve" registries.
> 
> The working group last call will end on October 1, 2019.
> 
> Please review and send any comments or feedback to the COSE working group. Even if your feedback is "this is ready", please let us know.
> 
> Thank you,
> 
> - Matthew and Ivaylo
> COSE Chairs
> 
> [1]: https://datatracker.ietf.org/doc/draft-ietf-cose-webauthn-algorithms/ <https://datatracker.ietf.org/doc/draft-ietf-cose-webauthn-algorithms/>
> 
> 
> On Tue, Sep 17, 2019 at 4:31 PM ivaylo petrov <[email-masked] <mailto:[email-masked]>> wrote:
> Dear all,
> 
> [1]: https://datatracker.ietf.org/doc/draft-ietf-cose-webauthn-algorithms/ <https://datatracker.ietf.org/doc/draft-ietf-cose-webauthn-algorithms/>
> _______________________________________________
> jose mailing list
> [email-masked]
> https://www.ietf.org/mailman/listinfo/jose

---

From: Jim Schaad <[email-masked]>
Date: Fri, 20 Sep 2019 07:31:39 -0700

From: jose <[email-masked]> On Behalf Of Neil Madden
Sent: Friday, September 20, 2019 2:35 AM
To: ivaylo petrov <[email-masked]>
Cc: [email-masked]; [email-masked]
Subject: Re: [jose] 🔔 WGLC of draft-ietf-cose-webauthn-algorithms

[JLS] That is an interesting question.  Right now I would say that it is only for signatures, but it could be expanded to key agreement quite easily.  Is there any need for it or are you just speculating?  The big use I know of is bit coin which is only signatures and WebAuthn which is only signatures.

[JLS] For better or for worse, RS1 is already registered for JOSE, so that is the reason it is not registered here.  

-- Neil

On 19 Sep 2019, at 16:40, ivaylo petrov <[email-masked] <mailto:[email-masked]> > wrote:

Dear JOSE WG,

Thank you,

- Matthew and Ivaylo

COSE Chairs

 

On Tue, Sep 17, 2019 at 4:31 PM ivaylo petrov <[email-masked] <mailto:[email-masked]> > wrote:

Dear all,

Thank you,

- Matthew and Ivaylo

COSE Chairs

_______________________________________________
jose mailing list
[email-masked] <mailto:[email-masked]> 
https://www.ietf.org/mailman/listinfo/jose

---

From: Neil Madden <[email-masked]>
Date: Fri, 20 Sep 2019 16:08:41 +0100

Thanks for the reply, comments in-line marked with [NEM]:

> On 20 Sep 2019, at 15:31, Jim Schaad <[email-masked]> wrote:
> 
>  
>  
> From: jose <[email-masked] <mailto:[email-masked]>> On Behalf Of Neil Madden
> To: ivaylo petrov <[email-masked] <mailto:[email-masked]>>
> Cc: [email-masked] <mailto:[email-masked]>; [email-masked] <mailto:[email-masked]>

[NEM] As soon as it is registered as a JOSE elliptic curve it can be used for ECDH-ES, so the draft should make a statement one way or another as to whether this is intended rather than standardizing that usage by side-effect IMO.

> [JLS] For better or for worse, RS1 is already registered for JOSE, so that is the reason it is not registered here.  

Ouch, I hadn't seen this. The WebCrypto group really did a number on the registry. Thankfully most of them (including RS1) are only registered for JWK usage and marked as Prohibited. (What does it even mean for things like "A128CBC" to be registered as a JWK "alg" value?)

My main point still stands that section 5.3 of the draft is self-contradictory as it says that the reason for registry is because some TPMs are using the algorithm but then also says that those implementations MUST NOT use the algorithm, negating the reason for registering it in the first place.

-- Neil

---

From: Jim Schaad <[email-masked]>
Date: Fri, 20 Sep 2019 08:30:28 -0700

See inline

From: Neil Madden <[email-masked]> 
Sent: Friday, September 20, 2019 8:09 AM
To: Jim Schaad <[email-masked]>
Cc: ivaylo petrov <[email-masked]>; [email-masked]; [email-masked]
Subject: Re: [jose] 🔔 WGLC of draft-ietf-cose-webauthn-algorithms

On 20 Sep 2019, at 15:31, Jim Schaad <[email-masked] <mailto:[email-masked]> > wrote:

From: jose < <mailto:[email-masked]> [email-masked]> On Behalf Of Neil Madden
Sent: Friday, September 20, 2019 2:35 AM
To: ivaylo petrov < <mailto:[email-masked]> [email-masked]>
Cc:  <mailto:[email-masked]> [email-masked];  <mailto:[email-masked]> [email-masked]
Subject: Re: [jose] 🔔 WGLC of draft-ietf-cose-webauthn-algorithms

 

[JLS] One can have a JWK which contains a symmetric key so in that case an “alg” value of “A128CBC” makes sense.  Only use this key with this algorithm.  

[JLS] I agree and I have also pointed this out in a couple of reviews.

-- Neil

---

From: Neil Madden <[email-masked]>
Date: Fri, 20 Sep 2019 16:51:49 +0100

> [JLS] One can have a JWK which contains a symmetric key so in that case an “alg” value of “A128CBC” makes sense.  Only use this key with this algorithm.  

OK, off-topic but this reveals an ambiguity in the JWK spec. Section 4.4 of RFC 7517 describing the JWK "alg" parameter just says that the values should be registered in the "JSON Web Signature and Encryption Algorithms" registry, but as this registry contains both JWE Algorithms ("alg" in JWE) and Content Encryption Methods ("enc"), it is ambiguous which is allowed. I have always assumed that only JWE/JWS "alg" values where allowed in a JWK "alg" claim, but I guess the wording would also allow you to put an "enc" value in there. I presume that's what the WebCrypto spec is intending with these registrations, rather than registering "A128CBC" etc as key-wrapping algorithms?

-- Neil

---

From: Mike Jones <[email-masked]>
Date: Sat, 21 Sep 2019 00:44:45 +0000

RSA SHA-1 is used by TPMs, which produce attestations used by W3C WebCrypto.  That can’t be changed.  That’s why an algorithm identifier is needed for it.  It’s use is prohibited for new applications but TPMs are an existing application.  I can work to make this clearer when resolving the WGLC comments.

As for secp256k1, the “ES256K” algorithm is registered, whose definition is “ECDSA using secp256k1 curve and SHA-256”.  That’s only for signing.  The draft is currently silent on whether the registered curve can also be used for other things.  I think that’s how it should be, unless there are security reasons to the contrary.

                                                       -- Mike

From: jose <[email-masked]> On Behalf Of Jim Schaad
Sent: Friday, September 20, 2019 8:30 AM
To: 'Neil Madden' <[email-masked]>
Cc: [email-masked]; [email-masked]; 'ivaylo petrov' <[email-masked]>
Subject: Re: [jose] 🔔 WGLC of draft-ietf-cose-webauthn-algorithms

See inline

From: Neil Madden <[email-masked]<mailto:[email-masked]>>
Sent: Friday, September 20, 2019 8:09 AM
To: Jim Schaad <[email-masked]<mailto:[email-masked]>>
Cc: ivaylo petrov <[email-masked]<mailto:[email-masked]>>; [email-masked]<mailto:[email-masked]>; [email-masked]<mailto:[email-masked]>
Subject: Re: [jose] 🔔 WGLC of draft-ietf-cose-webauthn-algorithms

On 20 Sep 2019, at 15:31, Jim Schaad <[email-masked]<mailto:[email-masked]>> wrote:

From: jose <[email-masked]<mailto:[email-masked]>> On Behalf Of Neil Madden
Sent: Friday, September 20, 2019 2:35 AM
To: ivaylo petrov <[email-masked]<mailto:[email-masked]>>
Cc: [email-masked]<mailto:[email-masked]>; [email-masked]<mailto:[email-masked]>
Subject: Re: [jose] 🔔 WGLC of draft-ietf-cose-webauthn-algorithms

-- Neil

---

From: Neil Madden <[email-masked]>
Date: Sat, 21 Sep 2019 11:47:53 +0100

> RSA SHA-1 is used by TPMs, which produce attestations used by W3C WebCrypto.  That can’t be changed.  That’s why an algorithm identifier is needed for it.  It’s use is prohibited for new applicatio…

I think clarifying the text along those lines would help a lot. It is worrying that these TPMs have to continue to use a known weak signature method and they apparently cannot be changed, but at least with the MUST NOT you give people a clue that this is something they want to run away from pretty quickly.

> As for secp256k1, the “ES256K” algorithm is registered, whose definition is “ECDSA using secp256k1 curve and SHA-256”.  That’s only for signing.  The draft is currently silent on whether the regist…

Well section 4.4 registers secp256k1 as a JWK Elliptic Curve so it will be usable with the existing ECDH-ES family of algorithms without any additional registrations. There *are* some security concerns about using secp256k1 outside of signatures - see e.g. [1] which lists the theoretical problems with the curve. In particular, fast implementations of scalar multiplication (used in ECDH) for secp256k1 are not constant time making it a riskier choice for ECDH than for ECDSA. As far as I'm aware though, that just puts it in the same category as the other NIST/SECG standard curves that are already registered for JOSE. So I'm not against it being available for both JWS and JWE usage, I'd just like that to be an explicit documented decision rather than an accident.

[1]: https://crypto.stackexchange.com/a/68286/26028 <https://crypto.stackexchange.com/a/68286/26028> 

-- Neil

---

From: Benjamin Kaduk <[email-masked]>
Date: Mon, 23 Sep 2019 10:37:07 -0700

> Well section 4.4 registers secp256k1 as a JWK Elliptic Curve so it will be usable with the existing ECDH-ES family of algorithms without any additional registrations. There *are* some security conc…

I'm also inclined to agree that making an explicit statement is preferred;
I have less-strong feelings about whether that statement is to allow or
disallow the usage.

-Ben