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

Make AES GCM more consistent cross platform #189

Merged
merged 84 commits into from
Jun 21, 2024
Merged

Conversation

DmitriyMusatkin
Copy link
Contributor

Issue #, if available:

Description of changes:
Warning Backwards Incompatible change: moved gcm tag out of the constructor into a separate setter, since it was leading to a whole bunch of annoying corner cases, that was not handled consistently cross platform. And arguably having tag as a separate setter is a bit cleaner design, since we already complicate logic, by abstracting away encryptor vs decryptor

Outside of that, changes are mostly extra tests and corresponding changes to make everything consistent cross platform

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

include/aws/cal/symmetric_cipher.h Outdated Show resolved Hide resolved
source/darwin/commoncrypto_aes.c Show resolved Hide resolved
source/darwin/commoncrypto_aes.c Outdated Show resolved Hide resolved
source/unix/openssl_aes.c Outdated Show resolved Hide resolved
source/windows/bcrypt_aes.c Outdated Show resolved Hide resolved
source/windows/bcrypt_aes.c Outdated Show resolved Hide resolved
source/windows/bcrypt_aes.c Outdated Show resolved Hide resolved
source/windows/bcrypt_aes.c Outdated Show resolved Hide resolved
source/windows/bcrypt_aes.c Outdated Show resolved Hide resolved
source/windows/bcrypt_aes.c Show resolved Hide resolved
Copy link
Contributor

@graebm graebm left a comment

Choose a reason for hiding this comment

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

fix & ship

int ret_val = s_aes_default_encrypt(cipher, &final_cur, out);
int ret_val = AWS_OP_SUCCESS;
if (final_cur.len > 0) {
s_aes_default_encrypt(cipher, &final_cur, out);
Copy link
Contributor

Choose a reason for hiding this comment

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

still not checking result here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ugh, im dumb. stashed the fix to merge in auto merges and never poped it

@DmitriyMusatkin DmitriyMusatkin merged commit 11fc684 into main Jun 21, 2024
39 checks passed
@DmitriyMusatkin DmitriyMusatkin deleted the tag-windows-test branch June 21, 2024 15:52
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