Fix RSA-OAEP encryption for empty strings#57558
Closed
AmitPrajapati-1 wants to merge 4 commits intonodejs:mainfrom
Closed
Fix RSA-OAEP encryption for empty strings#57558AmitPrajapati-1 wants to merge 4 commits intonodejs:mainfrom
AmitPrajapati-1 wants to merge 4 commits intonodejs:mainfrom
Conversation
| oaepHash: 'sha1', | ||
| padding: crypto.constants.RSA_PKCS1_OAEP_PADDING, | ||
| key: keys.privateKey | ||
| }, Buffer.from(ciphertext, 'base64')).toString('utf8').trim(); |
There was a problem hiding this comment.
Using the last trim() function maynot a good idea. In my opinion, the fix should be in the internal C level.
Author
There was a problem hiding this comment.
Fixed encryption and decryption logic for improved accuracy and consistency.
|
Ops... The trouble looks like still there on v23.7.0/v23.8.0/v23.9.0/v23.10.0. On another way, the |
Author
|
Ohh.. thanks for the clarification. I have added error handling for empty strings in the C-level code. Please check this PR: #57572. |
Member
|
Superseded by #57572 |
panva
added a commit
to panva/node
that referenced
this pull request
Mar 21, 2025
JonasBa
pushed a commit
to JonasBa/node
that referenced
this pull request
Apr 11, 2025
closes nodejs#57553 closes nodejs#57572 closes nodejs#57558 PR-URL: nodejs#57575 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Darshan Sen <raisinten@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.