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

Add support for Hmac org keys #435

Merged
merged 3 commits into from
Dec 15, 2023
Merged

Add support for Hmac org keys #435

merged 3 commits into from
Dec 15, 2023

Conversation

Hinton
Copy link
Member

@Hinton Hinton commented Dec 15, 2023

Type of change

- [x] Bug fix
- [ ] New feature development
- [ ] Tech debt (refactoring, code cleanup, dependency upgrades, etc)
- [ ] Build/deploy pipeline (DevOps)
- [ ] Other

Objective

Organization keys can be generated using Rsa2048_OaepSha1_HmacSha256_B64 which previously wasn't supported. This PR adds support for decrypting org keys in that format, and changes the part of asymetric hmac to also contain a mac.

Before you submit

  • Please add unit tests where it makes sense to do so (encouraged but not required)

@Hinton Hinton requested a review from dani-garcia December 15, 2023 07:38
@Hinton Hinton marked this pull request as ready for review December 15, 2023 08:33
@@ -170,6 +172,29 @@ impl EncString {
s.map(|s| s.parse()).transpose()
}

/// TODO: Convert this to a trait method
Copy link
Member Author

Choose a reason for hiding this comment

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

We probably want to rework all this logic and ensure we differentiate asymmetric and symmetric enc strings. And expand our key locator, decryption pattern to handle assymetric keys.

Copy link
Member

@dani-garcia dani-garcia left a comment

Choose a reason for hiding this comment

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

LGTM, we're not checking the HMAC of the deprecated types but maybe that's not a big deal

@Hinton
Copy link
Member Author

Hinton commented Dec 15, 2023

@dani-garcia I'm replicating the behavior of the js clients which also doesn't.

@Hinton Hinton merged commit e6d0759 into main Dec 15, 2023
40 checks passed
@Hinton Hinton deleted the ps/org_keys_hmac branch December 15, 2023 10:11
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