@wireapp/protocol-messaging 1.59.0 → 1.61.0

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.
Files changed (4) hide show
  1. package/package.json +2 -2
  2. package/web/messages.js +2476 -1210
  3. package/web/mls.js +80 -32
  4. package/web/otr.js +567 -259
package/web/mls.js CHANGED
@@ -72,7 +72,7 @@ $root.mls = (function() {
72
72
  function GroupInfoBundle(properties) {
73
73
  if (properties)
74
74
  for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
75
- if (properties[keys[i]] != null)
75
+ if (properties[keys[i]] != null && keys[i] !== "__proto__")
76
76
  this[keys[i]] = properties[keys[i]];
77
77
  }
78
78
 
@@ -121,9 +121,13 @@ $root.mls = (function() {
121
121
  * @param {$protobuf.Writer} [writer] Writer to encode to
122
122
  * @returns {$protobuf.Writer} Writer
123
123
  */
124
- GroupInfoBundle.encode = function encode(message, writer) {
124
+ GroupInfoBundle.encode = function encode(message, writer, q) {
125
125
  if (!writer)
126
126
  writer = $Writer.create();
127
+ if (q === undefined)
128
+ q = 0;
129
+ if (q > $util.recursionLimit)
130
+ throw Error("max depth exceeded");
127
131
  writer.uint32(/* id 1, wireType 0 =*/8).int32(message.groupInfoType);
128
132
  writer.uint32(/* id 2, wireType 0 =*/16).int32(message.ratchetTreeType);
129
133
  writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.groupInfo);
@@ -154,12 +158,18 @@ $root.mls = (function() {
154
158
  * @throws {Error} If the payload is not a reader or valid buffer
155
159
  * @throws {$protobuf.util.ProtocolError} If required fields are missing
156
160
  */
157
- GroupInfoBundle.decode = function decode(reader, length) {
161
+ GroupInfoBundle.decode = function decode(reader, length, error, long) {
158
162
  if (!(reader instanceof $Reader))
159
163
  reader = $Reader.create(reader);
164
+ if (long === undefined)
165
+ long = 0;
166
+ if (long > $Reader.recursionLimit)
167
+ throw Error("maximum nesting depth exceeded");
160
168
  var end = length === undefined ? reader.len : reader.pos + length, message = new $root.mls.GroupInfoBundle();
161
169
  while (reader.pos < end) {
162
170
  var tag = reader.uint32();
171
+ if (tag === error)
172
+ break;
163
173
  switch (tag >>> 3) {
164
174
  case 1: {
165
175
  message.groupInfoType = reader.int32();
@@ -174,15 +184,15 @@ $root.mls = (function() {
174
184
  break;
175
185
  }
176
186
  default:
177
- reader.skipType(tag & 7);
187
+ reader.skipType(tag & 7, long);
178
188
  break;
179
189
  }
180
190
  }
181
- if (!message.hasOwnProperty("groupInfoType"))
191
+ if (!Object.hasOwnProperty.call(message, "groupInfoType"))
182
192
  throw $util.ProtocolError("missing required 'groupInfoType'", { instance: message });
183
- if (!message.hasOwnProperty("ratchetTreeType"))
193
+ if (!Object.hasOwnProperty.call(message, "ratchetTreeType"))
184
194
  throw $util.ProtocolError("missing required 'ratchetTreeType'", { instance: message });
185
- if (!message.hasOwnProperty("groupInfo"))
195
+ if (!Object.hasOwnProperty.call(message, "groupInfo"))
186
196
  throw $util.ProtocolError("missing required 'groupInfo'", { instance: message });
187
197
  return message;
188
198
  };
@@ -211,9 +221,13 @@ $root.mls = (function() {
211
221
  * @param {Object.<string,*>} message Plain object to verify
212
222
  * @returns {string|null} `null` if valid, otherwise the reason why it is not
213
223
  */
214
- GroupInfoBundle.verify = function verify(message) {
224
+ GroupInfoBundle.verify = function verify(message, long) {
215
225
  if (typeof message !== "object" || message === null)
216
226
  return "object expected";
227
+ if (long === undefined)
228
+ long = 0;
229
+ if (long > $util.recursionLimit)
230
+ return "maximum nesting depth exceeded";
217
231
  switch (message.groupInfoType) {
218
232
  default:
219
233
  return "groupInfoType: enum value expected";
@@ -243,9 +257,15 @@ $root.mls = (function() {
243
257
  * @param {Object.<string,*>} object Plain object
244
258
  * @returns {mls.GroupInfoBundle} GroupInfoBundle
245
259
  */
246
- GroupInfoBundle.fromObject = function fromObject(object) {
260
+ GroupInfoBundle.fromObject = function fromObject(object, long) {
247
261
  if (object instanceof $root.mls.GroupInfoBundle)
248
262
  return object;
263
+ if (!$util.isObject(object))
264
+ throw TypeError(".mls.GroupInfoBundle: object expected");
265
+ if (long === undefined)
266
+ long = 0;
267
+ if (long > $util.recursionLimit)
268
+ throw Error("maximum nesting depth exceeded");
249
269
  var message = new $root.mls.GroupInfoBundle();
250
270
  switch (object.groupInfoType) {
251
271
  default:
@@ -304,9 +324,13 @@ $root.mls = (function() {
304
324
  * @param {$protobuf.IConversionOptions} [options] Conversion options
305
325
  * @returns {Object.<string,*>} Plain object
306
326
  */
307
- GroupInfoBundle.toObject = function toObject(message, options) {
327
+ GroupInfoBundle.toObject = function toObject(message, options, q) {
308
328
  if (!options)
309
329
  options = {};
330
+ if (q === undefined)
331
+ q = 0;
332
+ if (q > $util.recursionLimit)
333
+ throw Error("max depth exceeded");
310
334
  var object = {};
311
335
  if (options.defaults) {
312
336
  object.groupInfoType = options.enums === String ? "PUBLIC_GROUP_STATE" : 1;
@@ -319,11 +343,11 @@ $root.mls = (function() {
319
343
  object.groupInfo = $util.newBuffer(object.groupInfo);
320
344
  }
321
345
  }
322
- if (message.groupInfoType != null && message.hasOwnProperty("groupInfoType"))
346
+ if (message.groupInfoType != null && Object.hasOwnProperty.call(message, "groupInfoType"))
323
347
  object.groupInfoType = options.enums === String ? $root.mls.GroupInfoType[message.groupInfoType] === undefined ? message.groupInfoType : $root.mls.GroupInfoType[message.groupInfoType] : message.groupInfoType;
324
- if (message.ratchetTreeType != null && message.hasOwnProperty("ratchetTreeType"))
348
+ if (message.ratchetTreeType != null && Object.hasOwnProperty.call(message, "ratchetTreeType"))
325
349
  object.ratchetTreeType = options.enums === String ? $root.mls.RatchetTreeType[message.ratchetTreeType] === undefined ? message.ratchetTreeType : $root.mls.RatchetTreeType[message.ratchetTreeType] : message.ratchetTreeType;
326
- if (message.groupInfo != null && message.hasOwnProperty("groupInfo"))
350
+ if (message.groupInfo != null && Object.hasOwnProperty.call(message, "groupInfo"))
327
351
  object.groupInfo = options.bytes === String ? $util.base64.encode(message.groupInfo, 0, message.groupInfo.length) : options.bytes === Array ? Array.prototype.slice.call(message.groupInfo) : message.groupInfo;
328
352
  return object;
329
353
  };
@@ -379,7 +403,7 @@ $root.mls = (function() {
379
403
  function CommitBundle(properties) {
380
404
  if (properties)
381
405
  for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
382
- if (properties[keys[i]] != null)
406
+ if (properties[keys[i]] != null && keys[i] !== "__proto__")
383
407
  this[keys[i]] = properties[keys[i]];
384
408
  }
385
409
 
@@ -428,13 +452,17 @@ $root.mls = (function() {
428
452
  * @param {$protobuf.Writer} [writer] Writer to encode to
429
453
  * @returns {$protobuf.Writer} Writer
430
454
  */
431
- CommitBundle.encode = function encode(message, writer) {
455
+ CommitBundle.encode = function encode(message, writer, q) {
432
456
  if (!writer)
433
457
  writer = $Writer.create();
458
+ if (q === undefined)
459
+ q = 0;
460
+ if (q > $util.recursionLimit)
461
+ throw Error("max depth exceeded");
434
462
  writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.commit);
435
463
  if (message.welcome != null && Object.hasOwnProperty.call(message, "welcome"))
436
464
  writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.welcome);
437
- $root.mls.GroupInfoBundle.encode(message.groupInfoBundle, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
465
+ $root.mls.GroupInfoBundle.encode(message.groupInfoBundle, writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim();
438
466
  return writer;
439
467
  };
440
468
 
@@ -462,12 +490,18 @@ $root.mls = (function() {
462
490
  * @throws {Error} If the payload is not a reader or valid buffer
463
491
  * @throws {$protobuf.util.ProtocolError} If required fields are missing
464
492
  */
465
- CommitBundle.decode = function decode(reader, length) {
493
+ CommitBundle.decode = function decode(reader, length, error, long) {
466
494
  if (!(reader instanceof $Reader))
467
495
  reader = $Reader.create(reader);
496
+ if (long === undefined)
497
+ long = 0;
498
+ if (long > $Reader.recursionLimit)
499
+ throw Error("maximum nesting depth exceeded");
468
500
  var end = length === undefined ? reader.len : reader.pos + length, message = new $root.mls.CommitBundle();
469
501
  while (reader.pos < end) {
470
502
  var tag = reader.uint32();
503
+ if (tag === error)
504
+ break;
471
505
  switch (tag >>> 3) {
472
506
  case 1: {
473
507
  message.commit = reader.bytes();
@@ -478,17 +512,17 @@ $root.mls = (function() {
478
512
  break;
479
513
  }
480
514
  case 3: {
481
- message.groupInfoBundle = $root.mls.GroupInfoBundle.decode(reader, reader.uint32());
515
+ message.groupInfoBundle = $root.mls.GroupInfoBundle.decode(reader, reader.uint32(), undefined, long + 1);
482
516
  break;
483
517
  }
484
518
  default:
485
- reader.skipType(tag & 7);
519
+ reader.skipType(tag & 7, long);
486
520
  break;
487
521
  }
488
522
  }
489
- if (!message.hasOwnProperty("commit"))
523
+ if (!Object.hasOwnProperty.call(message, "commit"))
490
524
  throw $util.ProtocolError("missing required 'commit'", { instance: message });
491
- if (!message.hasOwnProperty("groupInfoBundle"))
525
+ if (!Object.hasOwnProperty.call(message, "groupInfoBundle"))
492
526
  throw $util.ProtocolError("missing required 'groupInfoBundle'", { instance: message });
493
527
  return message;
494
528
  };
@@ -517,16 +551,20 @@ $root.mls = (function() {
517
551
  * @param {Object.<string,*>} message Plain object to verify
518
552
  * @returns {string|null} `null` if valid, otherwise the reason why it is not
519
553
  */
520
- CommitBundle.verify = function verify(message) {
554
+ CommitBundle.verify = function verify(message, long) {
521
555
  if (typeof message !== "object" || message === null)
522
556
  return "object expected";
557
+ if (long === undefined)
558
+ long = 0;
559
+ if (long > $util.recursionLimit)
560
+ return "maximum nesting depth exceeded";
523
561
  if (!(message.commit && typeof message.commit.length === "number" || $util.isString(message.commit)))
524
562
  return "commit: buffer expected";
525
- if (message.welcome != null && message.hasOwnProperty("welcome"))
563
+ if (message.welcome != null && Object.hasOwnProperty.call(message, "welcome"))
526
564
  if (!(message.welcome && typeof message.welcome.length === "number" || $util.isString(message.welcome)))
527
565
  return "welcome: buffer expected";
528
566
  {
529
- var error = $root.mls.GroupInfoBundle.verify(message.groupInfoBundle);
567
+ var error = $root.mls.GroupInfoBundle.verify(message.groupInfoBundle, long + 1);
530
568
  if (error)
531
569
  return "groupInfoBundle." + error;
532
570
  }
@@ -541,9 +579,15 @@ $root.mls = (function() {
541
579
  * @param {Object.<string,*>} object Plain object
542
580
  * @returns {mls.CommitBundle} CommitBundle
543
581
  */
544
- CommitBundle.fromObject = function fromObject(object) {
582
+ CommitBundle.fromObject = function fromObject(object, long) {
545
583
  if (object instanceof $root.mls.CommitBundle)
546
584
  return object;
585
+ if (!$util.isObject(object))
586
+ throw TypeError(".mls.CommitBundle: object expected");
587
+ if (long === undefined)
588
+ long = 0;
589
+ if (long > $util.recursionLimit)
590
+ throw Error("maximum nesting depth exceeded");
547
591
  var message = new $root.mls.CommitBundle();
548
592
  if (object.commit != null)
549
593
  if (typeof object.commit === "string")
@@ -556,9 +600,9 @@ $root.mls = (function() {
556
600
  else if (object.welcome.length >= 0)
557
601
  message.welcome = object.welcome;
558
602
  if (object.groupInfoBundle != null) {
559
- if (typeof object.groupInfoBundle !== "object")
603
+ if (!$util.isObject(object.groupInfoBundle))
560
604
  throw TypeError(".mls.CommitBundle.groupInfoBundle: object expected");
561
- message.groupInfoBundle = $root.mls.GroupInfoBundle.fromObject(object.groupInfoBundle);
605
+ message.groupInfoBundle = $root.mls.GroupInfoBundle.fromObject(object.groupInfoBundle, long + 1);
562
606
  }
563
607
  return message;
564
608
  };
@@ -572,9 +616,13 @@ $root.mls = (function() {
572
616
  * @param {$protobuf.IConversionOptions} [options] Conversion options
573
617
  * @returns {Object.<string,*>} Plain object
574
618
  */
575
- CommitBundle.toObject = function toObject(message, options) {
619
+ CommitBundle.toObject = function toObject(message, options, q) {
576
620
  if (!options)
577
621
  options = {};
622
+ if (q === undefined)
623
+ q = 0;
624
+ if (q > $util.recursionLimit)
625
+ throw Error("max depth exceeded");
578
626
  var object = {};
579
627
  if (options.defaults) {
580
628
  if (options.bytes === String)
@@ -593,12 +641,12 @@ $root.mls = (function() {
593
641
  }
594
642
  object.groupInfoBundle = null;
595
643
  }
596
- if (message.commit != null && message.hasOwnProperty("commit"))
644
+ if (message.commit != null && Object.hasOwnProperty.call(message, "commit"))
597
645
  object.commit = options.bytes === String ? $util.base64.encode(message.commit, 0, message.commit.length) : options.bytes === Array ? Array.prototype.slice.call(message.commit) : message.commit;
598
- if (message.welcome != null && message.hasOwnProperty("welcome"))
646
+ if (message.welcome != null && Object.hasOwnProperty.call(message, "welcome"))
599
647
  object.welcome = options.bytes === String ? $util.base64.encode(message.welcome, 0, message.welcome.length) : options.bytes === Array ? Array.prototype.slice.call(message.welcome) : message.welcome;
600
- if (message.groupInfoBundle != null && message.hasOwnProperty("groupInfoBundle"))
601
- object.groupInfoBundle = $root.mls.GroupInfoBundle.toObject(message.groupInfoBundle, options);
648
+ if (message.groupInfoBundle != null && Object.hasOwnProperty.call(message, "groupInfoBundle"))
649
+ object.groupInfoBundle = $root.mls.GroupInfoBundle.toObject(message.groupInfoBundle, options, q + 1);
602
650
  return object;
603
651
  };
604
652