@open-e2ee/signal-protocol-sdk 14.3.0 → 14.5.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 (116) hide show
  1. package/CHANGELOG.md +170 -0
  2. package/README.md +1 -1
  3. package/SECURITY.md +2 -2
  4. package/dist/client/client.d.ts +31 -5
  5. package/dist/client/client.d.ts.map +1 -1
  6. package/dist/client/client.js +86 -31
  7. package/dist/client/client.js.map +1 -1
  8. package/dist/client/config.d.ts +17 -0
  9. package/dist/client/config.d.ts.map +1 -1
  10. package/dist/client/config.js +17 -0
  11. package/dist/client/config.js.map +1 -1
  12. package/dist/client/delivery-status.d.ts.map +1 -1
  13. package/dist/client/delivery-status.js +8 -7
  14. package/dist/client/delivery-status.js.map +1 -1
  15. package/dist/client/group-outbox.d.ts +17 -1
  16. package/dist/client/group-outbox.d.ts.map +1 -1
  17. package/dist/client/group-outbox.js +37 -2
  18. package/dist/client/group-outbox.js.map +1 -1
  19. package/dist/client/group-sealed-sender.d.ts +20 -0
  20. package/dist/client/group-sealed-sender.d.ts.map +1 -1
  21. package/dist/client/group-sealed-sender.js +49 -8
  22. package/dist/client/group-sealed-sender.js.map +1 -1
  23. package/dist/client/hosted-anonymous-delivery.d.ts +10 -4
  24. package/dist/client/hosted-anonymous-delivery.d.ts.map +1 -1
  25. package/dist/client/hosted-anonymous-delivery.js +17 -8
  26. package/dist/client/hosted-anonymous-delivery.js.map +1 -1
  27. package/dist/client/hosted-device-link-transport.d.ts +6 -2
  28. package/dist/client/hosted-device-link-transport.d.ts.map +1 -1
  29. package/dist/client/hosted-device-link-transport.js +10 -5
  30. package/dist/client/hosted-device-link-transport.js.map +1 -1
  31. package/dist/client/hosted-group-authority.d.ts +4 -2
  32. package/dist/client/hosted-group-authority.d.ts.map +1 -1
  33. package/dist/client/hosted-group-authority.js +10 -7
  34. package/dist/client/hosted-group-authority.js.map +1 -1
  35. package/dist/client/hosted-groups.d.ts +8 -3
  36. package/dist/client/hosted-groups.d.ts.map +1 -1
  37. package/dist/client/hosted-groups.js +15 -9
  38. package/dist/client/hosted-groups.js.map +1 -1
  39. package/dist/client/hosted-mailbox-subscription.d.ts +6 -2
  40. package/dist/client/hosted-mailbox-subscription.d.ts.map +1 -1
  41. package/dist/client/hosted-mailbox-subscription.js +20 -8
  42. package/dist/client/hosted-mailbox-subscription.js.map +1 -1
  43. package/dist/client/hosted-sandbox-identity.d.ts +23 -19
  44. package/dist/client/hosted-sandbox-identity.d.ts.map +1 -1
  45. package/dist/client/hosted-sandbox-identity.js +23 -19
  46. package/dist/client/hosted-sandbox-identity.js.map +1 -1
  47. package/dist/client/hosted-store-records.d.ts +22 -17
  48. package/dist/client/hosted-store-records.d.ts.map +1 -1
  49. package/dist/client/hosted-store-records.js +15 -10
  50. package/dist/client/hosted-store-records.js.map +1 -1
  51. package/dist/client/hosted-transport.d.ts +10 -6
  52. package/dist/client/hosted-transport.d.ts.map +1 -1
  53. package/dist/client/hosted-transport.js +132 -87
  54. package/dist/client/hosted-transport.js.map +1 -1
  55. package/dist/client/hosted.d.ts +15 -4
  56. package/dist/client/hosted.d.ts.map +1 -1
  57. package/dist/client/hosted.js +6 -6
  58. package/dist/client/hosted.js.map +1 -1
  59. package/dist/client/receive-work-seed.d.ts +4 -4
  60. package/dist/client/receive-work-seed.d.ts.map +1 -1
  61. package/dist/client/receive-work-seed.js +1 -1
  62. package/dist/client/receive-work-seed.js.map +1 -1
  63. package/dist/client/sealed-sender.d.ts +27 -1
  64. package/dist/client/sealed-sender.d.ts.map +1 -1
  65. package/dist/client/sealed-sender.js +47 -0
  66. package/dist/client/sealed-sender.js.map +1 -1
  67. package/dist/client/send-deadline.d.ts +5 -2
  68. package/dist/client/send-deadline.d.ts.map +1 -1
  69. package/dist/client/send-deadline.js +5 -2
  70. package/dist/client/send-deadline.js.map +1 -1
  71. package/dist/client/signal-relay-acceptance.d.ts +3 -2
  72. package/dist/client/signal-relay-acceptance.d.ts.map +1 -1
  73. package/dist/client/signal-relay-acceptance.js.map +1 -1
  74. package/dist/client/signal-relay-protocol.d.ts +92 -18
  75. package/dist/client/signal-relay-protocol.d.ts.map +1 -1
  76. package/dist/client/signal-relay-protocol.js +197 -15
  77. package/dist/client/signal-relay-protocol.js.map +1 -1
  78. package/dist/client/signal-relay-subscription.js +1 -1
  79. package/dist/client/signal-relay-subscription.js.map +1 -1
  80. package/dist/client/signal-service-cipher.d.ts +34 -3
  81. package/dist/client/signal-service-cipher.d.ts.map +1 -1
  82. package/dist/client/signal-service-cipher.js +173 -21
  83. package/dist/client/signal-service-cipher.js.map +1 -1
  84. package/dist/internal/manager/manager.d.ts +5 -0
  85. package/dist/internal/manager/manager.d.ts.map +1 -1
  86. package/dist/internal/manager/manager.js +10 -3
  87. package/dist/internal/manager/manager.js.map +1 -1
  88. package/dist/internal/protocol/zk/groups/group-send-endorsement.d.ts +6 -0
  89. package/dist/internal/protocol/zk/groups/group-send-endorsement.d.ts.map +1 -1
  90. package/dist/internal/protocol/zk/groups/group-send-endorsement.js +7 -1
  91. package/dist/internal/protocol/zk/groups/group-send-endorsement.js.map +1 -1
  92. package/dist/internal/session/cipher.d.ts +2 -0
  93. package/dist/internal/session/cipher.d.ts.map +1 -1
  94. package/dist/internal/session/cipher.js +13 -9
  95. package/dist/internal/session/cipher.js.map +1 -1
  96. package/dist/internal/session/session-trust.d.ts +85 -0
  97. package/dist/internal/session/session-trust.d.ts.map +1 -0
  98. package/dist/internal/session/session-trust.js +124 -0
  99. package/dist/internal/session/session-trust.js.map +1 -0
  100. package/dist/internal/session/types.d.ts +7 -0
  101. package/dist/internal/session/types.d.ts.map +1 -1
  102. package/dist/local/store/receive-work.d.ts +5 -5
  103. package/dist/local/store/receive-work.d.ts.map +1 -1
  104. package/dist/local/store/receive-work.js +10 -12
  105. package/dist/local/store/receive-work.js.map +1 -1
  106. package/dist/local/store/reliability.d.ts +21 -4
  107. package/dist/local/store/reliability.d.ts.map +1 -1
  108. package/dist/local/store/reliability.js.map +1 -1
  109. package/dist/types/api.d.ts +16 -9
  110. package/dist/types/api.d.ts.map +1 -1
  111. package/dist/utils/retry.d.ts +1 -0
  112. package/dist/utils/retry.d.ts.map +1 -1
  113. package/dist/utils/retry.js +7 -0
  114. package/dist/utils/retry.js.map +1 -1
  115. package/docs/ASSURANCE.md +5 -5
  116. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"signal-service-cipher.d.ts","sourceRoot":"","sources":["../../client/signal-service-cipher.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAIH,OAAO,KAAK,EACV,yBAAyB,EACzB,QAAQ,EAGR,iBAAiB,EAElB,MAAM,8BAA8B,CAAC;AACtC,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,wBAAwB,CAAC;AAC9E,OAAO,KAAK,EACV,wBAAwB,EAExB,iBAAiB,EACjB,eAAe,EAChB,MAAM,UAAU,CAAC;AAClB,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AAI3D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAGvD,OAAO,EAEL,KAAK,aAAa,EAElB,KAAK,aAAa,EAEnB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAA+B,KAAK,MAAM,EAAE,MAAM,WAAW,CAAC;AACrE,OAAO,EACL,gBAAgB,EAChB,KAAK,4BAA4B,EAClC,MAAM,kCAAkC,CAAC;AAO1C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAChE,OAAO,EACL,wBAAwB,EACxB,4BAA4B,EAK5B,KAAK,qBAAqB,EAC3B,MAAM,+BAA+B,CAAC;AAGvC,OAAO,KAAK,EAAE,wBAAwB,EAAE,aAAa,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAehG,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EACL,KAAK,0BAA0B,EAE/B,KA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EAAE,MAAM,EACvB,iBAAiB,EAAE,MAAM,EACzB,gBAAgB,EAAE,MAAM,GACvB,OAAO,CAAC,aAAa,GAAG,SAAS,CAAC,CAEpC;IAED;;;;;;;;;;;OAWG;IACG,gBAAgB,CACpB,eAAe,EAAE,MAAM,EACvB,iBAAiB,EAAE,MAAM,EACzB,aAAa,EAAE,MAAM,GACpB,OAAO,CAAC,aAAa,GAAG,SAAS,CAAC,CAEpC;IAED;;;;;OAKG;IACH,uBAAuB,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAErF;IAED;;;OAGG;YACW,iBAAiB;IA+B/B;;;;;;;;;;;;;;;;OAgBG;YACW,YAAY;IA+N1B;;;;;;;;OAQG;YACW,yBAAyB;YA0BzB,4BAA4B;IAwF1C;;;;OAIG;YACW,8BAA8B;IAyB5C;;;;;;;;;;;;;;;;;;;;OAoBG;YACW,+BAA+B;IAqE7C;;;;OAIG;IACH,OAAO,CAAC,uBAAuB;IAkB/B;;;;OAIG;YACW,8BAA8B;IAyB5C;;;;;;;OAOG;YACW,4BAA4B;IAiE1C;;;;;OAKG;YACW,cAAc;IAuB5B;;;;;;;;;;;;;;;;OAgBG;YACW,uBAAuB;IAkHrC;;;OAGG;IACH,OAAO,CAAC,kBAAkB;YAOZ,uBAAuB;CAuBtC"}
1
+ {"version":3,"file":"signal-service-cipher.d.ts","sourceRoot":"","sources":["../../client/signal-service-cipher.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAIH,OAAO,KAAK,EACV,yBAAyB,EACzB,QAAQ,EAGR,iBAAiB,EAElB,MAAM,8BAA8B,CAAC;AACtC,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,wBAAwB,CAAC;AAC9E,OAAO,KAAK,EACV,wBAAwB,EAExB,iBAAiB,EACjB,eAAe,EAChB,MAAM,UAAU,CAAC;AAClB,OAAO,KAAK,EAAE,sBAAsB,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;YACW,yBAAyB;YA0BzB,4BAA4B;IAwF1C;;;;OAIG;YACW,8BAA8B;IAyB5C;;;;;;;;;;;;;;;;;;;;OAoBG;YACW,+BAA+B;IAqE7C;;;;OAIG;IACH,OAAO,CAAC,uBAAuB;IAkB/B;;;;OAIG;YACW,8BAA8B;IAyB5C;;;;;;;OAOG;YACW,4BAA4B;IAiE1C;;;;;OAKG;YACW,cAAc;IAuB5B;;;;;;;;;;;;;;;;OAgBG;YACW,uBAAuB;IAkHrC;;;OAGG;IACH,OAAO,CAAC,kBAAkB;YAOZ,uBAAuB;CAuBtC"}
@@ -17,7 +17,7 @@ import AsyncLock from 'async-lock';
17
17
  import { EncryptionError, EncryptionErrorCode } from '../types/index.js';
18
18
  import { SealedSenderAuthError } from '../types/errors.js';
19
19
  import { base64ToBytes } from '../internal/crypto/index.js';
20
- import { recordServerClockSample } from '../server-clock.js';
20
+ import { estimateServerTimestamp, recordServerClockSample } from '../server-clock.js';
21
21
  import { ProtocolAddress } from '../types/address.js';
22
22
  import { isRemovedDevice, } from '../internal/sesame/types.js';
23
23
  import { defaultSignalProtocolLogger } from '../logger.js';
@@ -45,11 +45,12 @@ import { admitRequestsFor, followedRepeatedRequest, markAfterRepeatedRequest, }
45
45
  import { forDirectSealedRoute, usedGroupRouteFallback } from './signal-relay-sealed-route.js';
46
46
  import { comparesDeviceSets, markDeviceSetRefusal } from '../remote/signal-relay/device-set.js';
47
47
  import { DeviceSetReconciliationError, markSignalProtocolRelayProtocolError, runDeviceSetPhase, waitUnlessStopped, syncPostReceipts, uncheckedDeclaredPost, } from './device-set-reconciliation.js';
48
- import { prepareGroupSharedMessage } from './group-sealed-sender.js';
48
+ import { prepareGroupSharedMessage, resealGroupSharedMessage } from './group-sealed-sender.js';
49
+ import { isPeriodClosed } from './signal-relay-period-close.js';
49
50
  import { attachFailedGroup } from './retry-terminal-recovery.js';
50
51
  import { sendGroupWithExactOutbox, } from './group-outbox.js';
51
52
  import { groupDeviceKey, listedOwnDeviceChange } from './group-device-set.js';
52
- import { attachUnsealedEnvelope, reconstructEnvelope, resolveSealedSenderContext as resolveSealedSenderSendContext, SealedRetryRequestReceived, serializeDirectSealedSenderMessage as serializeDirectSealedSenderTransport, unsealMessage, } from './sealed-sender.js';
53
+ import { attachUnsealedEnvelope, reconstructEnvelope, resealDirectSealedSenderMessage, resolveSealedSenderContext as resolveSealedSenderSendContext, SealedRetryRequestReceived, sealedBodyNeedsReseal, senderCertificateExpiresAt, serializeDirectSealedSenderMessage as serializeDirectSealedSenderTransport, unsealMessage, } from './sealed-sender.js';
53
54
  import { parseMediaAttachmentMessage, prepareMediaAttachmentUpload, serializeMediaAttachmentMessage, } from '../media/index.js';
54
55
  import { UnidentifiedAccessMode, } from '../profile/contact-state.js';
55
56
  /**
@@ -1637,7 +1638,8 @@ export class SignalProtocolServiceCipher {
1637
1638
  if (!signalRelayHoldsMessageId(error))
1638
1639
  throw error;
1639
1640
  // Only this sender posts this ID, and it posts one encryption under
1640
- // each attempt ID. So a conflict means that the Relay holds that
1641
+ // each attempt ID. A new seal with a new sender certificate changes
1642
+ // only the outer layer. So a conflict means that the Relay holds that
1641
1643
  // encryption from an earlier post.
1642
1644
  this.logger.info('The Relay holds an earlier encryption of a retry resend attempt', {
1643
1645
  category: 'E2EE',
@@ -1726,6 +1728,8 @@ export class SignalProtocolServiceCipher {
1726
1728
  sentMessageBase64: message.sealedSenderMessage,
1727
1729
  auth,
1728
1730
  deliveryMode: required ? 'required' : 'preferred',
1731
+ certificateExpiresAt: message.sealedSenderCertificateExpiresAt,
1732
+ sealHint: resend.contentHint,
1729
1733
  }, {
1730
1734
  ...(stopSignal && { stopSignal }),
1731
1735
  operationEpochMilliseconds: resend.operationEpochMilliseconds,
@@ -3046,6 +3050,7 @@ export class SignalProtocolServiceCipher {
3046
3050
  };
3047
3051
  if (sealedSender) {
3048
3052
  storedMessage.sealedSenderMessage = await this.serializeDirectSealedSenderMessage(storedMessage, storedMessage.ciphertext, storedMessage.messageType, storedMessage.recipientRegistrationId, sealedSender, contentHint);
3053
+ storedMessage.sealedSenderCertificateExpiresAt = senderCertificateExpiresAt(sealedSender.senderCertificateBase64);
3049
3054
  }
3050
3055
  return storedMessage;
3051
3056
  }
@@ -3095,6 +3100,8 @@ export class SignalProtocolServiceCipher {
3095
3100
  sentMessageBase64: message.sealedSenderMessage,
3096
3101
  auth: intent.sealedSenderAuth,
3097
3102
  deliveryMode: intent.transportMode === 'sealed_sender_required' ? 'required' : 'preferred',
3103
+ certificateExpiresAt: message.sealedSenderCertificateExpiresAt,
3104
+ sealHint: intent.contentHint,
3098
3105
  }, control);
3099
3106
  }
3100
3107
  /** Post one device message, and repair its session once if the device rejects it. */
@@ -3891,9 +3898,10 @@ export class SignalProtocolServiceCipher {
3891
3898
  !this.signalProtocolRelay?.sendMultiRecipientUnidentified) {
3892
3899
  return undefined;
3893
3900
  }
3901
+ const senderKeys = await this.sealedSenderProvider();
3894
3902
  const prepared = await prepareGroupSharedMessage({
3895
3903
  storage: this.storage,
3896
- senderKeys: await this.sealedSenderProvider(),
3904
+ senderKeys,
3897
3905
  members,
3898
3906
  encryptedMessageBase64: ciphertext,
3899
3907
  contentHint,
@@ -3904,6 +3912,7 @@ export class SignalProtocolServiceCipher {
3904
3912
  sentMessageBase64: prepared.sentMessageBase64,
3905
3913
  recipientUserIds: prepared.recipientUserIds,
3906
3914
  deliveryMode: this.sealedSenderDeliveryMode === 'required' ? 'required' : 'preferred',
3915
+ sealedSenderCertificateExpiresAt: senderCertificateExpiresAt(senderKeys.senderCertificateBase64),
3907
3916
  }
3908
3917
  : undefined;
3909
3918
  },
@@ -3934,6 +3943,8 @@ export class SignalProtocolServiceCipher {
3934
3943
  return false;
3935
3944
  },
3936
3945
  resolveGroupAuthorization: (groupId, recipients) => this.resolveGroupSendAuthorization(groupId, recipients),
3946
+ renewGroupAuthorization: (groupId, recipients) => this.resolveGroupSendAuthorization(groupId, recipients, true),
3947
+ resealSharedMessage: (intent, body) => this.resealStoredGroupBody(intent, body),
3937
3948
  reportIdentifiedFallback: (recipientUserId) => this.reportIdentifiedFallback(recipientUserId),
3938
3949
  refreshPreMessageEndorsements: (groupId, recipientUserIds) => this.refreshPreMessageEndorsements(groupId, recipientUserIds),
3939
3950
  authorizePreMessage: (groupId, message, required) => this.authorizePreMessage(groupId, message, required),
@@ -3946,6 +3957,8 @@ export class SignalProtocolServiceCipher {
3946
3957
  sentMessageBase64: message.sealedSenderMessage,
3947
3958
  auth,
3948
3959
  deliveryMode: message.sealedSenderDeliveryMode ?? 'preferred',
3960
+ certificateExpiresAt: message.sealedSenderCertificateExpiresAt,
3961
+ sealHint: intent.contentHint,
3949
3962
  }, posting)),
3950
3963
  prepareEach: (items, task) => this.fanOut.all(items, task).catch((error) => {
3951
3964
  throw firstItemError(error);
@@ -4055,6 +4068,7 @@ export class SignalProtocolServiceCipher {
4055
4068
  async sealStoredDeviceMessage(message, sealedSender, deliveryMode, contentHint) {
4056
4069
  const sealed = { ...message };
4057
4070
  sealed.sealedSenderMessage = await this.serializeDirectSealedSenderMessage(message, message.ciphertext, message.messageType, message.recipientRegistrationId, sealedSender, contentHint);
4071
+ sealed.sealedSenderCertificateExpiresAt = senderCertificateExpiresAt(sealedSender.senderCertificateBase64);
4058
4072
  sealed.sealedSenderDeliveryMode = deliveryMode;
4059
4073
  if (sealedSender.auth.type === 'accessKey') {
4060
4074
  sealed.sealedSenderAuthorization = 'access_key';
@@ -4192,6 +4206,8 @@ export class SignalProtocolServiceCipher {
4192
4206
  sentMessageBase64: message.sealedSenderMessage,
4193
4207
  auth,
4194
4208
  deliveryMode: required ? 'required' : 'preferred',
4209
+ certificateExpiresAt: message.sealedSenderCertificateExpiresAt,
4210
+ sealHint: undefined,
4195
4211
  }
4196
4212
  : undefined, { ...control, deliveryClass: 'background-sync' });
4197
4213
  }
@@ -4208,7 +4224,8 @@ export class SignalProtocolServiceCipher {
4208
4224
  * protocol version 2, means that the Relay holds a message under the ID of
4209
4225
  * the post. The evidence of the call accepts it only when the stored
4210
4226
  * entry of the destination has no blocking repair mark: then the Relay
4211
- * holds the same bytes, and the pre-message counts as accepted. Each other
4227
+ * holds the same ciphertext, also when this post sealed it again with a
4228
+ * new sender certificate, and the pre-message counts as accepted. Each other
4212
4229
  * such answer leaves the destination unknown, and the pre-message counts
4213
4230
  * as held: it writes no handoff row, so the next send gives the key again.
4214
4231
  * A repair refreshes the evidence entry of its repaired post before the
@@ -4444,17 +4461,26 @@ export class SignalProtocolServiceCipher {
4444
4461
  }
4445
4462
  /**
4446
4463
  * Refresh the group's endorsements when the cache lacks one of the
4447
- * recipients or expires soon. Resolves to the endorsement manager, or to
4448
- * null when the client has none.
4464
+ * recipients or expires soon. With `renew`, clear the cache first, so the
4465
+ * refresh always runs. A renewal needs the refresher, because a cleared
4466
+ * cache with no refresher leaves the group with no endorsement. Resolves
4467
+ * to the endorsement manager, or to null when the client has none or
4468
+ * cannot renew.
4449
4469
  */
4450
- async refreshGroupSendEndorsements(groupId, recipientUserIds) {
4470
+ async refreshGroupSendEndorsements(groupId, recipientUserIds, renew = false) {
4451
4471
  const manager = this.endorsementManagerResolver ? await this.endorsementManagerResolver() : this.endorsementManager;
4452
4472
  if (!manager || recipientUserIds.length === 0)
4453
4473
  return null;
4474
+ if (renew && !this.endorsementRefresher)
4475
+ return null;
4454
4476
  // The device posts of a send run at the same time. The lock makes them
4455
4477
  // check and refresh the group's endorsements one at a time, so one
4456
4478
  // refresh serves them all. The lock is taken before a slot.
4457
4479
  await this.lock.acquire(`group-send-endorsements:${groupId}`, async () => {
4480
+ // The Relay refused a credential from the cache, so the cache cannot
4481
+ // serve the next post.
4482
+ if (renew)
4483
+ await manager.clearGroupEndorsements(groupId);
4458
4484
  const { needsRefresh, reason } = await manager.shouldRefreshEndorsements(groupId, recipientUserIds);
4459
4485
  if (needsRefresh && this.endorsementRefresher) {
4460
4486
  await this.endorsementRefresher(groupId, recipientUserIds);
@@ -4481,8 +4507,13 @@ export class SignalProtocolServiceCipher {
4481
4507
  }
4482
4508
  await this.refreshGroupSendEndorsements(groupId, recipientUserIds);
4483
4509
  }
4484
- async resolveGroupSendAuthorization(groupId, recipientUserIds) {
4485
- const manager = await this.refreshGroupSendEndorsements(groupId, recipientUserIds);
4510
+ /**
4511
+ * The group-send authorization of the recipients, from the group's
4512
+ * endorsements. With `renew`, the endorsements are cleared and refreshed
4513
+ * first. Resolves to null when no authorization resolves.
4514
+ */
4515
+ async resolveGroupSendAuthorization(groupId, recipientUserIds, renew = false) {
4516
+ const manager = await this.refreshGroupSendEndorsements(groupId, recipientUserIds, renew);
4486
4517
  if (!manager)
4487
4518
  return null;
4488
4519
  const groupSecretParams = this.groupSecretParamsProvider
@@ -4606,6 +4637,71 @@ export class SignalProtocolServiceCipher {
4606
4637
  identifiedFallback: sealedSender.config.deliveryMode !== 'required',
4607
4638
  };
4608
4639
  }
4640
+ /**
4641
+ * Seal a stored group body again from the stored group ciphertext of its
4642
+ * intent, with the current sender certificate. Resolves to undefined when
4643
+ * no sealed-sender provider is configured or the intent has no group
4644
+ * ciphertext.
4645
+ */
4646
+ async resealStoredGroupBody(intent, body) {
4647
+ if (!this.sealedSenderProvider || intent.groupCiphertext === undefined) {
4648
+ this.logger.warn('No sealed-sender provider can seal a stored group body again', {
4649
+ category: 'E2EE',
4650
+ data: { groupId: body.groupId, clientMessageId: intent.clientMessageId },
4651
+ });
4652
+ return undefined;
4653
+ }
4654
+ return resealGroupSharedMessage({
4655
+ storage: this.storage,
4656
+ senderKeys: await this.sealedSenderProvider(),
4657
+ sentMessageBase64: body.sentMessageBase64,
4658
+ recipientUserIds: body.recipientUserIds,
4659
+ encryptedMessageBase64: intent.groupCiphertext,
4660
+ ...(intent.contentHint !== undefined && { contentHint: intent.contentHint }),
4661
+ });
4662
+ }
4663
+ /**
4664
+ * Seal the ciphertext of a stored sealed body again with the current
4665
+ * sender certificate. The body keeps its authorization, its delivery mode,
4666
+ * and the hint in its seal. The certificate fetch waits when the current
4667
+ * certificate expires within `SEALED_SENDER_RESEAL_SKEW_MS`. Resolves to
4668
+ * undefined when no sealed-sender provider is configured.
4669
+ */
4670
+ async resealPreparedBody(msg, ciphertextBase64, messageType, recipientRegistrationId, body) {
4671
+ if (!this.sealedSenderProvider) {
4672
+ this.logger.warn('No sealed-sender provider can seal a stored body again', {
4673
+ category: 'E2EE',
4674
+ data: { recipientUserId: msg.recipientUserId, recipientDeviceId: msg.recipientDeviceId },
4675
+ });
4676
+ return undefined;
4677
+ }
4678
+ return {
4679
+ ...body,
4680
+ ...(await resealDirectSealedSenderMessage(this.storage, this.sealedSenderProvider, msg, ciphertextBase64, messageType, recipientRegistrationId, body.auth, body.sealHint)),
4681
+ };
4682
+ }
4683
+ /**
4684
+ * The one repeat of a sealed post after PERIOD_CLOSED, as a new seal of
4685
+ * its ciphertext. When no new seal can be made, no repeat starts, and the
4686
+ * PERIOD_CLOSED answer stays the answer of the post, so the send keeps the
4687
+ * device pending.
4688
+ */
4689
+ async repeatResealedAfterPeriodClosed(periodClosed, reseal, post) {
4690
+ let resealed;
4691
+ try {
4692
+ resealed = await reseal();
4693
+ }
4694
+ catch (error) {
4695
+ this.logger.warn('A sealed body could not be sealed again after PERIOD_CLOSED', {
4696
+ category: 'E2EE',
4697
+ data: { error: error instanceof Error ? error.message : String(error) },
4698
+ });
4699
+ throw periodClosed;
4700
+ }
4701
+ if (!resealed)
4702
+ throw periodClosed;
4703
+ return post(resealed);
4704
+ }
4609
4705
  /**
4610
4706
  * Send a single ciphertext to a device, optionally wrapping with sealed sender.
4611
4707
  *
@@ -4631,10 +4727,31 @@ export class SignalProtocolServiceCipher {
4631
4727
  // the gate of this post.
4632
4728
  const { beforeRequest, onRequest } = control;
4633
4729
  const ownRepeat = (repeat) => repeat.userId === msg.recipientUserId && repeat.deviceId === msg.recipientDeviceId;
4634
- const release = (beforeRequest || onRequest) && effectiveClientMessageId !== undefined
4635
- ? admitRequestsFor(this.signalProtocolRelay, effectiveClientMessageId, beforeRequest
4636
- ? (repeat) => (ownRepeat(repeat) ? beforeRequest() : Promise.resolve())
4637
- : async () => { }, onRequest &&
4730
+ // The certificate expiration of the sealed body that this post sends
4731
+ // now. Undefined while no sealed request runs, or when it is unknown.
4732
+ let sealedExpiry;
4733
+ // The gate refused the transport repeat after PERIOD_CLOSED, because the
4734
+ // certificate of its body expires before the repeat can reach the Relay.
4735
+ let expiringRepeatRefused = false;
4736
+ // This post sent its one sealed repeat after PERIOD_CLOSED.
4737
+ let periodClosedSpent = false;
4738
+ const release = effectiveClientMessageId !== undefined
4739
+ ? admitRequestsFor(this.signalProtocolRelay, effectiveClientMessageId, async (repeat) => {
4740
+ if (!ownRepeat(repeat))
4741
+ return;
4742
+ if (repeat.after === 'period-closed' && sealedExpiry !== undefined) {
4743
+ // The post repeats once after PERIOD_CLOSED, also when that
4744
+ // repeat is a new seal of the body.
4745
+ if (periodClosedSpent) {
4746
+ throw new Error('The post already repeated after PERIOD_CLOSED');
4747
+ }
4748
+ if (sealedBodyNeedsReseal(sealedExpiry, estimateServerTimestamp())) {
4749
+ expiringRepeatRefused = true;
4750
+ throw new Error('The sender certificate of the repeat expires before it can reach the Relay');
4751
+ }
4752
+ }
4753
+ await beforeRequest?.();
4754
+ }, onRequest &&
4638
4755
  ((repeat) => {
4639
4756
  if (ownRepeat(repeat))
4640
4757
  onRequest(repeat.after);
@@ -4656,16 +4773,27 @@ export class SignalProtocolServiceCipher {
4656
4773
  if ((sealedSender || preparedSealedSender) && this.signalProtocolRelay.sendMultiRecipientUnidentified) {
4657
4774
  // The sealed body names the registration of its device, as the
4658
4775
  // identified post does.
4659
- const prepared = preparedSealedSender ??
4776
+ let prepared = preparedSealedSender ??
4660
4777
  (sealedSender
4661
4778
  ? {
4662
4779
  sentMessageBase64: await this.serializeDirectSealedSenderMessage(msg, ciphertextBase64, messageType, recipientRegistrationId, sealedSender, contentHint),
4663
4780
  auth: sealedSender.auth,
4664
4781
  deliveryMode: sealedSender.config.deliveryMode === 'required' ? 'required' : 'preferred',
4782
+ certificateExpiresAt: senderCertificateExpiresAt(sealedSender.senderCertificateBase64),
4783
+ sealHint: contentHint,
4665
4784
  }
4666
4785
  : undefined);
4667
4786
  if (!prepared)
4668
4787
  throw new Error('Missing sealed-sender delivery state');
4788
+ // A replay can post a body that was sealed long ago. The receiver
4789
+ // checks the certificate against the time at which the Relay stores
4790
+ // the post, so a body whose certificate expires before the post
4791
+ // arrives is sealed again first. The new seal keeps the message ID and
4792
+ // the operation epoch of the post.
4793
+ if (sealedBodyNeedsReseal(prepared.certificateExpiresAt, estimateServerTimestamp())) {
4794
+ prepared =
4795
+ (await this.resealPreparedBody(msg, ciphertextBase64, messageType, recipientRegistrationId, prepared)) ?? prepared;
4796
+ }
4669
4797
  // This post has one destination device, so a group endorsement takes
4670
4798
  // the direct sealed route.
4671
4799
  const sealedAuth = prepared.auth.type === 'groupSendToken'
@@ -4684,12 +4812,36 @@ export class SignalProtocolServiceCipher {
4684
4812
  ...(control.onRequest && { onRequest: control.onRequest }),
4685
4813
  };
4686
4814
  const declaredDeviceIds = control.declaredDeviceIds;
4815
+ const postSealed = (sentMessageBase64, posting) => this.postToSignalProtocolRelay(() => declaredDeviceIds
4816
+ ? this.signalProtocolRelay.sendMultiRecipientUnidentified(sentMessageBase64, sealedAuth, msg.timestamp, control.deliveryClass ?? 'user-visible', [msg.recipientUserId], effectiveClientMessageId, control.operationEpochMilliseconds, undefined, [{ userId: msg.recipientUserId, deviceIds: declaredDeviceIds }])
4817
+ : this.signalProtocolRelay.sendMultiRecipientUnidentified(sentMessageBase64, sealedAuth, msg.timestamp, control.deliveryClass ?? 'user-visible', [msg.recipientUserId], effectiveClientMessageId, ...(control.operationEpochMilliseconds !== undefined
4818
+ ? [control.operationEpochMilliseconds]
4819
+ : [])), true, posting);
4820
+ const sealedBody = prepared;
4687
4821
  try {
4688
- const result = await this.postToSignalProtocolRelay(() => declaredDeviceIds
4689
- ? this.signalProtocolRelay.sendMultiRecipientUnidentified(prepared.sentMessageBase64, sealedAuth, msg.timestamp, control.deliveryClass ?? 'user-visible', [msg.recipientUserId], effectiveClientMessageId, control.operationEpochMilliseconds, undefined, [{ userId: msg.recipientUserId, deviceIds: declaredDeviceIds }])
4690
- : this.signalProtocolRelay.sendMultiRecipientUnidentified(prepared.sentMessageBase64, sealedAuth, msg.timestamp, control.deliveryClass ?? 'user-visible', [msg.recipientUserId], effectiveClientMessageId, ...(control.operationEpochMilliseconds !== undefined
4691
- ? [control.operationEpochMilliseconds]
4692
- : [])), true, control);
4822
+ let result;
4823
+ sealedExpiry = sealedBody.certificateExpiresAt;
4824
+ try {
4825
+ result = await postSealed(sealedBody.sentMessageBase64, control);
4826
+ }
4827
+ catch (error) {
4828
+ if (!expiringRepeatRefused || !isPeriodClosed(error))
4829
+ throw error;
4830
+ // The Relay stored nothing, and the certificate of the body
4831
+ // expires before a repeat can reach the Relay in the next period.
4832
+ // So the one repeat is a new seal of the same ciphertext.
4833
+ result = await this.repeatResealedAfterPeriodClosed(error, () => this.resealPreparedBody(msg, ciphertextBase64, messageType, recipientRegistrationId, sealedBody), (resealed) => {
4834
+ sealedExpiry = resealed.certificateExpiresAt;
4835
+ periodClosedSpent = true;
4836
+ return postSealed(resealed.sentMessageBase64, {
4837
+ ...identifiedControl,
4838
+ ...(onRequest && { onRequest: () => onRequest('period-closed') }),
4839
+ });
4840
+ });
4841
+ }
4842
+ finally {
4843
+ sealedExpiry = undefined;
4844
+ }
4693
4845
  if (result.uuids404.length > 0) {
4694
4846
  throw new SealedSenderRecipientRejectedError();
4695
4847
  }