Skip to content

Commit

Permalink
use CC vrc.56.hotfix.2
Browse files Browse the repository at this point in the history
  • Loading branch information
MohamadJaara committed May 6, 2024
1 parent ec0a547 commit a50a929
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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<ClientId>,
Expand All @@ -61,7 +61,7 @@ private class Callbacks : CoreCryptoCallbacks {
return true
}

override suspend fun userAuthorize(
override fun userAuthorize(
conversationId: ConversationId,
externalClientId: ClientId,
existingClients: List<ClientId>
Expand Down
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

0 comments on commit a50a929

Please sign in to comment.