Interop / draft-ietf-jose-json-web-encryption-40#8
Open
fredrikt wants to merge 6 commits intoDemonware:masterfrom
Open
Interop / draft-ietf-jose-json-web-encryption-40#8fredrikt wants to merge 6 commits intoDemonware:masterfrom
fredrikt wants to merge 6 commits intoDemonware:masterfrom
Conversation
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...
Contributor
|
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! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.