From 6af8041fb44aa6cfbb9ae765a61c88b6854c3315 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Damir=20Jeli=C4=87?= Date: Tue, 30 Mar 2021 13:47:30 +0200 Subject: [PATCH] crypto: Remove the second key export method --- .../sdk/internal/crypto/DefaultCryptoService.kt | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/DefaultCryptoService.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/DefaultCryptoService.kt index 4de42be3a4..e14f6f4e0b 100755 --- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/DefaultCryptoService.kt +++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/DefaultCryptoService.kt @@ -808,24 +808,12 @@ internal class DefaultCryptoService @Inject constructor( override fun exportRoomKeys(password: String, callback: MatrixCallback) { cryptoCoroutineScope.launch(coroutineDispatchers.main) { runCatching { - exportRoomKeys(password, MXMegolmExportEncryption.DEFAULT_ITERATION_COUNT) + val iterationCount = max(10000, MXMegolmExportEncryption.DEFAULT_ITERATION_COUNT) + olmMachine!!.exportKeys(password, iterationCount) }.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) - } - } - /** * Import the room keys *