Valere
48d4f1b0cc
ElementR: Fix missing key check values in 4S key storage ( #3950 )
...
* fix missing key check in key storage
* code review
* fix tests
* add recovery keys test for both backends
* fix api break on GeneratedSecretStorageKey
* fix test
* fix test
* Update src/crypto-api.ts
Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com >
* Update spec/unit/rust-crypto/rust-crypto.spec.ts
Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com >
* Update src/crypto-api.ts
Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com >
---------
Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com >
2023-12-18 15:05:28 +00:00
David Baker
31f38550e3
Refactor & make base64 functions browser-safe
...
We had two identical sets of base64 functions in the js-sdk, both
using Buffer which isn't really available in the browser unless you're
using an old webpack (ie. what element-web uses). This PR:
* Takes the crypto base64 file and moves it out of crypto (because
we use base64 for much more than just crypto)
* Makes them work in a browser without the Buffer global
* Removes the other base64 functions
* Changes everything to use the new common ones
* Adds a comment explaining why the function is kinda ugly and how
soul destroyingly awful the JS ecosystem is.
* Runs the tests with both impls
* Changes the test to not just test the decoder against the encoder
* Adds explicit support & tests for (decoding) base64Url (I'll add an
encode method later, no need for that to go in this PR too).
2023-10-20 16:00:55 +01:00
Richard van der Hoff
0778c4e01e
Re-check key backup after bootstrapSecretStorage ( #3692 )
...
Fixes https://github.com/vector-im/element-web/issues/26115
2023-09-05 09:10:58 +00:00
Michael Telatynski
5973c66726
Make sonar happier about our code & tests ( #3388 )
2023-05-19 16:33:19 +01:00
Richard van der Hoff
0e19f8dc69
Split SecretStorage into two parts ( #3267 )
...
* Pull `SecretStorageCallbacks` out of `ICryptoCallbacks`
* Pull the storage part of SecretStorage out to a new class
* Move SecretSharing to a separate class
* Move `ISecretRequest` into `SecretSharing.ts`
* Pull out ISecretStorage interface, and use it
* Mark old `SecretStorage` as deprecated, and rename accesses to it
* Move a `SecretStorage` unit test into its own file
* Use new `SecretStorage` in a couple of places
* add some more unit tests
* Fix test file name
... to match the unit under test
* even more tests
* Add a load of comments
* Rename classes
* Fix some broken tsdoc links
* fix broken test
* Fix compaints about superlinear regex
* just one more test
2023-04-12 16:10:43 +00:00
Richard van der Hoff
6ebbc15359
Move SecretStorage-related interfaces out to new module ( #3244 )
...
* Remove redundant `IAccountDataClient.getAccountData`
This is never called, so we may as well get rid of it
* Move a few more interfaces into `secret-storage.ts`
* Use interfaces from `secret-storage`
* Move IAccountDataClient to secret-storage
* Use `AccountDataClient` from `secret-storage`
* move SECRET_STORAGE_ALGORITHM_V1_AES to secret-storage
* Use `SECRET_STORAGE_ALGORITHM_V1_AES` from `secret-storage`
* Add a test case for the quality gate
* Update src/secret-storage.ts
2023-04-05 11:42:15 +00:00
Richard van der Hoff
41d3ffdab9
Split up, rename, and move ISecretStorageKeyInfo ( #3242 )
...
* Move SecretStorageKeyInfo interfaces out to a new module
* Replace usages of ISecretStorageKeyInfo with SecretStorageKeyDescription
2023-04-03 10:11:03 +00:00
Michael Weimann
9a504af18e
Changes for v24.0.0
2023-03-28 11:22:02 +01:00
Michael Weimann
349c2c2587
Apply prettier formatting
2022-12-09 09:38:20 +01:00
Michael Telatynski
8d018f9c2d
Enable noImplicitAny ( #2895 )
...
* Stash noImplicitAny work
* Enable noImplicitAny
* Update olm
* Fun
* Fix msgid stuff
* Fix tests
* Attempt to fix Browserify
2022-12-06 18:21:44 +00:00
Michael Telatynski
9f2f08dfd3
Fix more typescript --strict violations ( #2795 )
...
* Stash tsc fixes
* Iterate
* Iterate
* Iterate
* Fix tests
* Iterate
* Iterate
* Iterate
* Iterate
* Add tests
2022-10-25 18:31:40 +01:00
Michael Telatynski
867a0ca7ee
Apply more strict typescript around the codebase ( #2778 )
...
* Apply more strict typescript around the codebase
* Fix tests
* Revert strict mode commit
* Iterate strict
* Iterate
* Iterate strict
* Iterate
* Fix tests
* Iterate
* Iterate strict
* Add tests
* Iterate
* Iterate
* Fix tests
* Fix tests
* Strict types be strict
* Fix types
* detectOpenHandles
* Strict
* Fix client not stopping
* Add sync peeking tests
* Make test happier
* More strict
* Iterate
* Stabilise
* Moar strictness
* Improve coverage
* Fix types
* Fix types
* Improve types further
* Fix types
* Improve typing of NamespacedValue
* Fix types
2022-10-21 11:44:40 +01:00
Michael Telatynski
30570bcce6
Remove node-specific crypto bits, use Node 16's WebCrypto ( #2762 )
2022-10-17 17:54:54 +01:00
Michael Telatynski
34c5598a3f
Modernize http-api - move from browser-request to fetch ( #2719 )
2022-10-12 18:59:04 +01:00
Faye Duxovni
4ba083e6af
Bump IDB crypto store version ( #2705 )
...
* Bump IDB crypto store version
* lint fix
2022-09-28 15:39:37 +01:00
RiotRobot
a587d7c360
Resolve multiple CVEs
...
CVE-2022-39249
CVE-2022-39250
CVE-2022-39251
CVE-2022-39236
2022-09-28 13:55:15 +01:00
Kerry
41ab3337b5
test typescriptification - spec/unit/crypto/verification ( #2673 )
...
* renamed: spec/unit/crypto/verification/request.spec.js -> spec/unit/crypto/verification/request.spec.ts
* renamed: spec/unit/crypto/verification/qr_code.spec.js -> spec/unit/crypto/verification/qr_code.spec.ts
* renamed: spec/unit/crypto/verification/InRoomChannel.spec.js -> spec/unit/crypto/verification/InRoomChannel.spec.ts
* fix ts issues in InRoomChannel.spec
* renamed: spec/unit/crypto/verification/util.js -> spec/unit/crypto/verification/util.ts
* fix ts issues in util.t
* fix strict errors in util.ts
* js lint
2022-09-16 10:46:56 +02:00
Kerry
2c2686c910
Test typescriptification - cross-signing.spec ( #2441 )
...
* enamed: spec/unit/crypto/secrets.spec.js -> spec/unit/crypto/secrets.spec.ts
Signed-off-by: Kerry Archibald <kerrya@element.io >
* fix ts issues in secrets.spec
Signed-off-by: Kerry Archibald <kerrya@element.io >
* renamed: spec/unit/crypto/outgoing-room-key-requests.spec.js -> spec/unit/crypto/outgoing-room-key-requests.spec.ts
Signed-off-by: Kerry Archibald <kerrya@element.io >
* fix ts issues in outgoing-room-key-requests.spec.ts
Signed-off-by: Kerry Archibald <kerrya@element.io >
* renamed: spec/unit/crypto/DeviceList.spec.js -> spec/unit/crypto/DeviceList.spec.ts
Signed-off-by: Kerry Archibald <kerrya@element.io >
* fix ts issues in DeviceList.spec
Signed-off-by: Kerry Archibald <kerrya@element.io >
* renamed: spec/unit/crypto/CrossSigningInfo.spec.js -> spec/unit/crypto/CrossSigningInfo.spec.ts
Signed-off-by: Kerry Archibald <kerrya@element.io >
* fix ts issues in CrossSigningInfo.spec
Signed-off-by: Kerry Archibald <kerrya@element.io >
* renamed: spec/unit/crypto/cross-signing.spec.js -> spec/unit/crypto/cross-signing.spec.ts
Signed-off-by: Kerry Archibald <kerrya@element.io >
* fix most function call types in cross-signing.spec
Signed-off-by: Kerry Archibald <kerrya@element.io >
* typed events in cross-signing
Signed-off-by: Kerry Archibald <kerrya@element.io >
* type cross signing keys
Signed-off-by: Kerry Archibald <kerrya@element.io >
* convince the rest of the key types in cross-signing.spec
Signed-off-by: Kerry Archibald <kerrya@element.io >
* use correct type for IDevice
2022-06-08 13:03:02 +00:00
Kerry
8f5162c40d
Test typescriptification - crypto unit tests pt 1 ( #2440 )
...
* enamed: spec/unit/crypto/secrets.spec.js -> spec/unit/crypto/secrets.spec.ts
Signed-off-by: Kerry Archibald <kerrya@element.io >
* fix ts issues in secrets.spec
Signed-off-by: Kerry Archibald <kerrya@element.io >
* renamed: spec/unit/crypto/outgoing-room-key-requests.spec.js -> spec/unit/crypto/outgoing-room-key-requests.spec.ts
Signed-off-by: Kerry Archibald <kerrya@element.io >
* fix ts issues in outgoing-room-key-requests.spec.ts
Signed-off-by: Kerry Archibald <kerrya@element.io >
* renamed: spec/unit/crypto/DeviceList.spec.js -> spec/unit/crypto/DeviceList.spec.ts
Signed-off-by: Kerry Archibald <kerrya@element.io >
* fix ts issues in DeviceList.spec
Signed-off-by: Kerry Archibald <kerrya@element.io >
2022-06-08 12:39:08 +02:00