Update asmcrypto.js to latest version (#6767)

This silences a warning message that was printed to the console whenever
this module was loaded during tests.

The API changes between these two versions were reviewed carefully for
differences. The only difference made was to `PBKDF2_HMAC_SHA256.bytes`,
which was replaced by `Pbkdf2HmacSha256`.

The length argument no longer has a default value, so it has been set
to match what the default value was in the previous version we used,
which is 32 (the SHA256 hash size).
feature/default_network_editable
Mark Stacey 5 years ago committed by GitHub
parent 687984a938
commit 865321d269
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      app/scripts/edge-encryptor.js
  2. 6
      package-lock.json
  3. 2
      package.json

@ -74,8 +74,10 @@ class EdgeEncryptor {
var passBuffer = Unibabel.utf8ToBuffer(password) var passBuffer = Unibabel.utf8ToBuffer(password)
var saltBuffer = Unibabel.base64ToBuffer(salt) var saltBuffer = Unibabel.base64ToBuffer(salt)
const iterations = 10000
const length = 32 // SHA256 hash size
return new Promise((resolve) => { return new Promise((resolve) => {
var key = asmcrypto.PBKDF2_HMAC_SHA256.bytes(passBuffer, saltBuffer, 10000) var key = asmcrypto.Pbkdf2HmacSha256(passBuffer, saltBuffer, iterations, length)
resolve(key) resolve(key)
}) })
} }

6
package-lock.json generated

@ -7885,9 +7885,9 @@
"integrity": "sha1-5QNHYR1+aQlDIIu9r+vLwvuGbUY=" "integrity": "sha1-5QNHYR1+aQlDIIu9r+vLwvuGbUY="
}, },
"asmcrypto.js": { "asmcrypto.js": {
"version": "0.22.0", "version": "2.3.2",
"resolved": "https://registry.npmjs.org/asmcrypto.js/-/asmcrypto.js-0.22.0.tgz", "resolved": "https://registry.npmjs.org/asmcrypto.js/-/asmcrypto.js-2.3.2.tgz",
"integrity": "sha512-usgMoyXjMbx/ZPdzTSXExhMPur2FTdz/Vo5PVx2gIaBcdAAJNOFlsdgqveM8Cff7W0v+xrf9BwjOV26JSAF9qA==" "integrity": "sha512-3FgFARf7RupsZETQ1nHnhLUUvpcttcCq1iZCaVAbJZbCZ5VNRrNyvpDyHTOb0KC3llFcsyOT/a99NZcCbeiEsA=="
}, },
"asn1": { "asn1": {
"version": "0.2.3", "version": "0.2.3",

@ -50,7 +50,7 @@
"@sentry/browser": "^4.1.1", "@sentry/browser": "^4.1.1",
"@zxing/library": "^0.8.0", "@zxing/library": "^0.8.0",
"abi-decoder": "^1.2.0", "abi-decoder": "^1.2.0",
"asmcrypto.js": "0.22.0", "asmcrypto.js": "^2.3.2",
"async": "^2.5.0", "async": "^2.5.0",
"await-semaphore": "^0.1.1", "await-semaphore": "^0.1.1",
"babel-runtime": "^6.23.0", "babel-runtime": "^6.23.0",

Loading…
Cancel
Save