Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug 27814 - Section A.2 - the usage mapping of "enc" is incorrect #77

Closed
mwatson2 opened this issue May 24, 2016 · 8 comments
Closed

Bug 27814 - Section A.2 - the usage mapping of "enc" is incorrect #77

mwatson2 opened this issue May 24, 2016 · 8 comments
Assignees

Comments

@mwatson2
Copy link
Collaborator

Bug 27814:

The text of A.2 says that
enc maps to ["encrypt", "decrypt", "wrapKey", "unwrapKey"]

however my reading of section 4.2 of the JWK specification (http://tools.ietf.org/html/draft-ietf-jose-json-web-key-39#section-4.2) as well as the example in Appendix A.2 say that for keys of type "EC" the value of enc is correct. This means that the mapping should be

enc maps to ["encrypt", "decrypt", "wrapKey", "unwrapKey", "deriveBits", "deriveKey"]

This also changes the algorithm for importing of ECDH keys when using a jwk format. (No changes are needed for Diffie-Hellman because it does not support a jwk format.)

@mwatson2
Copy link
Collaborator Author

I'm not sure there was a conclusion to the very long discussion on the original bug back in January 2015.

Given that JOSE uses the use value enc for keys to be used for key agreement, I would suggest that we change ECDH JWK key import to accept this use value, instead of throwing an error if use is present.

@mwatson2
Copy link
Collaborator Author

I'm also not sure A.2 is useful. Perhaps we should remove it ?

@jimsch
Copy link
Collaborator

jimsch commented May 26, 2016

I do not believe there was any final decision to do something from the last discussion.

I would tend to agree that removing A.2 is not a harmful operation.

I am in favor of any thing that makes the usage of JWK structures here better match that of the IETF specification.

@mwatson2
Copy link
Collaborator Author

mwatson2 commented Jun 8, 2016

In the absence of further input, I will implement this by removing section A.2 and allowing the presence of the use field with value enc for ECDH JWK import.

@jimsch
Copy link
Collaborator

jimsch commented Jun 8, 2016

sounds good to me.

@hhalpin
Copy link

hhalpin commented Jun 20, 2016

LGTM.

mwatson2 added a commit to mwatson2/webcrypto that referenced this issue Jul 11, 2016
@mwatson2
Copy link
Collaborator Author

PR #114

@ericroman920
Copy link

PR #114 looks good to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants