@unwanted/matrix-sdk-mini 34.12.0-2 → 34.12.0-4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (492) hide show
  1. package/git-revision.txt +1 -1
  2. package/lib/@types/global.d.js +0 -2
  3. package/lib/@types/global.d.js.map +1 -1
  4. package/lib/browser-index.d.ts.map +1 -1
  5. package/lib/browser-index.js +0 -11
  6. package/lib/browser-index.js.map +1 -1
  7. package/lib/client.d.ts +2 -1221
  8. package/lib/client.d.ts.map +1 -1
  9. package/lib/client.js +331 -2821
  10. package/lib/client.js.map +1 -1
  11. package/lib/embedded.d.ts +0 -22
  12. package/lib/embedded.d.ts.map +1 -1
  13. package/lib/embedded.js +24 -166
  14. package/lib/embedded.js.map +1 -1
  15. package/lib/event-mapper.d.ts.map +1 -1
  16. package/lib/event-mapper.js +0 -4
  17. package/lib/event-mapper.js.map +1 -1
  18. package/lib/matrix.d.ts +0 -19
  19. package/lib/matrix.d.ts.map +1 -1
  20. package/lib/matrix.js +1 -26
  21. package/lib/matrix.js.map +1 -1
  22. package/lib/models/MSC3089Branch.d.ts.map +1 -1
  23. package/lib/models/MSC3089Branch.js +0 -3
  24. package/lib/models/MSC3089Branch.js.map +1 -1
  25. package/lib/models/event.d.ts +0 -94
  26. package/lib/models/event.d.ts.map +1 -1
  27. package/lib/models/event.js +0 -274
  28. package/lib/models/event.js.map +1 -1
  29. package/lib/models/poll.d.ts.map +1 -1
  30. package/lib/models/poll.js +1 -5
  31. package/lib/models/poll.js.map +1 -1
  32. package/lib/models/relations-container.d.ts.map +1 -1
  33. package/lib/models/relations-container.js +1 -7
  34. package/lib/models/relations-container.js.map +1 -1
  35. package/lib/models/relations.d.ts +0 -1
  36. package/lib/models/relations.d.ts.map +1 -1
  37. package/lib/models/relations.js +0 -8
  38. package/lib/models/relations.js.map +1 -1
  39. package/lib/models/room-state.d.ts.map +1 -1
  40. package/lib/models/room-state.js +10 -26
  41. package/lib/models/room-state.js.map +1 -1
  42. package/lib/models/room.d.ts +0 -18
  43. package/lib/models/room.d.ts.map +1 -1
  44. package/lib/models/room.js +94 -148
  45. package/lib/models/room.js.map +1 -1
  46. package/lib/models/thread.d.ts.map +1 -1
  47. package/lib/models/thread.js +0 -1
  48. package/lib/models/thread.js.map +1 -1
  49. package/lib/sliding-sync-sdk.d.ts +2 -3
  50. package/lib/sliding-sync-sdk.d.ts.map +1 -1
  51. package/lib/sliding-sync-sdk.js +41 -90
  52. package/lib/sliding-sync-sdk.js.map +1 -1
  53. package/lib/sync.d.ts +0 -12
  54. package/lib/sync.d.ts.map +1 -1
  55. package/lib/sync.js +1 -73
  56. package/lib/sync.js.map +1 -1
  57. package/lib/testing.d.ts +0 -48
  58. package/lib/testing.d.ts.map +1 -1
  59. package/lib/testing.js +0 -105
  60. package/lib/testing.js.map +1 -1
  61. package/lib/types.d.ts +0 -1
  62. package/lib/types.d.ts.map +1 -1
  63. package/lib/types.js.map +1 -1
  64. package/package.json +1 -3
  65. package/src/@types/global.d.ts +0 -3
  66. package/src/browser-index.ts +0 -11
  67. package/src/client.ts +60 -2882
  68. package/src/embedded.ts +3 -130
  69. package/src/event-mapper.ts +0 -4
  70. package/src/matrix.ts +0 -28
  71. package/src/models/MSC3089Branch.ts +0 -3
  72. package/src/models/event.ts +0 -289
  73. package/src/models/poll.ts +0 -6
  74. package/src/models/relations-container.ts +1 -8
  75. package/src/models/relations.ts +0 -8
  76. package/src/models/room-state.ts +2 -8
  77. package/src/models/room.ts +0 -62
  78. package/src/models/thread.ts +0 -1
  79. package/src/sliding-sync-sdk.ts +2 -72
  80. package/src/sync.ts +1 -98
  81. package/src/testing.ts +0 -108
  82. package/src/types.ts +0 -1
  83. package/CHANGELOG.md +0 -5910
  84. package/lib/@types/AESEncryptedSecretStoragePayload.d.ts +0 -14
  85. package/lib/@types/AESEncryptedSecretStoragePayload.d.ts.map +0 -1
  86. package/lib/@types/AESEncryptedSecretStoragePayload.js +0 -1
  87. package/lib/@types/AESEncryptedSecretStoragePayload.js.map +0 -1
  88. package/lib/@types/crypto.d.ts +0 -47
  89. package/lib/@types/crypto.d.ts.map +0 -1
  90. package/lib/@types/crypto.js +0 -1
  91. package/lib/@types/crypto.js.map +0 -1
  92. package/lib/@types/matrix-sdk-crypto-wasm.d.js +0 -1
  93. package/lib/@types/matrix-sdk-crypto-wasm.d.js.map +0 -1
  94. package/lib/common-crypto/CryptoBackend.d.ts +0 -240
  95. package/lib/common-crypto/CryptoBackend.d.ts.map +0 -1
  96. package/lib/common-crypto/CryptoBackend.js +0 -73
  97. package/lib/common-crypto/CryptoBackend.js.map +0 -1
  98. package/lib/common-crypto/key-passphrase.d.ts +0 -14
  99. package/lib/common-crypto/key-passphrase.d.ts.map +0 -1
  100. package/lib/common-crypto/key-passphrase.js +0 -33
  101. package/lib/common-crypto/key-passphrase.js.map +0 -1
  102. package/lib/crypto/CrossSigning.d.ts +0 -184
  103. package/lib/crypto/CrossSigning.d.ts.map +0 -1
  104. package/lib/crypto/CrossSigning.js +0 -718
  105. package/lib/crypto/CrossSigning.js.map +0 -1
  106. package/lib/crypto/DeviceList.d.ts +0 -216
  107. package/lib/crypto/DeviceList.d.ts.map +0 -1
  108. package/lib/crypto/DeviceList.js +0 -892
  109. package/lib/crypto/DeviceList.js.map +0 -1
  110. package/lib/crypto/EncryptionSetup.d.ts +0 -152
  111. package/lib/crypto/EncryptionSetup.d.ts.map +0 -1
  112. package/lib/crypto/EncryptionSetup.js +0 -356
  113. package/lib/crypto/EncryptionSetup.js.map +0 -1
  114. package/lib/crypto/OlmDevice.d.ts +0 -457
  115. package/lib/crypto/OlmDevice.d.ts.map +0 -1
  116. package/lib/crypto/OlmDevice.js +0 -1241
  117. package/lib/crypto/OlmDevice.js.map +0 -1
  118. package/lib/crypto/OutgoingRoomKeyRequestManager.d.ts +0 -109
  119. package/lib/crypto/OutgoingRoomKeyRequestManager.d.ts.map +0 -1
  120. package/lib/crypto/OutgoingRoomKeyRequestManager.js +0 -415
  121. package/lib/crypto/OutgoingRoomKeyRequestManager.js.map +0 -1
  122. package/lib/crypto/RoomList.d.ts +0 -26
  123. package/lib/crypto/RoomList.d.ts.map +0 -1
  124. package/lib/crypto/RoomList.js +0 -71
  125. package/lib/crypto/RoomList.js.map +0 -1
  126. package/lib/crypto/SecretSharing.d.ts +0 -24
  127. package/lib/crypto/SecretSharing.d.ts.map +0 -1
  128. package/lib/crypto/SecretSharing.js +0 -194
  129. package/lib/crypto/SecretSharing.js.map +0 -1
  130. package/lib/crypto/SecretStorage.d.ts +0 -55
  131. package/lib/crypto/SecretStorage.d.ts.map +0 -1
  132. package/lib/crypto/SecretStorage.js +0 -118
  133. package/lib/crypto/SecretStorage.js.map +0 -1
  134. package/lib/crypto/aes.d.ts +0 -6
  135. package/lib/crypto/aes.d.ts.map +0 -1
  136. package/lib/crypto/aes.js +0 -24
  137. package/lib/crypto/aes.js.map +0 -1
  138. package/lib/crypto/algorithms/base.d.ts +0 -156
  139. package/lib/crypto/algorithms/base.d.ts.map +0 -1
  140. package/lib/crypto/algorithms/base.js +0 -187
  141. package/lib/crypto/algorithms/base.js.map +0 -1
  142. package/lib/crypto/algorithms/index.d.ts +0 -4
  143. package/lib/crypto/algorithms/index.d.ts.map +0 -1
  144. package/lib/crypto/algorithms/index.js +0 -20
  145. package/lib/crypto/algorithms/index.js.map +0 -1
  146. package/lib/crypto/algorithms/megolm.d.ts +0 -385
  147. package/lib/crypto/algorithms/megolm.d.ts.map +0 -1
  148. package/lib/crypto/algorithms/megolm.js +0 -1822
  149. package/lib/crypto/algorithms/megolm.js.map +0 -1
  150. package/lib/crypto/algorithms/olm.d.ts +0 -5
  151. package/lib/crypto/algorithms/olm.d.ts.map +0 -1
  152. package/lib/crypto/algorithms/olm.js +0 -299
  153. package/lib/crypto/algorithms/olm.js.map +0 -1
  154. package/lib/crypto/api.d.ts +0 -32
  155. package/lib/crypto/api.d.ts.map +0 -1
  156. package/lib/crypto/api.js +0 -22
  157. package/lib/crypto/api.js.map +0 -1
  158. package/lib/crypto/backup.d.ts +0 -227
  159. package/lib/crypto/backup.d.ts.map +0 -1
  160. package/lib/crypto/backup.js +0 -824
  161. package/lib/crypto/backup.js.map +0 -1
  162. package/lib/crypto/crypto.d.ts +0 -3
  163. package/lib/crypto/crypto.d.ts.map +0 -1
  164. package/lib/crypto/crypto.js +0 -19
  165. package/lib/crypto/crypto.js.map +0 -1
  166. package/lib/crypto/dehydration.d.ts +0 -34
  167. package/lib/crypto/dehydration.d.ts.map +0 -1
  168. package/lib/crypto/dehydration.js +0 -252
  169. package/lib/crypto/dehydration.js.map +0 -1
  170. package/lib/crypto/device-converter.d.ts +0 -9
  171. package/lib/crypto/device-converter.d.ts.map +0 -1
  172. package/lib/crypto/device-converter.js +0 -42
  173. package/lib/crypto/device-converter.js.map +0 -1
  174. package/lib/crypto/deviceinfo.d.ts +0 -99
  175. package/lib/crypto/deviceinfo.d.ts.map +0 -1
  176. package/lib/crypto/deviceinfo.js +0 -148
  177. package/lib/crypto/deviceinfo.js.map +0 -1
  178. package/lib/crypto/index.d.ts +0 -1209
  179. package/lib/crypto/index.d.ts.map +0 -1
  180. package/lib/crypto/index.js +0 -4097
  181. package/lib/crypto/index.js.map +0 -1
  182. package/lib/crypto/key_passphrase.d.ts +0 -14
  183. package/lib/crypto/key_passphrase.d.ts.map +0 -1
  184. package/lib/crypto/key_passphrase.js +0 -44
  185. package/lib/crypto/key_passphrase.js.map +0 -1
  186. package/lib/crypto/keybackup.d.ts +0 -18
  187. package/lib/crypto/keybackup.d.ts.map +0 -1
  188. package/lib/crypto/keybackup.js +0 -1
  189. package/lib/crypto/keybackup.js.map +0 -1
  190. package/lib/crypto/olmlib.d.ts +0 -129
  191. package/lib/crypto/olmlib.d.ts.map +0 -1
  192. package/lib/crypto/olmlib.js +0 -492
  193. package/lib/crypto/olmlib.js.map +0 -1
  194. package/lib/crypto/recoverykey.d.ts +0 -2
  195. package/lib/crypto/recoverykey.d.ts.map +0 -1
  196. package/lib/crypto/recoverykey.js +0 -19
  197. package/lib/crypto/recoverykey.js.map +0 -1
  198. package/lib/crypto/store/base.d.ts +0 -252
  199. package/lib/crypto/store/base.d.ts.map +0 -1
  200. package/lib/crypto/store/base.js +0 -64
  201. package/lib/crypto/store/base.js.map +0 -1
  202. package/lib/crypto/store/indexeddb-crypto-store-backend.d.ts +0 -187
  203. package/lib/crypto/store/indexeddb-crypto-store-backend.d.ts.map +0 -1
  204. package/lib/crypto/store/indexeddb-crypto-store-backend.js +0 -1145
  205. package/lib/crypto/store/indexeddb-crypto-store-backend.js.map +0 -1
  206. package/lib/crypto/store/indexeddb-crypto-store.d.ts +0 -432
  207. package/lib/crypto/store/indexeddb-crypto-store.d.ts.map +0 -1
  208. package/lib/crypto/store/indexeddb-crypto-store.js +0 -728
  209. package/lib/crypto/store/indexeddb-crypto-store.js.map +0 -1
  210. package/lib/crypto/store/localStorage-crypto-store.d.ts +0 -119
  211. package/lib/crypto/store/localStorage-crypto-store.d.ts.map +0 -1
  212. package/lib/crypto/store/localStorage-crypto-store.js +0 -531
  213. package/lib/crypto/store/localStorage-crypto-store.js.map +0 -1
  214. package/lib/crypto/store/memory-crypto-store.d.ts +0 -215
  215. package/lib/crypto/store/memory-crypto-store.d.ts.map +0 -1
  216. package/lib/crypto/store/memory-crypto-store.js +0 -622
  217. package/lib/crypto/store/memory-crypto-store.js.map +0 -1
  218. package/lib/crypto/verification/Base.d.ts +0 -105
  219. package/lib/crypto/verification/Base.d.ts.map +0 -1
  220. package/lib/crypto/verification/Base.js +0 -372
  221. package/lib/crypto/verification/Base.js.map +0 -1
  222. package/lib/crypto/verification/Error.d.ts +0 -35
  223. package/lib/crypto/verification/Error.d.ts.map +0 -1
  224. package/lib/crypto/verification/Error.js +0 -86
  225. package/lib/crypto/verification/Error.js.map +0 -1
  226. package/lib/crypto/verification/IllegalMethod.d.ts +0 -15
  227. package/lib/crypto/verification/IllegalMethod.d.ts.map +0 -1
  228. package/lib/crypto/verification/IllegalMethod.js +0 -43
  229. package/lib/crypto/verification/IllegalMethod.js.map +0 -1
  230. package/lib/crypto/verification/QRCode.d.ts +0 -51
  231. package/lib/crypto/verification/QRCode.d.ts.map +0 -1
  232. package/lib/crypto/verification/QRCode.js +0 -277
  233. package/lib/crypto/verification/QRCode.js.map +0 -1
  234. package/lib/crypto/verification/SAS.d.ts +0 -27
  235. package/lib/crypto/verification/SAS.d.ts.map +0 -1
  236. package/lib/crypto/verification/SAS.js +0 -485
  237. package/lib/crypto/verification/SAS.js.map +0 -1
  238. package/lib/crypto/verification/SASDecimal.d.ts +0 -8
  239. package/lib/crypto/verification/SASDecimal.d.ts.map +0 -1
  240. package/lib/crypto/verification/SASDecimal.js +0 -34
  241. package/lib/crypto/verification/SASDecimal.js.map +0 -1
  242. package/lib/crypto/verification/request/Channel.d.ts +0 -18
  243. package/lib/crypto/verification/request/Channel.d.ts.map +0 -1
  244. package/lib/crypto/verification/request/Channel.js +0 -1
  245. package/lib/crypto/verification/request/Channel.js.map +0 -1
  246. package/lib/crypto/verification/request/InRoomChannel.d.ts +0 -113
  247. package/lib/crypto/verification/request/InRoomChannel.d.ts.map +0 -1
  248. package/lib/crypto/verification/request/InRoomChannel.js +0 -351
  249. package/lib/crypto/verification/request/InRoomChannel.js.map +0 -1
  250. package/lib/crypto/verification/request/ToDeviceChannel.d.ts +0 -105
  251. package/lib/crypto/verification/request/ToDeviceChannel.d.ts.map +0 -1
  252. package/lib/crypto/verification/request/ToDeviceChannel.js +0 -328
  253. package/lib/crypto/verification/request/ToDeviceChannel.js.map +0 -1
  254. package/lib/crypto/verification/request/VerificationRequest.d.ts +0 -227
  255. package/lib/crypto/verification/request/VerificationRequest.d.ts.map +0 -1
  256. package/lib/crypto/verification/request/VerificationRequest.js +0 -937
  257. package/lib/crypto/verification/request/VerificationRequest.js.map +0 -1
  258. package/lib/crypto-api/CryptoEvent.d.ts +0 -69
  259. package/lib/crypto-api/CryptoEvent.d.ts.map +0 -1
  260. package/lib/crypto-api/CryptoEvent.js +0 -33
  261. package/lib/crypto-api/CryptoEvent.js.map +0 -1
  262. package/lib/crypto-api/CryptoEventHandlerMap.d.ts +0 -16
  263. package/lib/crypto-api/CryptoEventHandlerMap.d.ts.map +0 -1
  264. package/lib/crypto-api/CryptoEventHandlerMap.js +0 -22
  265. package/lib/crypto-api/CryptoEventHandlerMap.js.map +0 -1
  266. package/lib/crypto-api/index.d.ts +0 -978
  267. package/lib/crypto-api/index.d.ts.map +0 -1
  268. package/lib/crypto-api/index.js +0 -304
  269. package/lib/crypto-api/index.js.map +0 -1
  270. package/lib/crypto-api/key-passphrase.d.ts +0 -11
  271. package/lib/crypto-api/key-passphrase.d.ts.map +0 -1
  272. package/lib/crypto-api/key-passphrase.js +0 -51
  273. package/lib/crypto-api/key-passphrase.js.map +0 -1
  274. package/lib/crypto-api/keybackup.d.ts +0 -88
  275. package/lib/crypto-api/keybackup.d.ts.map +0 -1
  276. package/lib/crypto-api/keybackup.js +0 -1
  277. package/lib/crypto-api/keybackup.js.map +0 -1
  278. package/lib/crypto-api/recovery-key.d.ts +0 -11
  279. package/lib/crypto-api/recovery-key.d.ts.map +0 -1
  280. package/lib/crypto-api/recovery-key.js +0 -65
  281. package/lib/crypto-api/recovery-key.js.map +0 -1
  282. package/lib/crypto-api/verification.d.ts +0 -344
  283. package/lib/crypto-api/verification.d.ts.map +0 -1
  284. package/lib/crypto-api/verification.js +0 -91
  285. package/lib/crypto-api/verification.js.map +0 -1
  286. package/lib/rendezvous/MSC4108SignInWithQR.d.ts +0 -112
  287. package/lib/rendezvous/MSC4108SignInWithQR.d.ts.map +0 -1
  288. package/lib/rendezvous/MSC4108SignInWithQR.js +0 -392
  289. package/lib/rendezvous/MSC4108SignInWithQR.js.map +0 -1
  290. package/lib/rendezvous/RendezvousChannel.d.ts +0 -27
  291. package/lib/rendezvous/RendezvousChannel.d.ts.map +0 -1
  292. package/lib/rendezvous/RendezvousChannel.js +0 -1
  293. package/lib/rendezvous/RendezvousChannel.js.map +0 -1
  294. package/lib/rendezvous/RendezvousCode.d.ts +0 -9
  295. package/lib/rendezvous/RendezvousCode.d.ts.map +0 -1
  296. package/lib/rendezvous/RendezvousCode.js +0 -1
  297. package/lib/rendezvous/RendezvousCode.js.map +0 -1
  298. package/lib/rendezvous/RendezvousError.d.ts +0 -6
  299. package/lib/rendezvous/RendezvousError.d.ts.map +0 -1
  300. package/lib/rendezvous/RendezvousError.js +0 -23
  301. package/lib/rendezvous/RendezvousError.js.map +0 -1
  302. package/lib/rendezvous/RendezvousFailureReason.d.ts +0 -31
  303. package/lib/rendezvous/RendezvousFailureReason.d.ts.map +0 -1
  304. package/lib/rendezvous/RendezvousFailureReason.js +0 -38
  305. package/lib/rendezvous/RendezvousFailureReason.js.map +0 -1
  306. package/lib/rendezvous/RendezvousIntent.d.ts +0 -5
  307. package/lib/rendezvous/RendezvousIntent.d.ts.map +0 -1
  308. package/lib/rendezvous/RendezvousIntent.js +0 -22
  309. package/lib/rendezvous/RendezvousIntent.js.map +0 -1
  310. package/lib/rendezvous/RendezvousTransport.d.ts +0 -36
  311. package/lib/rendezvous/RendezvousTransport.d.ts.map +0 -1
  312. package/lib/rendezvous/RendezvousTransport.js +0 -1
  313. package/lib/rendezvous/RendezvousTransport.js.map +0 -1
  314. package/lib/rendezvous/channels/MSC4108SecureChannel.d.ts +0 -58
  315. package/lib/rendezvous/channels/MSC4108SecureChannel.d.ts.map +0 -1
  316. package/lib/rendezvous/channels/MSC4108SecureChannel.js +0 -246
  317. package/lib/rendezvous/channels/MSC4108SecureChannel.js.map +0 -1
  318. package/lib/rendezvous/channels/index.d.ts +0 -2
  319. package/lib/rendezvous/channels/index.d.ts.map +0 -1
  320. package/lib/rendezvous/channels/index.js +0 -18
  321. package/lib/rendezvous/channels/index.js.map +0 -1
  322. package/lib/rendezvous/index.d.ts +0 -10
  323. package/lib/rendezvous/index.d.ts.map +0 -1
  324. package/lib/rendezvous/index.js +0 -23
  325. package/lib/rendezvous/index.js.map +0 -1
  326. package/lib/rendezvous/transports/MSC4108RendezvousSession.d.ts +0 -61
  327. package/lib/rendezvous/transports/MSC4108RendezvousSession.d.ts.map +0 -1
  328. package/lib/rendezvous/transports/MSC4108RendezvousSession.js +0 -253
  329. package/lib/rendezvous/transports/MSC4108RendezvousSession.js.map +0 -1
  330. package/lib/rendezvous/transports/index.d.ts +0 -2
  331. package/lib/rendezvous/transports/index.d.ts.map +0 -1
  332. package/lib/rendezvous/transports/index.js +0 -18
  333. package/lib/rendezvous/transports/index.js.map +0 -1
  334. package/lib/rust-crypto/CrossSigningIdentity.d.ts +0 -33
  335. package/lib/rust-crypto/CrossSigningIdentity.d.ts.map +0 -1
  336. package/lib/rust-crypto/CrossSigningIdentity.js +0 -157
  337. package/lib/rust-crypto/CrossSigningIdentity.js.map +0 -1
  338. package/lib/rust-crypto/DehydratedDeviceManager.d.ts +0 -98
  339. package/lib/rust-crypto/DehydratedDeviceManager.d.ts.map +0 -1
  340. package/lib/rust-crypto/DehydratedDeviceManager.js +0 -285
  341. package/lib/rust-crypto/DehydratedDeviceManager.js.map +0 -1
  342. package/lib/rust-crypto/KeyClaimManager.d.ts +0 -33
  343. package/lib/rust-crypto/KeyClaimManager.d.ts.map +0 -1
  344. package/lib/rust-crypto/KeyClaimManager.js +0 -82
  345. package/lib/rust-crypto/KeyClaimManager.js.map +0 -1
  346. package/lib/rust-crypto/OutgoingRequestProcessor.d.ts +0 -43
  347. package/lib/rust-crypto/OutgoingRequestProcessor.d.ts.map +0 -1
  348. package/lib/rust-crypto/OutgoingRequestProcessor.js +0 -195
  349. package/lib/rust-crypto/OutgoingRequestProcessor.js.map +0 -1
  350. package/lib/rust-crypto/OutgoingRequestsManager.d.ts +0 -47
  351. package/lib/rust-crypto/OutgoingRequestsManager.d.ts.map +0 -1
  352. package/lib/rust-crypto/OutgoingRequestsManager.js +0 -148
  353. package/lib/rust-crypto/OutgoingRequestsManager.js.map +0 -1
  354. package/lib/rust-crypto/PerSessionKeyBackupDownloader.d.ts +0 -120
  355. package/lib/rust-crypto/PerSessionKeyBackupDownloader.d.ts.map +0 -1
  356. package/lib/rust-crypto/PerSessionKeyBackupDownloader.js +0 -467
  357. package/lib/rust-crypto/PerSessionKeyBackupDownloader.js.map +0 -1
  358. package/lib/rust-crypto/RoomEncryptor.d.ts +0 -98
  359. package/lib/rust-crypto/RoomEncryptor.d.ts.map +0 -1
  360. package/lib/rust-crypto/RoomEncryptor.js +0 -299
  361. package/lib/rust-crypto/RoomEncryptor.js.map +0 -1
  362. package/lib/rust-crypto/backup.d.ts +0 -254
  363. package/lib/rust-crypto/backup.d.ts.map +0 -1
  364. package/lib/rust-crypto/backup.js +0 -837
  365. package/lib/rust-crypto/backup.js.map +0 -1
  366. package/lib/rust-crypto/constants.d.ts +0 -3
  367. package/lib/rust-crypto/constants.d.ts.map +0 -1
  368. package/lib/rust-crypto/constants.js +0 -19
  369. package/lib/rust-crypto/constants.js.map +0 -1
  370. package/lib/rust-crypto/device-converter.d.ts +0 -28
  371. package/lib/rust-crypto/device-converter.d.ts.map +0 -1
  372. package/lib/rust-crypto/device-converter.js +0 -123
  373. package/lib/rust-crypto/device-converter.js.map +0 -1
  374. package/lib/rust-crypto/index.d.ts +0 -61
  375. package/lib/rust-crypto/index.d.ts.map +0 -1
  376. package/lib/rust-crypto/index.js +0 -152
  377. package/lib/rust-crypto/index.js.map +0 -1
  378. package/lib/rust-crypto/libolm_migration.d.ts +0 -81
  379. package/lib/rust-crypto/libolm_migration.d.ts.map +0 -1
  380. package/lib/rust-crypto/libolm_migration.js +0 -459
  381. package/lib/rust-crypto/libolm_migration.js.map +0 -1
  382. package/lib/rust-crypto/rust-crypto.d.ts +0 -556
  383. package/lib/rust-crypto/rust-crypto.d.ts.map +0 -1
  384. package/lib/rust-crypto/rust-crypto.js +0 -2016
  385. package/lib/rust-crypto/rust-crypto.js.map +0 -1
  386. package/lib/rust-crypto/secret-storage.d.ts +0 -22
  387. package/lib/rust-crypto/secret-storage.d.ts.map +0 -1
  388. package/lib/rust-crypto/secret-storage.js +0 -63
  389. package/lib/rust-crypto/secret-storage.js.map +0 -1
  390. package/lib/rust-crypto/verification.d.ts +0 -319
  391. package/lib/rust-crypto/verification.d.ts.map +0 -1
  392. package/lib/rust-crypto/verification.js +0 -816
  393. package/lib/rust-crypto/verification.js.map +0 -1
  394. package/lib/secret-storage.d.ts +0 -370
  395. package/lib/secret-storage.d.ts.map +0 -1
  396. package/lib/secret-storage.js +0 -466
  397. package/lib/secret-storage.js.map +0 -1
  398. package/lib/utils/decryptAESSecretStorageItem.d.ts +0 -12
  399. package/lib/utils/decryptAESSecretStorageItem.d.ts.map +0 -1
  400. package/lib/utils/decryptAESSecretStorageItem.js +0 -50
  401. package/lib/utils/decryptAESSecretStorageItem.js.map +0 -1
  402. package/lib/utils/encryptAESSecretStorageItem.d.ts +0 -16
  403. package/lib/utils/encryptAESSecretStorageItem.d.ts.map +0 -1
  404. package/lib/utils/encryptAESSecretStorageItem.js +0 -68
  405. package/lib/utils/encryptAESSecretStorageItem.js.map +0 -1
  406. package/lib/utils/internal/deriveKeys.d.ts +0 -10
  407. package/lib/utils/internal/deriveKeys.d.ts.map +0 -1
  408. package/lib/utils/internal/deriveKeys.js +0 -60
  409. package/lib/utils/internal/deriveKeys.js.map +0 -1
  410. package/src/@types/AESEncryptedSecretStoragePayload.ts +0 -29
  411. package/src/@types/crypto.ts +0 -73
  412. package/src/@types/matrix-sdk-crypto-wasm.d.ts +0 -44
  413. package/src/common-crypto/CryptoBackend.ts +0 -302
  414. package/src/common-crypto/README.md +0 -4
  415. package/src/common-crypto/key-passphrase.ts +0 -43
  416. package/src/crypto/CrossSigning.ts +0 -773
  417. package/src/crypto/DeviceList.ts +0 -989
  418. package/src/crypto/EncryptionSetup.ts +0 -351
  419. package/src/crypto/OlmDevice.ts +0 -1500
  420. package/src/crypto/OutgoingRoomKeyRequestManager.ts +0 -485
  421. package/src/crypto/RoomList.ts +0 -70
  422. package/src/crypto/SecretSharing.ts +0 -240
  423. package/src/crypto/SecretStorage.ts +0 -136
  424. package/src/crypto/aes.ts +0 -23
  425. package/src/crypto/algorithms/base.ts +0 -236
  426. package/src/crypto/algorithms/index.ts +0 -20
  427. package/src/crypto/algorithms/megolm.ts +0 -2216
  428. package/src/crypto/algorithms/olm.ts +0 -381
  429. package/src/crypto/api.ts +0 -70
  430. package/src/crypto/backup.ts +0 -922
  431. package/src/crypto/crypto.ts +0 -18
  432. package/src/crypto/dehydration.ts +0 -272
  433. package/src/crypto/device-converter.ts +0 -45
  434. package/src/crypto/deviceinfo.ts +0 -158
  435. package/src/crypto/index.ts +0 -4414
  436. package/src/crypto/key_passphrase.ts +0 -42
  437. package/src/crypto/keybackup.ts +0 -47
  438. package/src/crypto/olmlib.ts +0 -539
  439. package/src/crypto/recoverykey.ts +0 -18
  440. package/src/crypto/store/base.ts +0 -348
  441. package/src/crypto/store/indexeddb-crypto-store-backend.ts +0 -1250
  442. package/src/crypto/store/indexeddb-crypto-store.ts +0 -845
  443. package/src/crypto/store/localStorage-crypto-store.ts +0 -579
  444. package/src/crypto/store/memory-crypto-store.ts +0 -680
  445. package/src/crypto/verification/Base.ts +0 -409
  446. package/src/crypto/verification/Error.ts +0 -76
  447. package/src/crypto/verification/IllegalMethod.ts +0 -50
  448. package/src/crypto/verification/QRCode.ts +0 -310
  449. package/src/crypto/verification/SAS.ts +0 -494
  450. package/src/crypto/verification/SASDecimal.ts +0 -37
  451. package/src/crypto/verification/request/Channel.ts +0 -34
  452. package/src/crypto/verification/request/InRoomChannel.ts +0 -371
  453. package/src/crypto/verification/request/ToDeviceChannel.ts +0 -354
  454. package/src/crypto/verification/request/VerificationRequest.ts +0 -976
  455. package/src/crypto-api/CryptoEvent.ts +0 -93
  456. package/src/crypto-api/CryptoEventHandlerMap.ts +0 -32
  457. package/src/crypto-api/index.ts +0 -1175
  458. package/src/crypto-api/key-passphrase.ts +0 -58
  459. package/src/crypto-api/keybackup.ts +0 -115
  460. package/src/crypto-api/recovery-key.ts +0 -69
  461. package/src/crypto-api/verification.ts +0 -408
  462. package/src/rendezvous/MSC4108SignInWithQR.ts +0 -444
  463. package/src/rendezvous/RendezvousChannel.ts +0 -48
  464. package/src/rendezvous/RendezvousCode.ts +0 -25
  465. package/src/rendezvous/RendezvousError.ts +0 -26
  466. package/src/rendezvous/RendezvousFailureReason.ts +0 -49
  467. package/src/rendezvous/RendezvousIntent.ts +0 -20
  468. package/src/rendezvous/RendezvousTransport.ts +0 -58
  469. package/src/rendezvous/channels/MSC4108SecureChannel.ts +0 -270
  470. package/src/rendezvous/channels/index.ts +0 -17
  471. package/src/rendezvous/index.ts +0 -25
  472. package/src/rendezvous/transports/MSC4108RendezvousSession.ts +0 -270
  473. package/src/rendezvous/transports/index.ts +0 -17
  474. package/src/rust-crypto/CrossSigningIdentity.ts +0 -183
  475. package/src/rust-crypto/DehydratedDeviceManager.ts +0 -306
  476. package/src/rust-crypto/KeyClaimManager.ts +0 -86
  477. package/src/rust-crypto/OutgoingRequestProcessor.ts +0 -236
  478. package/src/rust-crypto/OutgoingRequestsManager.ts +0 -143
  479. package/src/rust-crypto/PerSessionKeyBackupDownloader.ts +0 -501
  480. package/src/rust-crypto/RoomEncryptor.ts +0 -352
  481. package/src/rust-crypto/backup.ts +0 -881
  482. package/src/rust-crypto/constants.ts +0 -18
  483. package/src/rust-crypto/device-converter.ts +0 -128
  484. package/src/rust-crypto/index.ts +0 -237
  485. package/src/rust-crypto/libolm_migration.ts +0 -530
  486. package/src/rust-crypto/rust-crypto.ts +0 -2205
  487. package/src/rust-crypto/secret-storage.ts +0 -60
  488. package/src/rust-crypto/verification.ts +0 -830
  489. package/src/secret-storage.ts +0 -693
  490. package/src/utils/decryptAESSecretStorageItem.ts +0 -54
  491. package/src/utils/encryptAESSecretStorageItem.ts +0 -73
  492. package/src/utils/internal/deriveKeys.ts +0 -63
@@ -1 +0,0 @@
1
- {"version":3,"file":"DeviceList.js","names":["logger","DeviceInfo","CrossSigningInfo","olmlib","IndexedDBCryptoStore","chunkPromises","defer","sleep","TypedEventEmitter","CryptoEvent","TrackingStatus","DeviceList","constructor","baseApis","cryptoStore","olmDevice","keyDownloadChunkSize","arguments","length","undefined","_defineProperty","Map","serialiser","DeviceListUpdateSerialiser","load","_this","_asyncToGenerator","doTxn","STORE_DEVICE_DATA","txn","getEndToEndDeviceData","deviceData","_deviceData$syncToken","hasFetched","Boolean","devices","crossSigningInfo","deviceTrackingStatus","trackingStatus","syncToken","userByIdentityKey","user","Object","keys","userDevices","device","idKey","u","DownloadInProgress","PendingDownload","stop","saveTimer","clearTimeout","saveIfDirty","_arguments","_this2","delay","dirty","Promise","resolve","targetTime","Date","now","savePromiseTime","savePromise","resolveSavePromise","setTimeout","log","_this2$syncToken","storeEndToEndDeviceData","then","err","error","getSyncToken","setSyncToken","st","downloadKeys","userIds","forceDownload","usersToDownload","promises","forEach","keyDownloadsInProgressByUser","has","concat","push","get","UpToDate","downloadPromise","doKeyDownload","all","getDevicesFromStore","stored","userId","_this$getStoredDevice","deviceMap","getStoredDevicesForUser","set","deviceId","getKnownUserIds","devs","res","hasOwnProperty","fromStorage","getRawStoredDevicesForUser","getStoredCrossSigningForUser","storeCrossSigningForUser","info","getStoredDevice","getUserByIdentityKey","algorithm","senderKey","OLM_ALGORITHM","MEGOLM_ALGORITHM","getDeviceByIdentityKey","keyId","indexOf","deviceKey","storeDevicesForUser","setRawStoredDevicesForUser","startTrackingDeviceList","Error","stopTrackingDeviceList","NotTracked","stopTrackingAllDeviceLists","invalidateUserDeviceList","refreshOutdatedDeviceLists","stat","dev","entries","identityKey","setRawStoredCrossSigningForUser","users","prom","updateDevicesForUsers","finished","e","success","emit","WillUpdateDevices","delete","DevicesUpdated","deviceList","keyDownloadsQueuedByUser","queuedQueryDeferred","downloadInProgress","promise","doQueuedQueries","_this3","downloadUsers","deferred","opts","token","factories","_loop","userSlice","slice","i","downloadKeysForUsers","_ref","responses","dk","assign","map","device_keys","masterKeys","master_keys","ssks","self_signing_keys","usks","user_signing_keys","processQueryResponseForUser","master","self_signing","user_signing","_x","apply","warn","reject","dkResponse","crossSigningResponse","_this4","userStore","d","updateStoredDeviceKeysForUser","getUserId","storage","toStorage","crossSigning","setKeys","UserCrossSigningUpdated","_x2","_x3","_x4","_x5","_x6","_x7","_updateStoredDeviceKeysForUser","userResult","localUserId","localDeviceId","updated","deviceResult","user_id","device_id","storeDeviceKeys","_x8","_x9","_x10","_storeDeviceKeys","signKeyId","signKey","unsigned","signatures","verifySignature","deviceStore","getFingerprint","algorithms"],"sources":["../../src/crypto/DeviceList.ts"],"sourcesContent":["/*\nCopyright 2017 - 2021 The Matrix.org Foundation C.I.C.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n/**\n * Manages the list of other users' devices\n */\n\nimport { logger } from \"../logger.ts\";\nimport { DeviceInfo, IDevice } from \"./deviceinfo.ts\";\nimport { CrossSigningInfo, ICrossSigningInfo } from \"./CrossSigning.ts\";\nimport * as olmlib from \"./olmlib.ts\";\nimport { IndexedDBCryptoStore } from \"./store/indexeddb-crypto-store.ts\";\nimport { chunkPromises, defer, IDeferred, sleep } from \"../utils.ts\";\nimport { DeviceKeys, IDownloadKeyResult, Keys, MatrixClient, SigningKeys } from \"../client.ts\";\nimport { OlmDevice } from \"./OlmDevice.ts\";\nimport { CryptoStore } from \"./store/base.ts\";\nimport { TypedEventEmitter } from \"../models/typed-event-emitter.ts\";\nimport { CryptoEvent, CryptoEventHandlerMap } from \"./index.ts\";\n\n/* State transition diagram for DeviceList.deviceTrackingStatus\n *\n * |\n * stopTrackingDeviceList V\n * +---------------------> NOT_TRACKED\n * | |\n * +<--------------------+ | startTrackingDeviceList\n * | | V\n * | +-------------> PENDING_DOWNLOAD <--------------------+-+\n * | | ^ | | |\n * | | restart download | | start download | | invalidateUserDeviceList\n * | | client failed | | | |\n * | | | V | |\n * | +------------ DOWNLOAD_IN_PROGRESS -------------------+ |\n * | | | |\n * +<-------------------+ | download successful |\n * ^ V |\n * +----------------------- UP_TO_DATE ------------------------+\n */\n\n// constants for DeviceList.deviceTrackingStatus\nexport enum TrackingStatus {\n NotTracked,\n PendingDownload,\n DownloadInProgress,\n UpToDate,\n}\n\n// user-Id → device-Id → DeviceInfo\nexport type DeviceInfoMap = Map<string, Map<string, DeviceInfo>>;\n\ntype EmittedEvents = CryptoEvent.WillUpdateDevices | CryptoEvent.DevicesUpdated | CryptoEvent.UserCrossSigningUpdated;\n\nexport class DeviceList extends TypedEventEmitter<EmittedEvents, CryptoEventHandlerMap> {\n private devices: { [userId: string]: { [deviceId: string]: IDevice } } = {};\n\n public crossSigningInfo: { [userId: string]: ICrossSigningInfo } = {};\n\n // map of identity keys to the user who owns it\n private userByIdentityKey: Record<string, string> = {};\n\n // which users we are tracking device status for.\n private deviceTrackingStatus: { [userId: string]: TrackingStatus } = {}; // loaded from storage in load()\n\n // The 'next_batch' sync token at the point the data was written,\n // ie. a token representing the point immediately after the\n // moment represented by the snapshot in the db.\n private syncToken: string | null = null;\n\n private keyDownloadsInProgressByUser = new Map<string, Promise<void>>();\n\n // Set whenever changes are made other than setting the sync token\n private dirty = false;\n\n // Promise resolved when device data is saved\n private savePromise: Promise<boolean> | null = null;\n // Function that resolves the save promise\n private resolveSavePromise: ((saved: boolean) => void) | null = null;\n // The time the save is scheduled for\n private savePromiseTime: number | null = null;\n // The timer used to delay the save\n private saveTimer: ReturnType<typeof setTimeout> | null = null;\n // True if we have fetched data from the server or loaded a non-empty\n // set of device data from the store\n private hasFetched: boolean | null = null;\n\n private readonly serialiser: DeviceListUpdateSerialiser;\n\n public constructor(\n baseApis: MatrixClient,\n private readonly cryptoStore: CryptoStore,\n olmDevice: OlmDevice,\n // Maximum number of user IDs per request to prevent server overload (#1619)\n public readonly keyDownloadChunkSize = 250,\n ) {\n super();\n\n this.serialiser = new DeviceListUpdateSerialiser(baseApis, olmDevice, this);\n }\n\n /**\n * Load the device tracking state from storage\n */\n public async load(): Promise<void> {\n await this.cryptoStore.doTxn(\"readonly\", [IndexedDBCryptoStore.STORE_DEVICE_DATA], (txn) => {\n this.cryptoStore.getEndToEndDeviceData(txn, (deviceData) => {\n this.hasFetched = Boolean(deviceData?.devices);\n this.devices = deviceData ? deviceData.devices : {};\n this.crossSigningInfo = deviceData ? deviceData.crossSigningInfo || {} : {};\n this.deviceTrackingStatus = deviceData ? deviceData.trackingStatus : {};\n this.syncToken = deviceData?.syncToken ?? null;\n this.userByIdentityKey = {};\n for (const user of Object.keys(this.devices)) {\n const userDevices = this.devices[user];\n for (const device of Object.keys(userDevices)) {\n const idKey = userDevices[device].keys[\"curve25519:\" + device];\n if (idKey !== undefined) {\n this.userByIdentityKey[idKey] = user;\n }\n }\n }\n });\n });\n\n for (const u of Object.keys(this.deviceTrackingStatus)) {\n // if a download was in progress when we got shut down, it isn't any more.\n if (this.deviceTrackingStatus[u] == TrackingStatus.DownloadInProgress) {\n this.deviceTrackingStatus[u] = TrackingStatus.PendingDownload;\n }\n }\n }\n\n public stop(): void {\n if (this.saveTimer !== null) {\n clearTimeout(this.saveTimer);\n }\n }\n\n /**\n * Save the device tracking state to storage, if any changes are\n * pending other than updating the sync token\n *\n * The actual save will be delayed by a short amount of time to\n * aggregate multiple writes to the database.\n *\n * @param delay - Time in ms before which the save actually happens.\n * By default, the save is delayed for a short period in order to batch\n * multiple writes, but this behaviour can be disabled by passing 0.\n *\n * @returns true if the data was saved, false if\n * it was not (eg. because no changes were pending). The promise\n * will only resolve once the data is saved, so may take some time\n * to resolve.\n */\n public async saveIfDirty(delay = 500): Promise<boolean> {\n if (!this.dirty) return Promise.resolve(false);\n // Delay saves for a bit so we can aggregate multiple saves that happen\n // in quick succession (eg. when a whole room's devices are marked as known)\n\n const targetTime = Date.now() + delay;\n if (this.savePromiseTime && targetTime < this.savePromiseTime) {\n // There's a save scheduled but for after we would like: cancel\n // it & schedule one for the time we want\n clearTimeout(this.saveTimer!);\n this.saveTimer = null;\n this.savePromiseTime = null;\n // (but keep the save promise since whatever called save before\n // will still want to know when the save is done)\n }\n\n let savePromise = this.savePromise;\n if (savePromise === null) {\n savePromise = new Promise((resolve) => {\n this.resolveSavePromise = resolve;\n });\n this.savePromise = savePromise;\n }\n\n if (this.saveTimer === null) {\n const resolveSavePromise = this.resolveSavePromise;\n this.savePromiseTime = targetTime;\n this.saveTimer = setTimeout(() => {\n logger.log(\"Saving device tracking data\", this.syncToken);\n\n // null out savePromise now (after the delay but before the write),\n // otherwise we could return the existing promise when the save has\n // actually already happened.\n this.savePromiseTime = null;\n this.saveTimer = null;\n this.savePromise = null;\n this.resolveSavePromise = null;\n\n this.cryptoStore\n .doTxn(\"readwrite\", [IndexedDBCryptoStore.STORE_DEVICE_DATA], (txn) => {\n this.cryptoStore.storeEndToEndDeviceData(\n {\n devices: this.devices,\n crossSigningInfo: this.crossSigningInfo,\n trackingStatus: this.deviceTrackingStatus,\n syncToken: this.syncToken ?? undefined,\n },\n txn,\n );\n })\n .then(\n () => {\n // The device list is considered dirty until the write completes.\n this.dirty = false;\n resolveSavePromise?.(true);\n },\n (err) => {\n logger.error(\"Failed to save device tracking data\", this.syncToken);\n logger.error(err);\n },\n );\n }, delay);\n }\n\n return savePromise;\n }\n\n /**\n * Gets the sync token last set with setSyncToken\n *\n * @returns The sync token\n */\n public getSyncToken(): string | null {\n return this.syncToken;\n }\n\n /**\n * Sets the sync token that the app will pass as the 'since' to the /sync\n * endpoint next time it syncs.\n * The sync token must always be set after any changes made as a result of\n * data in that sync since setting the sync token to a newer one will mean\n * those changed will not be synced from the server if a new client starts\n * up with that data.\n *\n * @param st - The sync token\n */\n public setSyncToken(st: string | null): void {\n this.syncToken = st;\n }\n\n /**\n * Ensures up to date keys for a list of users are stored in the session store,\n * downloading and storing them if they're not (or if forceDownload is\n * true).\n * @param userIds - The users to fetch.\n * @param forceDownload - Always download the keys even if cached.\n *\n * @returns A promise which resolves to a map userId-\\>deviceId-\\>{@link DeviceInfo}.\n */\n public downloadKeys(userIds: string[], forceDownload: boolean): Promise<DeviceInfoMap> {\n const usersToDownload: string[] = [];\n const promises: Promise<unknown>[] = [];\n\n userIds.forEach((u) => {\n const trackingStatus = this.deviceTrackingStatus[u];\n if (this.keyDownloadsInProgressByUser.has(u)) {\n // already a key download in progress/queued for this user; its results\n // will be good enough for us.\n logger.log(`downloadKeys: already have a download in progress for ` + `${u}: awaiting its result`);\n promises.push(this.keyDownloadsInProgressByUser.get(u)!);\n } else if (forceDownload || trackingStatus != TrackingStatus.UpToDate) {\n usersToDownload.push(u);\n }\n });\n\n if (usersToDownload.length != 0) {\n logger.log(\"downloadKeys: downloading for\", usersToDownload);\n const downloadPromise = this.doKeyDownload(usersToDownload);\n promises.push(downloadPromise);\n }\n\n if (promises.length === 0) {\n logger.log(\"downloadKeys: already have all necessary keys\");\n }\n\n return Promise.all(promises).then(() => {\n return this.getDevicesFromStore(userIds);\n });\n }\n\n /**\n * Get the stored device keys for a list of user ids\n *\n * @param userIds - the list of users to list keys for.\n *\n * @returns userId-\\>deviceId-\\>{@link DeviceInfo}.\n */\n private getDevicesFromStore(userIds: string[]): DeviceInfoMap {\n const stored: DeviceInfoMap = new Map();\n userIds.forEach((userId) => {\n const deviceMap = new Map();\n this.getStoredDevicesForUser(userId)?.forEach(function (device) {\n deviceMap.set(device.deviceId, device);\n });\n stored.set(userId, deviceMap);\n });\n return stored;\n }\n\n /**\n * Returns a list of all user IDs the DeviceList knows about\n *\n * @returns All known user IDs\n */\n public getKnownUserIds(): string[] {\n return Object.keys(this.devices);\n }\n\n /**\n * Get the stored device keys for a user id\n *\n * @param userId - the user to list keys for.\n *\n * @returns list of devices, or null if we haven't\n * managed to get a list of devices for this user yet.\n */\n public getStoredDevicesForUser(userId: string): DeviceInfo[] | null {\n const devs = this.devices[userId];\n if (!devs) {\n return null;\n }\n const res: DeviceInfo[] = [];\n for (const deviceId in devs) {\n if (devs.hasOwnProperty(deviceId)) {\n res.push(DeviceInfo.fromStorage(devs[deviceId], deviceId));\n }\n }\n return res;\n }\n\n /**\n * Get the stored device data for a user, in raw object form\n *\n * @param userId - the user to get data for\n *\n * @returns `deviceId->{object}` devices, or undefined if\n * there is no data for this user.\n */\n public getRawStoredDevicesForUser(userId: string): Record<string, IDevice> {\n return this.devices[userId];\n }\n\n public getStoredCrossSigningForUser(userId: string): CrossSigningInfo | null {\n if (!this.crossSigningInfo[userId]) return null;\n\n return CrossSigningInfo.fromStorage(this.crossSigningInfo[userId], userId);\n }\n\n public storeCrossSigningForUser(userId: string, info: ICrossSigningInfo): void {\n this.crossSigningInfo[userId] = info;\n this.dirty = true;\n }\n\n /**\n * Get the stored keys for a single device\n *\n *\n * @returns device, or undefined\n * if we don't know about this device\n */\n public getStoredDevice(userId: string, deviceId: string): DeviceInfo | undefined {\n const devs = this.devices[userId];\n if (!devs?.[deviceId]) {\n return undefined;\n }\n return DeviceInfo.fromStorage(devs[deviceId], deviceId);\n }\n\n /**\n * Get a user ID by one of their device's curve25519 identity key\n *\n * @param algorithm - encryption algorithm\n * @param senderKey - curve25519 key to match\n *\n * @returns user ID\n */\n public getUserByIdentityKey(algorithm: string, senderKey: string): string | null {\n if (algorithm !== olmlib.OLM_ALGORITHM && algorithm !== olmlib.MEGOLM_ALGORITHM) {\n // we only deal in olm keys\n return null;\n }\n\n return this.userByIdentityKey[senderKey];\n }\n\n /**\n * Find a device by curve25519 identity key\n *\n * @param algorithm - encryption algorithm\n * @param senderKey - curve25519 key to match\n */\n public getDeviceByIdentityKey(algorithm: string, senderKey: string): DeviceInfo | null {\n const userId = this.getUserByIdentityKey(algorithm, senderKey);\n if (!userId) {\n return null;\n }\n\n const devices = this.devices[userId];\n if (!devices) {\n return null;\n }\n\n for (const deviceId in devices) {\n if (!devices.hasOwnProperty(deviceId)) {\n continue;\n }\n\n const device = devices[deviceId];\n for (const keyId in device.keys) {\n if (!device.keys.hasOwnProperty(keyId)) {\n continue;\n }\n if (keyId.indexOf(\"curve25519:\") !== 0) {\n continue;\n }\n const deviceKey = device.keys[keyId];\n if (deviceKey == senderKey) {\n return DeviceInfo.fromStorage(device, deviceId);\n }\n }\n }\n\n // doesn't match a known device\n return null;\n }\n\n /**\n * Replaces the list of devices for a user with the given device list\n *\n * @param userId - The user ID\n * @param devices - New device info for user\n */\n public storeDevicesForUser(userId: string, devices: Record<string, IDevice>): void {\n this.setRawStoredDevicesForUser(userId, devices);\n this.dirty = true;\n }\n\n /**\n * flag the given user for device-list tracking, if they are not already.\n *\n * This will mean that a subsequent call to refreshOutdatedDeviceLists()\n * will download the device list for the user, and that subsequent calls to\n * invalidateUserDeviceList will trigger more updates.\n *\n */\n public startTrackingDeviceList(userId: string): void {\n // sanity-check the userId. This is mostly paranoia, but if synapse\n // can't parse the userId we give it as an mxid, it 500s the whole\n // request and we can never update the device lists again (because\n // the broken userId is always 'invalid' and always included in any\n // refresh request).\n // By checking it is at least a string, we can eliminate a class of\n // silly errors.\n if (typeof userId !== \"string\") {\n throw new Error(\"userId must be a string; was \" + userId);\n }\n if (!this.deviceTrackingStatus[userId]) {\n logger.log(\"Now tracking device list for \" + userId);\n this.deviceTrackingStatus[userId] = TrackingStatus.PendingDownload;\n // we don't yet persist the tracking status, since there may be a lot\n // of calls; we save all data together once the sync is done\n this.dirty = true;\n }\n }\n\n /**\n * Mark the given user as no longer being tracked for device-list updates.\n *\n * This won't affect any in-progress downloads, which will still go on to\n * complete; it will just mean that we don't think that we have an up-to-date\n * list for future calls to downloadKeys.\n *\n */\n public stopTrackingDeviceList(userId: string): void {\n if (this.deviceTrackingStatus[userId]) {\n logger.log(\"No longer tracking device list for \" + userId);\n this.deviceTrackingStatus[userId] = TrackingStatus.NotTracked;\n\n // we don't yet persist the tracking status, since there may be a lot\n // of calls; we save all data together once the sync is done\n this.dirty = true;\n }\n }\n\n /**\n * Set all users we're currently tracking to untracked\n *\n * This will flag each user whose devices we are tracking as in need of an\n * update.\n */\n public stopTrackingAllDeviceLists(): void {\n for (const userId of Object.keys(this.deviceTrackingStatus)) {\n this.deviceTrackingStatus[userId] = TrackingStatus.NotTracked;\n }\n this.dirty = true;\n }\n\n /**\n * Mark the cached device list for the given user outdated.\n *\n * If we are not tracking this user's devices, we'll do nothing. Otherwise\n * we flag the user as needing an update.\n *\n * This doesn't actually set off an update, so that several users can be\n * batched together. Call refreshOutdatedDeviceLists() for that.\n *\n */\n public invalidateUserDeviceList(userId: string): void {\n if (this.deviceTrackingStatus[userId]) {\n logger.log(\"Marking device list outdated for\", userId);\n this.deviceTrackingStatus[userId] = TrackingStatus.PendingDownload;\n\n // we don't yet persist the tracking status, since there may be a lot\n // of calls; we save all data together once the sync is done\n this.dirty = true;\n }\n }\n\n /**\n * If we have users who have outdated device lists, start key downloads for them\n *\n * @returns which completes when the download completes; normally there\n * is no need to wait for this (it's mostly for the unit tests).\n */\n public refreshOutdatedDeviceLists(): Promise<void> {\n this.saveIfDirty();\n\n const usersToDownload: string[] = [];\n for (const userId of Object.keys(this.deviceTrackingStatus)) {\n const stat = this.deviceTrackingStatus[userId];\n if (stat == TrackingStatus.PendingDownload) {\n usersToDownload.push(userId);\n }\n }\n\n return this.doKeyDownload(usersToDownload);\n }\n\n /**\n * Set the stored device data for a user, in raw object form\n * Used only by internal class DeviceListUpdateSerialiser\n *\n * @param userId - the user to get data for\n *\n * @param devices - `deviceId->{object}` the new devices\n */\n public setRawStoredDevicesForUser(userId: string, devices: Record<string, IDevice>): void {\n // remove old devices from userByIdentityKey\n if (this.devices[userId] !== undefined) {\n for (const [deviceId, dev] of Object.entries(this.devices[userId])) {\n const identityKey = dev.keys[\"curve25519:\" + deviceId];\n\n delete this.userByIdentityKey[identityKey];\n }\n }\n\n this.devices[userId] = devices;\n\n // add new devices into userByIdentityKey\n for (const [deviceId, dev] of Object.entries(devices)) {\n const identityKey = dev.keys[\"curve25519:\" + deviceId];\n\n this.userByIdentityKey[identityKey] = userId;\n }\n }\n\n public setRawStoredCrossSigningForUser(userId: string, info: ICrossSigningInfo): void {\n this.crossSigningInfo[userId] = info;\n }\n\n /**\n * Fire off download update requests for the given users, and update the\n * device list tracking status for them, and the\n * keyDownloadsInProgressByUser map for them.\n *\n * @param users - list of userIds\n *\n * @returns resolves when all the users listed have\n * been updated. rejects if there was a problem updating any of the\n * users.\n */\n private doKeyDownload(users: string[]): Promise<void> {\n if (users.length === 0) {\n // nothing to do\n return Promise.resolve();\n }\n\n const prom = this.serialiser.updateDevicesForUsers(users, this.syncToken!).then(\n () => {\n finished(true);\n },\n (e) => {\n logger.error(\"Error downloading keys for \" + users + \":\", e);\n finished(false);\n throw e;\n },\n );\n\n users.forEach((u) => {\n this.keyDownloadsInProgressByUser.set(u, prom);\n const stat = this.deviceTrackingStatus[u];\n if (stat == TrackingStatus.PendingDownload) {\n this.deviceTrackingStatus[u] = TrackingStatus.DownloadInProgress;\n }\n });\n\n const finished = (success: boolean): void => {\n this.emit(CryptoEvent.WillUpdateDevices, users, !this.hasFetched);\n users.forEach((u) => {\n this.dirty = true;\n\n // we may have queued up another download request for this user\n // since we started this request. If that happens, we should\n // ignore the completion of the first one.\n if (this.keyDownloadsInProgressByUser.get(u) !== prom) {\n logger.log(\"Another update in the queue for\", u, \"- not marking up-to-date\");\n return;\n }\n this.keyDownloadsInProgressByUser.delete(u);\n const stat = this.deviceTrackingStatus[u];\n if (stat == TrackingStatus.DownloadInProgress) {\n if (success) {\n // we didn't get any new invalidations since this download started:\n // this user's device list is now up to date.\n this.deviceTrackingStatus[u] = TrackingStatus.UpToDate;\n logger.log(\"Device list for\", u, \"now up to date\");\n } else {\n this.deviceTrackingStatus[u] = TrackingStatus.PendingDownload;\n }\n }\n });\n this.saveIfDirty();\n this.emit(CryptoEvent.DevicesUpdated, users, !this.hasFetched);\n this.hasFetched = true;\n };\n\n return prom;\n }\n}\n\n/**\n * Serialises updates to device lists\n *\n * Ensures that results from /keys/query are not overwritten if a second call\n * completes *before* an earlier one.\n *\n * It currently does this by ensuring only one call to /keys/query happens at a\n * time (and queuing other requests up).\n */\nclass DeviceListUpdateSerialiser {\n private downloadInProgress = false;\n\n // users which are queued for download\n // userId -> true\n private keyDownloadsQueuedByUser: Record<string, boolean> = {};\n\n // deferred which is resolved when the queued users are downloaded.\n // non-null indicates that we have users queued for download.\n private queuedQueryDeferred?: IDeferred<void>;\n\n private syncToken?: string; // The sync token we send with the requests\n\n /*\n * @param baseApis - Base API object\n * @param olmDevice - The Olm Device\n * @param deviceList - The device list object, the device list to be updated\n */\n public constructor(\n private readonly baseApis: MatrixClient,\n private readonly olmDevice: OlmDevice,\n private readonly deviceList: DeviceList,\n ) {}\n\n /**\n * Make a key query request for the given users\n *\n * @param users - list of user ids\n *\n * @param syncToken - sync token to pass in the query request, to\n * help the HS give the most recent results\n *\n * @returns resolves when all the users listed have\n * been updated. rejects if there was a problem updating any of the\n * users.\n */\n public updateDevicesForUsers(users: string[], syncToken: string): Promise<void> {\n users.forEach((u) => {\n this.keyDownloadsQueuedByUser[u] = true;\n });\n\n if (!this.queuedQueryDeferred) {\n this.queuedQueryDeferred = defer();\n }\n\n // We always take the new sync token and just use the latest one we've\n // been given, since it just needs to be at least as recent as the\n // sync response the device invalidation message arrived in\n this.syncToken = syncToken;\n\n if (this.downloadInProgress) {\n // just queue up these users\n logger.log(\"Queued key download for\", users);\n return this.queuedQueryDeferred.promise;\n }\n\n // start a new download.\n return this.doQueuedQueries();\n }\n\n private doQueuedQueries(): Promise<void> {\n if (this.downloadInProgress) {\n throw new Error(\"DeviceListUpdateSerialiser.doQueuedQueries called with request active\");\n }\n\n const downloadUsers = Object.keys(this.keyDownloadsQueuedByUser);\n this.keyDownloadsQueuedByUser = {};\n const deferred = this.queuedQueryDeferred;\n this.queuedQueryDeferred = undefined;\n\n logger.log(\"Starting key download for\", downloadUsers);\n this.downloadInProgress = true;\n\n const opts: Parameters<MatrixClient[\"downloadKeysForUsers\"]>[1] = {};\n if (this.syncToken) {\n opts.token = this.syncToken;\n }\n\n const factories: Array<() => Promise<IDownloadKeyResult>> = [];\n for (let i = 0; i < downloadUsers.length; i += this.deviceList.keyDownloadChunkSize) {\n const userSlice = downloadUsers.slice(i, i + this.deviceList.keyDownloadChunkSize);\n factories.push(() => this.baseApis.downloadKeysForUsers(userSlice, opts));\n }\n\n chunkPromises(factories, 3)\n .then(async (responses: IDownloadKeyResult[]) => {\n const dk: IDownloadKeyResult[\"device_keys\"] = Object.assign(\n {},\n ...responses.map((res) => res.device_keys || {}),\n );\n const masterKeys: IDownloadKeyResult[\"master_keys\"] = Object.assign(\n {},\n ...responses.map((res) => res.master_keys || {}),\n );\n const ssks: IDownloadKeyResult[\"self_signing_keys\"] = Object.assign(\n {},\n ...responses.map((res) => res.self_signing_keys || {}),\n );\n const usks: IDownloadKeyResult[\"user_signing_keys\"] = Object.assign(\n {},\n ...responses.map((res) => res.user_signing_keys || {}),\n );\n\n // yield to other things that want to execute in between users, to\n // avoid wedging the CPU\n // (https://github.com/vector-im/element-web/issues/3158)\n //\n // of course we ought to do this in a web worker or similar, but\n // this serves as an easy solution for now.\n for (const userId of downloadUsers) {\n await sleep(5);\n try {\n await this.processQueryResponseForUser(userId, dk[userId], {\n master: masterKeys?.[userId],\n self_signing: ssks?.[userId],\n user_signing: usks?.[userId],\n });\n } catch (e) {\n // log the error but continue, so that one bad key\n // doesn't kill the whole process\n logger.error(`Error processing keys for ${userId}:`, e);\n }\n }\n })\n .then(\n () => {\n logger.log(\"Completed key download for \" + downloadUsers);\n\n this.downloadInProgress = false;\n deferred?.resolve();\n\n // if we have queued users, fire off another request.\n if (this.queuedQueryDeferred) {\n this.doQueuedQueries();\n }\n },\n (e) => {\n logger.warn(\"Error downloading keys for \" + downloadUsers + \":\", e);\n this.downloadInProgress = false;\n deferred?.reject(e);\n },\n );\n\n return deferred!.promise;\n }\n\n private async processQueryResponseForUser(\n userId: string,\n dkResponse: DeviceKeys,\n crossSigningResponse: {\n master?: Keys;\n self_signing?: SigningKeys;\n user_signing?: SigningKeys;\n },\n ): Promise<void> {\n logger.log(\"got device keys for \" + userId + \":\", dkResponse);\n logger.log(\"got cross-signing keys for \" + userId + \":\", crossSigningResponse);\n\n {\n // map from deviceid -> deviceinfo for this user\n const userStore: Record<string, DeviceInfo> = {};\n const devs = this.deviceList.getRawStoredDevicesForUser(userId);\n if (devs) {\n Object.keys(devs).forEach((deviceId) => {\n const d = DeviceInfo.fromStorage(devs[deviceId], deviceId);\n userStore[deviceId] = d;\n });\n }\n\n await updateStoredDeviceKeysForUser(\n this.olmDevice,\n userId,\n userStore,\n dkResponse || {},\n this.baseApis.getUserId()!,\n this.baseApis.deviceId!,\n );\n\n // put the updates into the object that will be returned as our results\n const storage: Record<string, IDevice> = {};\n Object.keys(userStore).forEach((deviceId) => {\n storage[deviceId] = userStore[deviceId].toStorage();\n });\n\n this.deviceList.setRawStoredDevicesForUser(userId, storage);\n }\n\n // now do the same for the cross-signing keys\n {\n // FIXME: should we be ignoring empty cross-signing responses, or\n // should we be dropping the keys?\n if (\n crossSigningResponse &&\n (crossSigningResponse.master || crossSigningResponse.self_signing || crossSigningResponse.user_signing)\n ) {\n const crossSigning =\n this.deviceList.getStoredCrossSigningForUser(userId) || new CrossSigningInfo(userId);\n\n crossSigning.setKeys(crossSigningResponse);\n\n this.deviceList.setRawStoredCrossSigningForUser(userId, crossSigning.toStorage());\n\n // NB. Unlike most events in the js-sdk, this one is internal to the\n // js-sdk and is not re-emitted\n this.deviceList.emit(CryptoEvent.UserCrossSigningUpdated, userId);\n }\n }\n }\n}\n\nasync function updateStoredDeviceKeysForUser(\n olmDevice: OlmDevice,\n userId: string,\n userStore: Record<string, DeviceInfo>,\n userResult: IDownloadKeyResult[\"device_keys\"][\"user_id\"],\n localUserId: string,\n localDeviceId: string,\n): Promise<boolean> {\n let updated = false;\n\n // remove any devices in the store which aren't in the response\n for (const deviceId in userStore) {\n if (!userStore.hasOwnProperty(deviceId)) {\n continue;\n }\n\n if (!(deviceId in userResult)) {\n if (userId === localUserId && deviceId === localDeviceId) {\n logger.warn(`Local device ${deviceId} missing from sync, skipping removal`);\n continue;\n }\n\n logger.log(\"Device \" + userId + \":\" + deviceId + \" has been removed\");\n delete userStore[deviceId];\n updated = true;\n }\n }\n\n for (const deviceId in userResult) {\n if (!userResult.hasOwnProperty(deviceId)) {\n continue;\n }\n\n const deviceResult = userResult[deviceId];\n\n // check that the user_id and device_id in the response object are\n // correct\n if (deviceResult.user_id !== userId) {\n logger.warn(\"Mismatched user_id \" + deviceResult.user_id + \" in keys from \" + userId + \":\" + deviceId);\n continue;\n }\n if (deviceResult.device_id !== deviceId) {\n logger.warn(\"Mismatched device_id \" + deviceResult.device_id + \" in keys from \" + userId + \":\" + deviceId);\n continue;\n }\n\n if (await storeDeviceKeys(olmDevice, userStore, deviceResult)) {\n updated = true;\n }\n }\n\n return updated;\n}\n\n/*\n * Process a device in a /query response, and add it to the userStore\n *\n * returns (a promise for) true if a change was made, else false\n */\nasync function storeDeviceKeys(\n olmDevice: OlmDevice,\n userStore: Record<string, DeviceInfo>,\n deviceResult: IDownloadKeyResult[\"device_keys\"][\"user_id\"][\"device_id\"],\n): Promise<boolean> {\n if (!deviceResult.keys) {\n // no keys?\n return false;\n }\n\n const deviceId = deviceResult.device_id;\n const userId = deviceResult.user_id;\n\n const signKeyId = \"ed25519:\" + deviceId;\n const signKey = deviceResult.keys[signKeyId];\n if (!signKey) {\n logger.warn(\"Device \" + userId + \":\" + deviceId + \" has no ed25519 key\");\n return false;\n }\n\n const unsigned = deviceResult.unsigned || {};\n const signatures = deviceResult.signatures || {};\n\n try {\n await olmlib.verifySignature(olmDevice, deviceResult, userId, deviceId, signKey);\n } catch (e) {\n logger.warn(\"Unable to verify signature on device \" + userId + \":\" + deviceId + \":\" + e);\n return false;\n }\n\n // DeviceInfo\n let deviceStore;\n\n if (deviceId in userStore) {\n // already have this device.\n deviceStore = userStore[deviceId];\n\n if (deviceStore.getFingerprint() != signKey) {\n // this should only happen if the list has been MITMed; we are\n // best off sticking with the original keys.\n //\n // Should we warn the user about it somehow?\n logger.warn(\"Ed25519 key for device \" + userId + \":\" + deviceId + \" has changed\");\n return false;\n }\n } else {\n userStore[deviceId] = deviceStore = new DeviceInfo(deviceId);\n }\n\n deviceStore.keys = deviceResult.keys || {};\n deviceStore.algorithms = deviceResult.algorithms || [];\n deviceStore.unsigned = unsigned;\n deviceStore.signatures = signatures;\n return true;\n}\n"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,SAASA,MAAM,QAAQ,cAAc;AACrC,SAASC,UAAU,QAAiB,iBAAiB;AACrD,SAASC,gBAAgB,QAA2B,mBAAmB;AACvE,OAAO,KAAKC,MAAM,MAAM,aAAa;AACrC,SAASC,oBAAoB,QAAQ,mCAAmC;AACxE,SAASC,aAAa,EAAEC,KAAK,EAAaC,KAAK,QAAQ,aAAa;AAIpE,SAASC,iBAAiB,QAAQ,kCAAkC;AACpE,SAASC,WAAW,QAA+B,YAAY;;AAE/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,WAAYC,cAAc,0BAAdA,cAAc;EAAdA,cAAc,CAAdA,cAAc;EAAdA,cAAc,CAAdA,cAAc;EAAdA,cAAc,CAAdA,cAAc;EAAdA,cAAc,CAAdA,cAAc;EAAA,OAAdA,cAAc;AAAA;;AAO1B;;AAKA,OAAO,MAAMC,UAAU,SAASH,iBAAiB,CAAuC;EAmC7EI,WAAWA,CACdC,QAAsB,EACLC,WAAwB,EACzCC,SAAoB,EAGtB;IAAA,IADkBC,oBAAoB,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,GAAG;IAE1C,KAAK,CAAC,CAAC;IAAC,KALSH,WAAwB,GAAxBA,WAA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Y,CAAC/J,IAAI,IAAI,CAAC,CAAC;IAC1C4K,WAAW,CAACE,UAAU,GAAGf,YAAY,CAACe,UAAU,IAAI,EAAE;IACtDF,WAAW,CAACH,QAAQ,GAAGA,QAAQ;IAC/BG,WAAW,CAACF,UAAU,GAAGA,UAAU;IACnC,OAAO,IAAI;EACf,CAAC;EAAA,OAAAJ,gBAAA,CAAAjC,KAAA,OAAA/J,SAAA;AAAA","ignoreList":[]}
@@ -1,152 +0,0 @@
1
- import { MatrixEvent } from "../models/event.ts";
2
- import { ICacheCallbacks } from "./CrossSigning.ts";
3
- import { Crypto, ICryptoCallbacks } from "./index.ts";
4
- import { ClientEvent, ClientEventHandlerMap, ISignedKey, KeySignatures } from "../client.ts";
5
- import { IKeyBackupInfo } from "./keybackup.ts";
6
- import { TypedEventEmitter } from "../models/typed-event-emitter.ts";
7
- import { AccountDataClient, SecretStorageKeyDescription } from "../secret-storage.ts";
8
- import { BootstrapCrossSigningOpts, CrossSigningKeyInfo } from "../crypto-api/index.ts";
9
- interface ICrossSigningKeys {
10
- authUpload: BootstrapCrossSigningOpts["authUploadDeviceSigningKeys"];
11
- keys: Record<"master" | "self_signing" | "user_signing", CrossSigningKeyInfo>;
12
- }
13
- /**
14
- * Builds an EncryptionSetupOperation by calling any of the add.. methods.
15
- * Once done, `buildOperation()` can be called which allows to apply to operation.
16
- *
17
- * This is used as a helper by Crypto to keep track of all the network requests
18
- * and other side-effects of bootstrapping, so it can be applied in one go (and retried in the future)
19
- * Also keeps track of all the private keys created during bootstrapping, so we don't need to prompt for them
20
- * more than once.
21
- */
22
- export declare class EncryptionSetupBuilder {
23
- readonly accountDataClientAdapter: AccountDataClientAdapter;
24
- readonly crossSigningCallbacks: CrossSigningCallbacks;
25
- readonly ssssCryptoCallbacks: SSSSCryptoCallbacks;
26
- private crossSigningKeys?;
27
- private keySignatures?;
28
- private keyBackupInfo?;
29
- private sessionBackupPrivateKey?;
30
- /**
31
- * @param accountData - pre-existing account data, will only be read, not written.
32
- * @param delegateCryptoCallbacks - crypto callbacks to delegate to if the key isn't in cache yet
33
- */
34
- constructor(accountData: Map<string, MatrixEvent>, delegateCryptoCallbacks?: ICryptoCallbacks);
35
- /**
36
- * Adds new cross-signing public keys
37
- *
38
- * @param authUpload - Function called to await an interactive auth
39
- * flow when uploading device signing keys.
40
- * Args:
41
- * A function that makes the request requiring auth. Receives
42
- * the auth data as an object. Can be called multiple times, first with
43
- * an empty authDict, to obtain the flows.
44
- * @param keys - the new keys
45
- */
46
- addCrossSigningKeys(authUpload: ICrossSigningKeys["authUpload"], keys: ICrossSigningKeys["keys"]): void;
47
- /**
48
- * Adds the key backup info to be updated on the server
49
- *
50
- * Used either to create a new key backup, or add signatures
51
- * from the new MSK.
52
- *
53
- * @param keyBackupInfo - as received from/sent to the server
54
- */
55
- addSessionBackup(keyBackupInfo: IKeyBackupInfo): void;
56
- /**
57
- * Adds the session backup private key to be updated in the local cache
58
- *
59
- * Used after fixing the format of the key
60
- *
61
- */
62
- addSessionBackupPrivateKeyToCache(privateKey: Uint8Array): void;
63
- /**
64
- * Add signatures from a given user and device/x-sign key
65
- * Used to sign the new cross-signing key with the device key
66
- *
67
- */
68
- addKeySignature(userId: string, deviceId: string, signature: ISignedKey): void;
69
- setAccountData(type: string, content: object): Promise<void>;
70
- /**
71
- * builds the operation containing all the parts that have been added to the builder
72
- */
73
- buildOperation(): EncryptionSetupOperation;
74
- /**
75
- * Stores the created keys locally.
76
- *
77
- * This does not yet store the operation in a way that it can be restored,
78
- * but that is the idea in the future.
79
- */
80
- persist(crypto: Crypto): Promise<void>;
81
- }
82
- /**
83
- * Can be created from EncryptionSetupBuilder, or
84
- * (in a follow-up PR, not implemented yet) restored from storage, to retry.
85
- *
86
- * It does not have knowledge of any private keys, unlike the builder.
87
- */
88
- export declare class EncryptionSetupOperation {
89
- private readonly accountData;
90
- private readonly crossSigningKeys?;
91
- private readonly keyBackupInfo?;
92
- private readonly keySignatures?;
93
- /**
94
- */
95
- constructor(accountData: Map<string, object>, crossSigningKeys?: ICrossSigningKeys | undefined, keyBackupInfo?: IKeyBackupInfo | undefined, keySignatures?: KeySignatures | undefined);
96
- /**
97
- * Runs the (remaining part of, in the future) operation by sending requests to the server.
98
- */
99
- apply(crypto: Crypto): Promise<void>;
100
- }
101
- /**
102
- * Catches account data set by SecretStorage during bootstrapping by
103
- * implementing the methods related to account data in MatrixClient
104
- */
105
- declare class AccountDataClientAdapter extends TypedEventEmitter<ClientEvent.AccountData, ClientEventHandlerMap> implements AccountDataClient {
106
- private readonly existingValues;
107
- readonly values: Map<string, MatrixEvent>;
108
- /**
109
- * @param existingValues - existing account data
110
- */
111
- constructor(existingValues: Map<string, MatrixEvent>);
112
- /**
113
- * @returns the content of the account data
114
- */
115
- getAccountDataFromServer<T extends {
116
- [k: string]: any;
117
- }>(type: string): Promise<T | null>;
118
- /**
119
- * @returns the content of the account data
120
- */
121
- getAccountData<T extends {
122
- [k: string]: any;
123
- }>(type: string): T | null;
124
- setAccountData(type: string, content: any): Promise<{}>;
125
- }
126
- /**
127
- * Catches the private cross-signing keys set during bootstrapping
128
- * by both cache callbacks (see createCryptoStoreCacheCallbacks) as non-cache callbacks.
129
- * See CrossSigningInfo constructor
130
- */
131
- declare class CrossSigningCallbacks implements ICryptoCallbacks, ICacheCallbacks {
132
- readonly privateKeys: Map<string, Uint8Array>;
133
- getCrossSigningKeyCache(type: string, expectedPublicKey: string): Promise<Uint8Array | null>;
134
- storeCrossSigningKeyCache(type: string, key: Uint8Array): Promise<void>;
135
- getCrossSigningKey(type: string, expectedPubkey: string): Promise<Uint8Array | null>;
136
- saveCrossSigningKeys(privateKeys: Record<string, Uint8Array>): void;
137
- }
138
- /**
139
- * Catches the 4S private key set during bootstrapping by implementing
140
- * the SecretStorage crypto callbacks
141
- */
142
- declare class SSSSCryptoCallbacks {
143
- private readonly delegateCryptoCallbacks?;
144
- private readonly privateKeys;
145
- constructor(delegateCryptoCallbacks?: ICryptoCallbacks | undefined);
146
- getSecretStorageKey({ keys }: {
147
- keys: Record<string, SecretStorageKeyDescription>;
148
- }, name: string): Promise<[string, Uint8Array] | null>;
149
- addPrivateKey(keyId: string, keyInfo: SecretStorageKeyDescription, privKey: Uint8Array): void;
150
- }
151
- export {};
152
- //# sourceMappingURL=EncryptionSetup.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"EncryptionSetup.d.ts","sourceRoot":"","sources":["../../src/crypto/EncryptionSetup.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAmC,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAGrF,OAAO,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,qBAAqB,EAAoB,UAAU,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC/G,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AACrE,OAAO,EAAE,iBAAiB,EAAE,2BAA2B,EAAE,MAAM,sBAAsB,CAAC;AACtF,OAAO,EAAE,yBAAyB,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAExF,UAAU,iBAAiB;IACvB,UAAU,EAAE,yBAAyB,CAAC,6BAA6B,CAAC,CAAC;IACrE,IAAI,EAAE,MAAM,CAAC,QAAQ,GAAG,cAAc,GAAG,cAAc,EAAE,mBAAmB,CAAC,CAAC;CACjF;AAED;;;;;;;;GAQG;AACH,qBAAa,sBAAsB;IAC/B,SAAgB,wBAAwB,EAAE,wBAAwB,CAAC;IACnE,SAAgB,qBAAqB,EAAE,qBAAqB,CAAC;IAC7D,SAAgB,mBAAmB,EAAE,mBAAmB,CAAC;IAEzD,OAAO,CAAC,gBAAgB,CAAC,CAAoB;IAC7C,OAAO,CAAC,aAAa,CAAC,CAAgB;IACtC,OAAO,CAAC,aAAa,CAAC,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