mirror of
https://github.com/element-hq/element-android
synced 2024-12-20 16:32:41 +03:00
crypto: Remove the second key export method
This commit is contained in:
parent
9d5ef01ce0
commit
6af8041fb4
1 changed files with 2 additions and 14 deletions
|
@ -808,21 +808,9 @@ internal class DefaultCryptoService @Inject constructor(
|
||||||
override fun exportRoomKeys(password: String, callback: MatrixCallback<ByteArray>) {
|
override fun exportRoomKeys(password: String, callback: MatrixCallback<ByteArray>) {
|
||||||
cryptoCoroutineScope.launch(coroutineDispatchers.main) {
|
cryptoCoroutineScope.launch(coroutineDispatchers.main) {
|
||||||
runCatching {
|
runCatching {
|
||||||
exportRoomKeys(password, MXMegolmExportEncryption.DEFAULT_ITERATION_COUNT)
|
val iterationCount = max(10000, MXMegolmExportEncryption.DEFAULT_ITERATION_COUNT)
|
||||||
}.foldToCallback(callback)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Export the crypto keys
|
|
||||||
*
|
|
||||||
* @param password the password
|
|
||||||
* @param anIterationCount the encryption iteration count
|
|
||||||
*/
|
|
||||||
private suspend fun exportRoomKeys(password: String, anIterationCount: Int): ByteArray {
|
|
||||||
return withContext(coroutineDispatchers.crypto) {
|
|
||||||
val iterationCount = max(10000, anIterationCount)
|
|
||||||
olmMachine!!.exportKeys(password, iterationCount)
|
olmMachine!!.exportKeys(password, iterationCount)
|
||||||
|
}.foldToCallback(callback)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue