mirror of
https://github.com/element-hq/element-android
synced 2024-12-20 16:32:41 +03:00
crypto: Correctly decode the byte array when importing keys
This commit is contained in:
parent
0afdcb35f1
commit
91d28658fc
1 changed files with 2 additions and 1 deletions
|
@ -19,6 +19,7 @@ package org.matrix.android.sdk.internal.crypto
|
||||||
import androidx.lifecycle.LiveData
|
import androidx.lifecycle.LiveData
|
||||||
import androidx.lifecycle.MutableLiveData
|
import androidx.lifecycle.MutableLiveData
|
||||||
import java.io.File
|
import java.io.File
|
||||||
|
import java.nio.charset.Charset
|
||||||
import java.util.concurrent.ConcurrentHashMap
|
import java.util.concurrent.ConcurrentHashMap
|
||||||
import kotlinx.coroutines.Dispatchers
|
import kotlinx.coroutines.Dispatchers
|
||||||
import kotlinx.coroutines.withContext
|
import kotlinx.coroutines.withContext
|
||||||
|
@ -388,7 +389,7 @@ internal class OlmMachine(user_id: String, device_id: String, path: File, device
|
||||||
*/
|
*/
|
||||||
@Throws(CryptoStoreErrorException::class)
|
@Throws(CryptoStoreErrorException::class)
|
||||||
suspend fun importKeys(keys: ByteArray, passphrase: String, listener: ProgressListener?): ImportRoomKeysResult = withContext(Dispatchers.IO) {
|
suspend fun importKeys(keys: ByteArray, passphrase: String, listener: ProgressListener?): ImportRoomKeysResult = withContext(Dispatchers.IO) {
|
||||||
var decodedKeys = keys.toString()
|
val decodedKeys = String(keys, Charset.defaultCharset())
|
||||||
|
|
||||||
var rustListener = CryptoProgressListener(listener)
|
var rustListener = CryptoProgressListener(listener)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue