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

CryptoOutputStream outputs invalid message when used to encrypt empty plaintext #218

Open
lavaleri opened this issue Sep 23, 2020 · 0 comments
Labels

Comments

@lavaleri
Copy link
Contributor

In order to perform the "encrypt a zero length plaintext" using a CryptoOutputStream, the correct setup would be to create the CryptoOutputStream, don't write any bytes to it, then immediately call close().

This results in the CryptoOutputStream only writing bytes for an empty final frame (and possibly a footer). It does not write any header bytes, resulting in an invalid message that cannot be parsed by any AWS Encryption SDK implementation.

This should be fixed such that this use case will correctly write header bytes before the message body and footer, resulting in a message that can be successfully decrypted into the plaintext "".

@lavaleri lavaleri added the bug label Sep 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant