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

Use oaepHash to support additional padding options. #198

Closed
seebees opened this issue Aug 27, 2019 · 1 comment
Closed

Use oaepHash to support additional padding options. #198

seebees opened this issue Aug 27, 2019 · 1 comment

Comments

@seebees
Copy link
Contributor

seebees commented Aug 27, 2019

Node.js v12.9 now supports oaepHash

https://nodejs.org/api/crypto.html#crypto_crypto_publicencrypt_key_buffer

@seebees
Copy link
Contributor Author

seebees commented Aug 27, 2019

Also: nodejs/node#28335

richardTowers added a commit to richardTowers/aws-encryption-sdk-javascript that referenced this issue Jan 15, 2020
This is particularly useful because CloudFront's Field Level Encryption
uses RSA_OAEP_SHA256_MGF1, which this library doesn't support yet.

Support for oaepHash was added in node 12.9 (nodejs/node#28335), so this
won't work for older node versions. It's still a backwards compatible
change because by default `oaepHash` will be undefined, as before.

I've updated the tests to cover use of the new parameter, but they're
not very strict because they both encrypt and decrypt using the same
parameter.

This means if node silently ignores the oaepHash parameter (as it will
in versions < 12.9) the tests will still pass, which isn't great.

On the other hand, I think this project may still be being tested on an
older version of node, so perhaps the fact the tests won't break is an
unexpected blessing.

I've also tested this manually against AWS CloudFront's Field Level
Encryption and it seems to work.

Resolves aws#198
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

No branches or pull requests

1 participant