crypto: fix getDecoder() encoding check · nodejs/node@a6f7b13 · GitHub
Skip to content

Commit a6f7b13

Browse files
atstoyanovaddaleax
authored andcommitted
crypto: fix getDecoder() encoding check
Normalize the encoding in getDecoder() before using it. Fixes an AssertionError: "Cannot change encoding" when encoding is "ucs2", "ucs-2" or "utf-16le" Fixes: #8236 PR-URL: #8301 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent 983775d commit a6f7b13

2 files changed

Lines changed: 27 additions & 1 deletion

File tree

lib/crypto.js

Lines changed: 1 addition & 1 deletion

test/parallel/test-crypto-cipher-decipher.js

Lines changed: 26 additions & 0 deletions

0 commit comments

Comments
 (0)