-
Notifications
You must be signed in to change notification settings - Fork 212
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
Manual key export / import with Crypto V2 #1608
Conversation
Anderas
commented
Oct 17, 2022
- Implement manual export / import of room keys via a file
- Implement export / import of cross signing keys
- Remove some old unused methods to export / import room keys without a passphrase
ed99001
to
75ccef5
Compare
75ccef5
to
ca81a7b
Compare
Codecov ReportBase: 15.92% // Head: 25.92% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## develop #1608 +/- ##
===========================================
+ Coverage 15.92% 25.92% +9.99%
===========================================
Files 575 575
Lines 91072 91037 -35
Branches 38407 39511 +1104
===========================================
+ Hits 14507 23604 +9097
+ Misses 76097 66670 -9427
- Partials 468 763 +295
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
ca81a7b
to
a8e2a76
Compare
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.
IGTM!
// MARK: - Manual export / import | ||
|
||
func exportRoomKeys(passphrase: String) throws -> Data { | ||
return try backup.exportRoomKeys(passphrase: passphrase) |
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.
return try backup.exportRoomKeys(passphrase: passphrase) | |
try backup.exportRoomKeys(passphrase: passphrase) |
} | ||
|
||
func importRoomKeys(_ data: Data, passphrase: String) throws -> KeysImportResult { | ||
return try backup.importRoomKeys(data, passphrase: passphrase, progressListener: self) |
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.
return try backup.importRoomKeys(data, passphrase: passphrase, progressListener: self) | |
try backup.importRoomKeys(data, passphrase: passphrase, progressListener: self) |
@@ -228,6 +231,14 @@ class CryptoBackupStub: MXCryptoBackup { | |||
roomKeysSpy = roomKeys | |||
return KeysImportResult(imported: Int64(roomKeys.count), total: Int64(roomKeys.count), keys: [:]) | |||
} | |||
|
|||
func exportRoomKeys(passphrase: String) throws -> Data { | |||
return Data() |
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.
return Data() | |
.init() |
} | ||
|
||
func importRoomKeys(_ data: Data, passphrase: String, progressListener: ProgressListener) throws -> KeysImportResult { | ||
return KeysImportResult(imported: 0, total: 0, keys: [:]) |
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.
return KeysImportResult(imported: 0, total: 0, keys: [:]) | |
.init(imported: 0, total: 0, keys: [:]) |