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

AES-GCM integration with webcrypto brakes when optional param not sent #33

Closed
antonioconselheiro opened this issue Apr 28, 2024 · 0 comments

Comments

@antonioconselheiro
Copy link
Contributor

antonioconselheiro commented Apr 28, 2024

When a cipher is generated with AES-GCM using integration with webcrypto, the third parameter of the gcm function, ADD, is optional, however undefined is not accepted by the webcrypto API and error is launched. It didn't happen in nodejs, only in a browser environment.

See the reproduction of the bug:
webcrypto-aes-gcm-bug

My user agent:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36

But you can reproduce by yourself in the following repository:
https://antonioconselheiro.github.io/noble-cipher-bug-in-webcrypto-aes-gcm-integration/

I've opened a PR with the fix:
#34

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

2 participants