parse 4.3.0-alpha.4 → 4.3.0-alpha.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Parse JavaScript SDK v4.3.0-alpha.4
2
+ * Parse JavaScript SDK v4.3.0-alpha.5
3
3
  *
4
4
  * The source tree of this library can be found at
5
5
  * https://github.com/ParsePlatform/Parse-SDK-JS
@@ -557,7 +557,7 @@ var config /*: Config & { [key: string]: mixed }*/ = {
557
557
  SERVER_AUTH_TOKEN: null,
558
558
  LIVEQUERY_SERVER_URL: null,
559
559
  ENCRYPTED_KEY: null,
560
- VERSION: 'js' + "4.3.0-alpha.4",
560
+ VERSION: 'js' + "4.3.0-alpha.5",
561
561
  APPLICATION_ID: null,
562
562
  JAVASCRIPT_KEY: null,
563
563
  MASTER_KEY: null,
@@ -28176,14 +28176,19 @@ module.exports = parent;
28176
28176
  * var derivedParams = CryptoJS.kdf.OpenSSL.execute('Password', 256/32, 128/32);
28177
28177
  * var derivedParams = CryptoJS.kdf.OpenSSL.execute('Password', 256/32, 128/32, 'saltsalt');
28178
28178
  */
28179
- execute: function (password, keySize, ivSize, salt) {
28179
+ execute: function (password, keySize, ivSize, salt, hasher) {
28180
28180
  // Generate random salt
28181
28181
  if (!salt) {
28182
28182
  salt = WordArray.random(64/8);
28183
28183
  }
28184
28184
 
28185
28185
  // Derive key and IV
28186
- var key = EvpKDF.create({ keySize: keySize + ivSize }).compute(password, salt);
28186
+ if (!hasher) {
28187
+ var key = EvpKDF.create({ keySize: keySize + ivSize }).compute(password, salt);
28188
+ } else {
28189
+ var key = EvpKDF.create({ keySize: keySize + ivSize, hasher: hasher }).compute(password, salt);
28190
+ }
28191
+
28187
28192
 
28188
28193
  // Separate key and IV
28189
28194
  var iv = WordArray.create(key.words.slice(keySize), ivSize * 4);
@@ -28230,7 +28235,7 @@ module.exports = parent;
28230
28235
  cfg = this.cfg.extend(cfg);
28231
28236
 
28232
28237
  // Derive key and other params
28233
- var derivedParams = cfg.kdf.execute(password, cipher.keySize, cipher.ivSize);
28238
+ var derivedParams = cfg.kdf.execute(password, cipher.keySize, cipher.ivSize, cfg.salt, cfg.hasher);
28234
28239
 
28235
28240
  // Add IV to config
28236
28241
  cfg.iv = derivedParams.iv;
@@ -28269,7 +28274,7 @@ module.exports = parent;
28269
28274
  ciphertext = this._parse(ciphertext, cfg.format);
28270
28275
 
28271
28276
  // Derive key and other params
28272
- var derivedParams = cfg.kdf.execute(password, cipher.keySize, cipher.ivSize, ciphertext.salt);
28277
+ var derivedParams = cfg.kdf.execute(password, cipher.keySize, cipher.ivSize, ciphertext.salt, cfg.hasher);
28273
28278
 
28274
28279
  // Add IV to config
28275
28280
  cfg.iv = derivedParams.iv;
@@ -29607,7 +29612,7 @@ module.exports = parent;
29607
29612
  var M_offset_14 = M[offset + 14];
29608
29613
  var M_offset_15 = M[offset + 15];
29609
29614
 
29610
- // Working varialbes
29615
+ // Working variables
29611
29616
  var a = H[0];
29612
29617
  var b = H[1];
29613
29618
  var c = H[2];