-
-
Notifications
You must be signed in to change notification settings - Fork 31.6k
Fix RSA-OAEP encryption for empty strings #57558
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 RSA-OAEP encryption for empty strings #57558
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using the last trim()
function maynot a good idea. In my opinion, the fix should be in the internal C
level.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
Ohh.. thanks for the clarification. I have added error handling for empty strings in the C-level code. Please check this PR: #57572. |
Superseded by #57572 |
closes #57553 closes #57572 closes #57558 PR-URL: #57575 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Yagiz Nizipli <[email protected]> Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: Darshan Sen <[email protected]>
closes #57553 closes #57572 closes #57558 PR-URL: #57575 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Yagiz Nizipli <[email protected]> Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: Darshan Sen <[email protected]>
closes nodejs#57553 closes nodejs#57572 closes nodejs#57558 PR-URL: nodejs#57575 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Yagiz Nizipli <[email protected]> Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: Darshan Sen <[email protected]>
closes #57553 closes #57572 closes #57558 PR-URL: #57575 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Yagiz Nizipli <[email protected]> Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: Darshan Sen <[email protected]>
closes #57553 closes #57572 closes #57558 PR-URL: #57575 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Yagiz Nizipli <[email protected]> Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: Darshan Sen <[email protected]>
No description provided.