Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # 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

@kt3k kt3k requested a review from littledivy September 11, 2024 03:00
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
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants