-
-
Notifications
You must be signed in to change notification settings - Fork 605
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Migrate own identity local trust to rust crypto #4090
Merged
BillCarsonFr
merged 20 commits into
develop
from
valere/element-r/migrate_local_trust_if_needed
Mar 18, 2024
Merged
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
2a5e165
Migrate own identity trust to rust crypto
BillCarsonFr eebd5e1
Fix gendoc not happy if msk of IDownloadKeyResult has a signature
BillCarsonFr 4c76d71
add missing mock
BillCarsonFr f24f67b
code review
BillCarsonFr 6f389f5
Code review
BillCarsonFr 027b025
Merge branch 'develop' into valere/element-r/migrate_local_trust_if_n…
BillCarsonFr bff57ad
Review gh suggestion
BillCarsonFr 7e95829
Review gh suggestion
BillCarsonFr 0dd4ef6
Review gh suggestion
BillCarsonFr 230e79a
Review gh suggestion
BillCarsonFr 0695d44
review move function down in file
BillCarsonFr 6dfc534
Merge branch 'valere/element-r/migrate_local_trust_if_needed' of http…
BillCarsonFr c5fffba
Review gh suggestion
BillCarsonFr 7965819
Review gh suggestion
BillCarsonFr 7345204
Review: Cleaning tests, renaming
BillCarsonFr 82a69c6
Review: better comment
BillCarsonFr a008231
Comment paragraphs
BillCarsonFr e034bc7
retry until initial key query is successfull
BillCarsonFr 9a37f04
review quick nits
BillCarsonFr d3a5082
missing mock in test
BillCarsonFr File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
71,732 changes: 0 additions & 71,732 deletions
71,732
spec/test-utils/test_indexeddb_cryptostore_dump/dump.json
This file was deleted.
Oops, something went wrong.
4 changes: 4 additions & 0 deletions
4
spec/test-utils/test_indexeddb_cryptostore_dump/full_account/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
## Dump of a libolm indexeddb cryptostore to test migration of a full account | ||
|
||
A dump of an account containing a complete set of data to migrate. | ||
The data set is substantial enough to allow for testing of chunking mechanisms and progress reporting during the migration process. |
71,038 changes: 71,038 additions & 0 deletions
71,038
spec/test-utils/test_indexeddb_cryptostore_dump/full_account/dump.json
Large diffs are not rendered by default.
Oops, something went wrong.
109 changes: 109 additions & 0 deletions
109
spec/test-utils/test_indexeddb_cryptostore_dump/full_account/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
import { DumpDataSetInfo } from "../index"; | ||
|
||
/** | ||
* A key query response containing the current keys of the tested user. | ||
* To be used during tests with fetchmock. | ||
*/ | ||
const KEYS_QUERY_RESPONSE: any = { | ||
device_keys: { | ||
"@vdhtest200713:matrix.org": { | ||
KMFSTJSMLB: { | ||
algorithms: ["m.olm.v1.curve25519-aes-sha2", "m.megolm.v1.aes-sha2"], | ||
device_id: "KMFSTJSMLB", | ||
keys: { | ||
"curve25519:KMFSTJSMLB": "LKv0bKbc0EC4h0jknbemv3QalEkeYvuNeUXVRgVVTTU", | ||
"ed25519:KMFSTJSMLB": "qK70DEqIXq7T+UU3v/al47Ab4JkMEBLpNrTBMbS5rrw", | ||
}, | ||
user_id: "@vdhtest200713:matrix.org", | ||
signatures: { | ||
"@vdhtest200713:matrix.org": { | ||
"ed25519:KMFSTJSMLB": | ||
"aE+PdxLAdwQ/xfJwLmqebvt/lrT97fZas2SQFFrM+dPmHxQtjyS8csm88BLfGRjJKK1B/vWev3AaKqQZwLTUAw", | ||
"ed25519:lDvg6vi3P80L9XFNpUSU+5Y87m3p6yHcC83jhSU4Q5k": | ||
"lCd4SA/JT1nnxsgN9yQaLJQhH5hkLMVVx6ba5JAjL1wpWVqyPxzMJHImX6vTztk6S8rybcdfYkea5W/Ii+4HCQ", | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
master_keys: { | ||
"@vdhtest200713:matrix.org": { | ||
user_id: "@vdhtest200713:matrix.org", | ||
usage: ["master"], | ||
keys: { | ||
"ed25519:gh9fGr39eNZUdWynEMJ/q/WZq/Pk/foFxHXFBFm18ZI": "gh9fGr39eNZUdWynEMJ/q/WZq/Pk/foFxHXFBFm18ZI", | ||
}, | ||
signatures: { | ||
"@vdhtest200713:matrix.org": { | ||
"ed25519:MWOGVUTXZN": | ||
"stOu1aHbhsWB/Aj5M/HqBR83QzME+682C995Uc8JxSmmyrlWmgG8QrnoUDG2OFR1t6zNQ+QLEilU4WNEOV73DQ", | ||
}, | ||
}, | ||
}, | ||
}, | ||
self_signing_keys: { | ||
"@vdhtest200713:matrix.org": { | ||
user_id: "@vdhtest200713:matrix.org", | ||
usage: ["self_signing"], | ||
keys: { | ||
"ed25519:lDvg6vi3P80L9XFNpUSU+5Y87m3p6yHcC83jhSU4Q5k": "lDvg6vi3P80L9XFNpUSU+5Y87m3p6yHcC83jhSU4Q5k", | ||
}, | ||
signatures: { | ||
"@vdhtest200713:matrix.org": { | ||
"ed25519:gh9fGr39eNZUdWynEMJ/q/WZq/Pk/foFxHXFBFm18ZI": | ||
"HKTC7NoBhAkfJtmemmkn/HvCCgBQViWZ0uH7aGPRaWMDFgD8T7Q+y1j3FKZv4mhSopR85Fq3FRyXsG8OVvGeBA", | ||
}, | ||
}, | ||
}, | ||
}, | ||
user_signing_keys: { | ||
"@vdhtest200713:matrix.org": { | ||
user_id: "@vdhtest200713:matrix.org", | ||
usage: ["user_signing"], | ||
keys: { | ||
"ed25519:YShqO/3u5vQ0uucojraWrtoLrek0CYrurN/vH/YPMg8": "YShqO/3u5vQ0uucojraWrtoLrek0CYrurN/vH/YPMg8", | ||
}, | ||
signatures: { | ||
"@vdhtest200713:matrix.org": { | ||
"ed25519:gh9fGr39eNZUdWynEMJ/q/WZq/Pk/foFxHXFBFm18ZI": | ||
"u8VOi4IaeRJwDgy2ftK02NJQPdBijy8f/0+WnHGG72yfOvMthwWzEw8SrRSNG8glBNrfHinKwCyJJzAJwyepCQ", | ||
}, | ||
}, | ||
}, | ||
}, | ||
}; | ||
|
||
/** | ||
* A `/room_keys/version` response containing the current server-side backup info. | ||
* To be used during tests with fetchmock. | ||
*/ | ||
const BACKUP_RESPONSE: any = { | ||
auth_data: { | ||
public_key: "q+HZiJdHl2Yopv9GGvv7EYSzDMrAiRknK4glSdoaomI", | ||
signatures: { | ||
"@vdhtest200713:matrix.org": { | ||
"ed25519:gh9fGr39eNZUdWynEMJ/q/WZq/Pk/foFxHXFBFm18ZI": | ||
"reDp6Mu+j+tfUL3/T6f5OBT3N825Lzpc43vvG+RvjX6V+KxXzodBQArgCoeEHLtL9OgSBmNrhTkSOX87MWCKAw", | ||
"ed25519:KMFSTJSMLB": | ||
"F8tyV5W6wNi0GXTdSg+gxSCULQi0EYxdAAqfkyNq58KzssZMw5i+PRA0aI2b+D7NH/aZaJrtiYNHJ0gWLSQvAw", | ||
}, | ||
}, | ||
}, | ||
version: "7", | ||
algorithm: "m.megolm_backup.v1.curve25519-aes-sha2", | ||
etag: "1", | ||
count: 79, | ||
}; | ||
|
||
/** | ||
* A dataset containing the information for the tested user. | ||
* To be used during tests. | ||
*/ | ||
export const FULL_ACCOUNT_DATASET: DumpDataSetInfo = { | ||
userId: "@vdhtest200713:matrix.org", | ||
deviceId: "KMFSTJSMLB", | ||
pickleKey: "+1k2Ppd7HIisUY824v7JtV3/oEE4yX0TqtmNPyhaD7o", | ||
backupResponse: BACKUP_RESPONSE, | ||
keyQueryResponse: KEYS_QUERY_RESPONSE, | ||
dumpPath: "spec/test-utils/test_indexeddb_cryptostore_dump/full_account/dump.json", | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
spec/test-utils/test_indexeddb_cryptostore_dump/no_cached_msk_dump/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
## Dump of a libolm indexeddb cryptostore where the msk is not cached | ||
|
||
A dump simulating an account where the identity was verified, but the msk was not in cache. | ||
Used to test that the owner identity local trust is migrated correctly. |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this is necessary: a class can have additional fields which aren't specified in an interface.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am getting that error
Object literal may only specify known properties
if it's not there