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

fix(ext/node): validate input lengths in Cipheriv and Decipheriv #25570

Merged
merged 2 commits into from
Sep 11, 2024

Conversation

kt3k
Copy link
Member

@kt3k kt3k commented Sep 11, 2024

This PR adds the validation of key and init vector lengths for createDecipheriv and createCipheriv with 'aes-256-cbc' algorithm.

Currently we don't check the lengths of the inputs and that causes panics at key.into() or iv.into() calls here (that causes #25279). This PR adds the check of these lengths and throws appropriate errors similar to what Node.js throws.

addresses the first part of #25279

Copy link
Member

@littledivy littledivy left a comment

Choose a reason for hiding this comment

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

LGTM

@kt3k kt3k merged commit ef2d98f into denoland:main Sep 11, 2024
17 checks passed
@kt3k kt3k deleted the fix-cipher-aes-256-cbc branch September 11, 2024 04:27
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.

2 participants