From a50a9298c07676f709d6b060cee6c1791896f4a6 Mon Sep 17 00:00:00 2001 From: MohamadJaara Date: Mon, 6 May 2024 20:51:52 +0200 Subject: [PATCH] use CC vrc.56.hotfix.2 --- .../CoreCryptoCentral.kt | 8 ++--- gradle/libs.versions.toml | 2 +- .../kalium/logic/CoreCryptoExceptionMapper.kt | 30 +++++++++---------- 3 files changed, 20 insertions(+), 20 deletions(-) diff --git a/cryptography/src/commonJvmAndroid/kotlin/com.wire.kalium.cryptography/CoreCryptoCentral.kt b/cryptography/src/commonJvmAndroid/kotlin/com.wire.kalium.cryptography/CoreCryptoCentral.kt index b3e831bf892..5eefcb16f63 100644 --- a/cryptography/src/commonJvmAndroid/kotlin/com.wire.kalium.cryptography/CoreCryptoCentral.kt +++ b/cryptography/src/commonJvmAndroid/kotlin/com.wire.kalium.cryptography/CoreCryptoCentral.kt @@ -34,7 +34,7 @@ actual suspend fun coreCryptoCentral( ): CoreCryptoCentral { val path = "$rootDir/${CoreCryptoCentralImpl.KEYSTORE_NAME}" File(rootDir).mkdirs() - val coreCrypto = coreCryptoDeferredInit(path, databaseKey) + val coreCrypto = coreCryptoDeferredInit(path, databaseKey, allowedCipherSuites, null) coreCrypto.setCallbacks(Callbacks()) return CoreCryptoCentralImpl( cc = coreCrypto, @@ -46,12 +46,12 @@ actual suspend fun coreCryptoCentral( private class Callbacks : CoreCryptoCallbacks { - override suspend fun authorize(conversationId: ByteArray, clientId: ClientId): Boolean { + override fun authorize(conversationId: ByteArray, clientId: ClientId): Boolean { // We always return true because our BE is currently enforcing that this constraint is always true return true } - override suspend fun clientIsExistingGroupUser( + override fun clientIsExistingGroupUser( conversationId: ConversationId, clientId: ClientId, existingClients: List, @@ -61,7 +61,7 @@ private class Callbacks : CoreCryptoCallbacks { return true } - override suspend fun userAuthorize( + override fun userAuthorize( conversationId: ConversationId, externalClientId: ClientId, existingClients: List diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 9aa75fe1766..25b0685c396 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -37,7 +37,7 @@ pbandk = "0.14.2" turbine = "1.0.0" avs = "9.6.13" jna = "5.14.0" -core-crypto = "1.0.0-rc.59" +core-crypto = "1.0.0-rc.56-hotfix.2" core-crypto-multiplatform = "0.6.0-rc.3-multiplatform-pre1" completeKotlin = "1.1.0" desugar-jdk = "2.0.4" diff --git a/logic/src/commonJvmAndroid/kotlin/com/wire/kalium/logic/CoreCryptoExceptionMapper.kt b/logic/src/commonJvmAndroid/kotlin/com/wire/kalium/logic/CoreCryptoExceptionMapper.kt index 78f27826907..d4ba1b1e45e 100644 --- a/logic/src/commonJvmAndroid/kotlin/com/wire/kalium/logic/CoreCryptoExceptionMapper.kt +++ b/logic/src/commonJvmAndroid/kotlin/com/wire/kalium/logic/CoreCryptoExceptionMapper.kt @@ -21,19 +21,19 @@ import com.wire.crypto.CoreCryptoException import uniffi.core_crypto.CryptoError actual fun mapMLSException(exception: Exception): MLSFailure = - if (exception is CoreCryptoException.CryptoException) { - when (exception.error) { - CryptoError.WRONG_EPOCH -> MLSFailure.WrongEpoch - CryptoError.DUPLICATE_MESSAGE -> MLSFailure.DuplicateMessage - CryptoError.BUFFERED_FUTURE_MESSAGE -> MLSFailure.BufferedFutureMessage - CryptoError.SELF_COMMIT_IGNORED -> MLSFailure.SelfCommitIgnored - CryptoError.UNMERGED_PENDING_GROUP -> MLSFailure.UnmergedPendingGroup - CryptoError.STALE_PROPOSAL -> MLSFailure.StaleProposal - CryptoError.STALE_COMMIT -> MLSFailure.StaleCommit - CryptoError.CONVERSATION_ALREADY_EXISTS -> MLSFailure.ConversationAlreadyExists - CryptoError.MESSAGE_EPOCH_TOO_OLD -> MLSFailure.MessageEpochTooOld - else -> MLSFailure.Generic(exception) - } - } else { - MLSFailure.Generic(exception) + if (exception is CoreCryptoException.CryptoException) { + when (exception.error) { + is CryptoError.WrongEpoch -> MLSFailure.WrongEpoch + is CryptoError.DuplicateMessage -> MLSFailure.DuplicateMessage + is CryptoError.BufferedFutureMessage -> MLSFailure.BufferedFutureMessage + is CryptoError.SelfCommitIgnored -> MLSFailure.SelfCommitIgnored + is CryptoError.UnmergedPendingGroup -> MLSFailure.UnmergedPendingGroup + is CryptoError.StaleProposal -> MLSFailure.StaleProposal + is CryptoError.StaleCommit -> MLSFailure.StaleCommit + is CryptoError.ConversationAlreadyExists -> MLSFailure.ConversationAlreadyExists + is CryptoError.MessageEpochTooOld -> MLSFailure.MessageEpochTooOld + else -> MLSFailure.Generic(exception) } + } else { + MLSFailure.Generic(exception) + }