Skip to content

Add explicit alg: param to JWE encryption#7178

Merged
zachmargolis merged 1 commit intomainfrom
margolis-explicit-alg
Oct 19, 2022
Merged

Add explicit alg: param to JWE encryption#7178
zachmargolis merged 1 commit intomainfrom
margolis-explicit-alg

Conversation

@zachmargolis
Copy link
Contributor

🎫 Ticket

N/A

🛠 Summary of changes

Why: This was implicitly the default already, and making it explicit helps clarify that this is asymmetric encryption (because the enc: is symmetric)

**Why**: This was implicitly the default already, and making
it explicit helps clarify that this is asymmetric encryption
(because the enc: is symmetric)

[skip changelog]
@zachmargolis zachmargolis requested review from a team, jmhooper and mitchellhenke October 19, 2022 21:37
Comment on lines +35 to +38
header_str, *_rest = JWE::Serialization::Compact.decode(jwe)
headers = JSON.parse(header_str)

expect(headers['alg']).to eq('RSA-OAEP')
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this test would have passed before the PR, I'm just adding it as a regression catch now

@zachmargolis zachmargolis merged commit 8f17c9d into main Oct 19, 2022
@zachmargolis zachmargolis deleted the margolis-explicit-alg branch October 19, 2022 21:57
Copy link
Contributor

@n1zyy n1zyy left a comment

Choose a reason for hiding this comment

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

As someone who was wrong on a client call today, confusing AES with RSA, strong ➕ to making this explicit here. 😄

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.

3 participants