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): fix Cipheriv#update(string, undefined) #25571

Merged
merged 1 commit into from
Sep 11, 2024

Conversation

kt3k
Copy link
Member

@kt3k kt3k commented Sep 11, 2024

This PR fixes the case when the Cipheriv#update() method is called with string without inputEncoding specified.

When the input is string and inputEncoding is not specified, the given string is directly passed to op_node_cipheriv_encrypt, and the encoding result becomes a wrong value.

This PR fixes it by always converting the input string with Buffer.from when the input is string. (ref: Node.js does the same https://github.com/nodejs/node/blob/123bb4cb22e739a039392d83d512601982f40fc0/lib/internal/crypto/cipher.js#L165-L166 )

closes #25279

@kt3k kt3k merged commit aae3a6b into denoland:main Sep 11, 2024
17 checks passed
@kt3k kt3k deleted the fix-cipher-update-without-input-encoding branch September 11, 2024 10:24
# 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.

Deno crashes at createDecipheriv
3 participants