summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAnna Henningsen <anna@addaleax.net>2019-10-01 13:59:25 +0200
committerRich Trott <rtrott@gmail.com>2019-10-03 13:54:36 -0700
commit389969ea9247a7bb12d5e595879a7f0f05357dc5 (patch)
treedc3499231f8072aa289c6af3d34e5cc6f6593164 /test
parent500720f5781b96147422614b82c1f85e22d6a6e8 (diff)
downloadandroid-node-v8-389969ea9247a7bb12d5e595879a7f0f05357dc5.tar.gz
android-node-v8-389969ea9247a7bb12d5e595879a7f0f05357dc5.tar.bz2
android-node-v8-389969ea9247a7bb12d5e595879a7f0f05357dc5.zip
crypto: remove arbitrary UTF16 restriction
Since 71f633a32f1f5617, this is no longer necessary. Refs: https://github.com/nodejs/node/pull/22622 Fixes: https://github.com/nodejs/node/issues/29793 PR-URL: https://github.com/nodejs/node/pull/29795 Reviewed-By: Michaƫl Zasso <targos@protonmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: David Carlier <devnexen@gmail.com>
Diffstat (limited to 'test')
-rw-r--r--test/parallel/test-crypto-hash.js10
-rw-r--r--test/parallel/test-crypto-hmac.js9
2 files changed, 6 insertions, 13 deletions
diff --git a/test/parallel/test-crypto-hash.js b/test/parallel/test-crypto-hash.js
index 4d3214adb2..7f752f898a 100644
--- a/test/parallel/test-crypto-hash.js
+++ b/test/parallel/test-crypto-hash.js
@@ -161,13 +161,9 @@ common.expectsError(
type: Error
});
-common.expectsError(
- () => crypto.createHash('sha256').digest('ucs2'),
- {
- code: 'ERR_CRYPTO_HASH_DIGEST_NO_UTF16',
- type: Error
- }
-);
+assert.strictEqual(
+ crypto.createHash('sha256').update('test').digest('ucs2'),
+ crypto.createHash('sha256').update('test').digest().toString('ucs2'));
common.expectsError(
() => crypto.createHash(),
diff --git a/test/parallel/test-crypto-hmac.js b/test/parallel/test-crypto-hmac.js
index 21ff3b0b04..2601994ab1 100644
--- a/test/parallel/test-crypto-hmac.js
+++ b/test/parallel/test-crypto-hmac.js
@@ -408,12 +408,9 @@ const rfc2202_sha1 = [
for (const { key, data, hmac } of rfc2202_sha1)
testHmac('sha1', key, data, hmac);
-common.expectsError(
- () => crypto.createHmac('sha256', 'w00t').digest('ucs2'),
- {
- code: 'ERR_CRYPTO_HASH_DIGEST_NO_UTF16',
- type: Error
- });
+assert.strictEqual(
+ crypto.createHmac('sha256', 'w00t').digest('ucs2'),
+ crypto.createHmac('sha256', 'w00t').digest().toString('ucs2'));
// Check initialized -> uninitialized state transition after calling digest().
{