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

jwe: fix the case when we have "zip" in the protected header #161

Merged
merged 1 commit into from
May 22, 2024

Conversation

sergio-correia
Copy link
Collaborator

When we have "zip" in the protected header, e.g.: "zip": "DEF", we should compress the payload before the encryption.

However, as it stands, we are doing the compression after the encryption, which results in the jose_jwe_enc* functions producing JWEs that we are unable to decrypt afterwards.

For the "zip" case, we do the compression now before the encryption, to fix this behavior.

Also add some tests to exercise these scenarios, both using the jose_jwe_enc*/jose_jwe_dec* functions, as well as the command line utilities jose jwe enc / jose jwe dec.

Copy link
Collaborator

@sarroutbi sarroutbi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added minor stuff. Rest of changes LGTM. Great job, @sergio-correia

When we have "zip" in the protected header, e.g.: "zip": "DEF",
we should compress the payload before the encryption.

However, as it stands, we are doing the compression after the
encryption, which results in the jose_jwe_enc* functions
producing JWEs that we are unable to decrypt afterwards.

For the "zip" case, we do the compression now before the
encryption, to fix this behavior.

Also add some tests to exercise these scenarios, both using
the jose_jwe_enc*/jose_jwe_dec* functions, as well as the
command line utilities jose jwe enc / jose jwe dec.

Signed-off-by: Sergio Correia <scorreia@redhat.com>
@sergio-correia
Copy link
Collaborator Author

I added minor stuff. Rest of changes LGTM. Great job, @sergio-correia

Thanks for the review. I squashed your changes into the commit.

@sarroutbi sarroutbi merged commit be761d2 into latchset:master May 22, 2024
22 checks passed
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