Skip to content

Define constraints on JceMasterKey RSA wrapping algorithms #56

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

Closed
mattsb42-aws opened this issue Jul 7, 2018 · 1 comment · Fixed by #59
Closed

Define constraints on JceMasterKey RSA wrapping algorithms #56

mattsb42-aws opened this issue Jul 7, 2018 · 1 comment · Fixed by #59

Comments

@mattsb42-aws
Copy link
Member

Problem

JceMasterKey is very poorly constrained when using RSA master keys. The current implementation only verifies that the wrapping algorithm name starts with "RSA/ECB/", leaving the padding algorithm open to whatever any given JCE provider makes available.

aws/aws-encryption-sdk-python#56

Without providing some constraints around the permitted padding algorithms for RSA master keys, we cannot guarantee full compatibility between this and any other implementation.

Proposed Solution

We should constrain the allowed padding algorithms to a whitelisted set. This does hold the risk of breaking existing usage if anyone is using an unusual padding algorithm not on this list.

Allow

Consider for future

  • RSA/ECB/OAEPWithSHA-224AndMGF1Padding - Better than SHA1, but based on consultation with algorithms team we should leave it off unless we receive requests for it.

Alternate Solution

Alternately, we could simply document the above as officially supported padding algorithms and raise a warning if an unsupported padding algorithm is used. I like this less from a "keep the foot-guns locked away" perspective, but it is the safer option considering how long the existing implementation has been in the wild.

@mattsb42-aws mattsb42-aws changed the title Define constrains on JceMasterKey RSA wrapping algorithms Define constraints on JceMasterKey RSA wrapping algorithms Jul 7, 2018
@SalusaSecondus
Copy link
Contributor

I support the Alternate Solution (warning) to avoid breaking existing customers. Future format changes may further restrict the algorithm selection, but backwards compatibility is very important.

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 a pull request may close this issue.

2 participants