Skip to content
Snippets Groups Projects
Commit cd81fd5c authored by Taras's avatar Taras
Browse files

Add BSSPEKE_ALGORITHM_BACKUP constant

parent 586b9a7c
No related branches found
No related tags found
No related merge requests found
......@@ -33,6 +33,8 @@ const val MXCRYPTO_ALGORITHM_MEGOLM_BACKUP = "m.megolm_backup.v1.curve25519-aes-
const val BCRYPT_ALGORITHM_BACKUP = "org.futo.bcrypt"
const val BSSPEKE_ALGORITHM_BACKUP = "org.futo.bsspeke-ecc"
/**
* Secured Shared Storage algorithm constant.
*/
......
......@@ -17,6 +17,7 @@
package org.matrix.android.sdk.internal.crypto.keysbackup.model.rest
import org.matrix.android.sdk.api.crypto.BCRYPT_ALGORITHM_BACKUP
import org.matrix.android.sdk.api.crypto.BSSPEKE_ALGORITHM_BACKUP
import org.matrix.android.sdk.api.crypto.MXCRYPTO_ALGORITHM_MEGOLM_BACKUP
import org.matrix.android.sdk.api.session.crypto.keysbackup.MegolmBackupAuthData
import org.matrix.android.sdk.api.util.JsonDict
......@@ -56,7 +57,11 @@ internal interface KeysAlgorithmAndData {
*/
fun getAuthDataAsMegolmBackupAuthData(): MegolmBackupAuthData? {
return MoshiProvider.providesMoshi()
.takeIf { algorithm == MXCRYPTO_ALGORITHM_MEGOLM_BACKUP || algorithm == BCRYPT_ALGORITHM_BACKUP }
.takeIf {
algorithm == MXCRYPTO_ALGORITHM_MEGOLM_BACKUP
|| algorithm == BCRYPT_ALGORITHM_BACKUP
|| algorithm == BSSPEKE_ALGORITHM_BACKUP
}
?.adapter(MegolmBackupAuthData::class.java)
?.fromJsonValue(authData)
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment