GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||
GeezerVison is showing github.com — crypto: validate inputEncoding in Cipher/Decipher update by maruthang · Pull Request #62954 · nodejs/node Conversation
Contributor
Cipher.update(string, badEncoding, ...) and Decipher.update with Sub-cases 1 and 2 from issue #45189 (bad output encoding to Note: I was unable to run the test suite locally (no built
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactionsCipher.update(string, badEncoding, ...) and Decipher.update with the same shape silently produced incorrect output: the binding skipped the unrecognized encoding and fell back to a default, giving the user wrong ciphertext or plaintext with no signal. Sub-cases 1 and 2 from issue nodejs#45189 (bad output encoding to update/final) were addressed in PR nodejs#45990. This commit completes the fix for sub-case 3 (bad input encoding) per panva's comment deferring it to a follow-up PR for CITGM testing. When `data` is a string and `inputEncoding` is non-null but does not normalize to a known encoding, throw ERR_UNKNOWN_ENCODING. Buffer / TypedArray / DataView data paths are unaffected (the binding ignores `inputEncoding` for non-string data anyway). Fixes: nodejs#45189 Refs: nodejs#45990 Signed-off-by: Maruthan G <[email protected]>
Collaborator
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
|
There was an error while loading. Please reload this page.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@ ## main #62954 +/- ## ========================================== + Coverage 89.66% 92.37% +2.71% ========================================== Files 706 808 +102 Lines 219391 296760 +77369 Branches 42068 78561 +36493 ========================================== + Hits 196712 274128 +77416 + Misses 14578 13106 -1472 - Partials 8101 9526 +1425
🚀 New features to boost your workflow:
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
This pull request has been marked as stale due to 90 days of inactivity. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
This pull request has been automatically closed after 30 days of inactivity following its stale status (no activity for a total of 120 days). |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Superseded by #66247 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
crypto Cipher/Decipher validation issues
There was an error while loading. Please reload this page.