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

Interop / draft-ietf-jose-json-web-encryption-40 #8

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

fredrikt
Copy link

I found some bugs preventing interop with a dot-NET client (https://github.com/dvsekhvalnov/jose-jwt).

For the relevant parts, I updated the Python implementation to what I read in draft -40, and that did the trick as far as interop with that particular other implementation required at least.

Neither draft-ietf-jose-json-web-algorithms-24 (old reference) nor
the current draft-ietf-jose-json-web-algorithms-40 says to concatenate
these string with dots, they say:

    M = MAC(MAC_KEY, A || IV || E || AL),

and

    The concatenation of two values A and B is denoted as A || B.

However, since backwards compatibility with old tokens seem to be a
concern here, I'm not making the same bugfix to the 'legacy' code
branch.
To interoperate with other implementations that won't put the '__v'
magic key in the headers, it is necessary to enter the non-legacy
code branch using some other mechanism than the presence of '__v'
(which I understand to be an invention of this particular
implementation).

I won't claim to have extensive knowledge or experience with JOSE, but
this trick at least lets me interoperate with a dot-NET client.
As a matter of hygiene, one shouldn't decrypt stuff before checking
the authenticity of it.

For the legacy mode it is unavoidable though, since the MAC is computed
using the plaintext.
Good thing there were test cases covering these cases...
@nmurtagh
Copy link
Contributor

nmurtagh commented Mar 2, 2016

Hi @fredrikt. We (Demonware) are planning to make a series of updates to JOSE to bring it into line with the final RFC. Thanks very much for your work on this. I'm not sure if we'll use it but hopefully we'll get to the same place in the end!

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

Successfully merging this pull request may close these issues.

2 participants