Commit Graph

3 Commits

Author SHA1 Message Date
Darshan Sen
4411a99dcd
test: fix flaky test-webcrypto-encrypt-decrypt-aes
* Use a copy of plaintext to prevent tampering of the original
* Since subtle.decrypt returns a Promise containing an ArrayBuffer and
  ArrayBuffers cannot be modified directly, create a Buffer from it
  right away so that the modification in the next line works as intended

Fixes: https://github.com/nodejs/node/issues/35586

PR-URL: https://github.com/nodejs/node/pull/37380
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Myles Borins <myles.borins@gmail.com>
2021-02-18 11:56:23 -05:00
Antoine du Hamel
28f31bdb6a crypto: fix passing TypedArray to webcrypto AES methods
Refs: https://www.w3.org/TR/WebCryptoAPI/#subtlecrypto-interface
Fixes: https://github.com/nodejs/node/issues/36083

PR-URL: https://github.com/nodejs/node/pull/36087
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
2020-11-13 22:00:15 +00:00
James M Snell
dae283d96f
crypto: refactoring internals, add WebCrypto
Fixes: https://github.com/nodejs/node/issues/678
Refs: https://github.com/nodejs/node/issues/26854

Signed-off-by: James M Snell <jasnell@gmail.com>

PR-URL: https://github.com/nodejs/node/pull/35093
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-10-07 17:27:05 -07:00