Add public device keys to rageshakes
This commit is contained in:
@@ -50,4 +50,16 @@ interface EncryptionService {
|
||||
* Wait for backup upload steady state.
|
||||
*/
|
||||
fun waitForBackupUploadSteadyState(): Flow<BackupUploadState>
|
||||
|
||||
/**
|
||||
* Get the public curve25519 key of our own device in base64. This is usually what is
|
||||
* called the identity key of the device.
|
||||
*/
|
||||
suspend fun deviceCurve25519(): String?
|
||||
|
||||
/**
|
||||
* Get the public ed25519 key of our own device. This is usually what is
|
||||
* called the fingerprint of the device.
|
||||
*/
|
||||
suspend fun deviceEd25519(): String?
|
||||
}
|
||||
|
||||
@@ -190,4 +190,12 @@ internal class RustEncryptionService(
|
||||
it.mapRecoveryException()
|
||||
}
|
||||
}
|
||||
|
||||
override suspend fun deviceCurve25519(): String? {
|
||||
return service.curve25519Key()
|
||||
}
|
||||
|
||||
override suspend fun deviceEd25519(): String? {
|
||||
return service.ed25519Key()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,6 +39,9 @@ class FakeEncryptionService : EncryptionService {
|
||||
|
||||
private var enableBackupsFailure: Exception? = null
|
||||
|
||||
private var curve25519: String? = null
|
||||
private var ed25519: String? = null
|
||||
|
||||
fun givenEnableBackupsFailure(exception: Exception?) {
|
||||
enableBackupsFailure = exception
|
||||
}
|
||||
@@ -94,6 +97,15 @@ class FakeEncryptionService : EncryptionService {
|
||||
return waitForBackupUploadSteadyStateFlow
|
||||
}
|
||||
|
||||
fun givenDeviceKeys(curve25519: String?, ed25519: String?) {
|
||||
this.curve25519 = curve25519
|
||||
this.ed25519 = ed25519
|
||||
}
|
||||
|
||||
override suspend fun deviceCurve25519(): String? = curve25519
|
||||
|
||||
override suspend fun deviceEd25519(): String? = ed25519
|
||||
|
||||
suspend fun emitBackupState(state: BackupState) {
|
||||
backupStateStateFlow.emit(state)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user