diff --git a/app/src/main/kotlin/com/wire/android/ui/home/conversations/details/options/GroupConversationOptions.kt b/app/src/main/kotlin/com/wire/android/ui/home/conversations/details/options/GroupConversationOptions.kt index 70f7140b473..7ff4d8524cc 100644 --- a/app/src/main/kotlin/com/wire/android/ui/home/conversations/details/options/GroupConversationOptions.kt +++ b/app/src/main/kotlin/com/wire/android/ui/home/conversations/details/options/GroupConversationOptions.kt @@ -155,12 +155,10 @@ fun GroupConversationSettings( onCheckedChange = onReadReceiptSwitchClicked ) } - if (state.mlsEnabled) { - item { - ConversationProtocolDetails( - protocolInfo = state.protocolInfo - ) - } + item { + ConversationProtocolDetails( + protocolInfo = state.protocolInfo + ) } } } @@ -171,29 +169,27 @@ fun ConversationProtocolDetails( ) { Column { FolderHeader(name = stringResource(R.string.folder_label_protocol_details)) - if (protocolInfo is Conversation.ProtocolInfo.MLS || BuildConfig.MLS_SUPPORT_ENABLED) { + ProtocolDetails( + label = UIText.StringResource(R.string.protocol), + text = UIText.DynamicString(protocolInfo.name()) + ) + + if (protocolInfo is Conversation.ProtocolInfo.MLS) { ProtocolDetails( - label = UIText.StringResource(R.string.protocol), - text = UIText.DynamicString(protocolInfo.name()) + label = UIText.StringResource(R.string.cipher_suite), + text = UIText.DynamicString(protocolInfo.cipherSuite.toString()) ) - if (protocolInfo is Conversation.ProtocolInfo.MLS) { + if (BuildConfig.PRIVATE_BUILD) { ProtocolDetails( - label = UIText.StringResource(R.string.cipher_suite), - text = UIText.DynamicString(protocolInfo.cipherSuite.toString()) + label = UIText.StringResource(R.string.last_key_material_update_label), + text = UIText.DynamicString(protocolInfo.keyingMaterialLastUpdate.toString()) ) - if (BuildConfig.PRIVATE_BUILD) { - ProtocolDetails( - label = UIText.StringResource(R.string.last_key_material_update_label), - text = UIText.DynamicString(protocolInfo.keyingMaterialLastUpdate.toString()) - ) - - ProtocolDetails( - label = UIText.StringResource(R.string.group_state_label), - text = UIText.DynamicString(protocolInfo.groupState.name) - ) - } + ProtocolDetails( + label = UIText.StringResource(R.string.group_state_label), + text = UIText.DynamicString(protocolInfo.groupState.name) + ) } } } diff --git a/app/src/main/kotlin/com/wire/android/ui/settings/devices/DeviceDetailsScreen.kt b/app/src/main/kotlin/com/wire/android/ui/settings/devices/DeviceDetailsScreen.kt index 4c5e0868454..fbb5691ce93 100644 --- a/app/src/main/kotlin/com/wire/android/ui/settings/devices/DeviceDetailsScreen.kt +++ b/app/src/main/kotlin/com/wire/android/ui/settings/devices/DeviceDetailsScreen.kt @@ -196,6 +196,12 @@ fun DeviceDetailsContent( ) { state.device.mlsClientIdentity?.let { identity -> item { + FolderHeader( + name = stringResource(id = R.string.label_mls_signature, state.mlsCipherSuiteSignature.orEmpty()).uppercase(), + modifier = Modifier + .background(MaterialTheme.wireColorScheme.background) + .fillMaxWidth() + ) DeviceMLSSignatureItem(identity.thumbprint, screenState::copyMessage) Divider(color = MaterialTheme.wireColorScheme.background) } diff --git a/app/src/main/kotlin/com/wire/android/ui/settings/devices/DeviceDetailsViewModel.kt b/app/src/main/kotlin/com/wire/android/ui/settings/devices/DeviceDetailsViewModel.kt index 918a201abb2..8f4930cea4c 100644 --- a/app/src/main/kotlin/com/wire/android/ui/settings/devices/DeviceDetailsViewModel.kt +++ b/app/src/main/kotlin/com/wire/android/ui/settings/devices/DeviceDetailsViewModel.kt @@ -35,6 +35,7 @@ import com.wire.kalium.logic.CoreFailure import com.wire.kalium.logic.data.client.ClientType import com.wire.kalium.logic.data.client.DeleteClientParam import com.wire.kalium.logic.data.conversation.ClientId +import com.wire.kalium.logic.data.mlspublickeys.MLSPublicKeyType import com.wire.kalium.logic.data.user.UserId import com.wire.kalium.logic.feature.client.ClientFingerprintUseCase import com.wire.kalium.logic.feature.client.DeleteClientResult @@ -174,6 +175,9 @@ class DeviceDetailsViewModel @Inject constructor( isCurrentDevice = result.isCurrentClient, removeDeviceDialogState = RemoveDeviceDialogState.Hidden, canBeRemoved = !result.isCurrentClient && isSelfClient && result.client.type == ClientType.Permanent, + mlsCipherSuiteSignature = MLSPublicKeyType.from( + result.client.mlsPublicKeys?.keys?.firstOrNull().orEmpty() + ).let { mapCipherSuiteSignatureToShortName(it) } ) } } @@ -181,6 +185,17 @@ class DeviceDetailsViewModel @Inject constructor( } } + private fun mapCipherSuiteSignatureToShortName(signature: MLSPublicKeyType): String { + return when (signature) { + MLSPublicKeyType.ECDSA_SECP256R1_SHA256 -> "P256" + MLSPublicKeyType.ECDSA_SECP384R1_SHA384 -> "P384" + MLSPublicKeyType.ECDSA_SECP521R1_SHA512 -> "P521" + MLSPublicKeyType.ED25519 -> "ED25519" + MLSPublicKeyType.ED448 -> "ED448" + is MLSPublicKeyType.Unknown -> "Unknown" + } + } + fun removeDevice(onSuccess: () -> Unit) { viewModelScope.launch { val isPasswordRequired: Boolean = when (val passwordRequiredResult = isPasswordRequired()) { diff --git a/app/src/main/kotlin/com/wire/android/ui/settings/devices/model/DeviceDetailsState.kt b/app/src/main/kotlin/com/wire/android/ui/settings/devices/model/DeviceDetailsState.kt index b68745619e9..96216d33068 100644 --- a/app/src/main/kotlin/com/wire/android/ui/settings/devices/model/DeviceDetailsState.kt +++ b/app/src/main/kotlin/com/wire/android/ui/settings/devices/model/DeviceDetailsState.kt @@ -37,5 +37,6 @@ data class DeviceDetailsState( val isE2EICertificateEnrollSuccess: Boolean = false, val isE2EICertificateEnrollError: Boolean = false, val isE2EIEnabled: Boolean = false, - val startGettingE2EICertificate: Boolean = false + val startGettingE2EICertificate: Boolean = false, + val mlsCipherSuiteSignature: String? = null, ) diff --git a/kalium b/kalium index c5c24685027..f9fcff1f31e 160000 --- a/kalium +++ b/kalium @@ -1 +1 @@ -Subproject commit c5c24685027a629022cabe70750ff62d7edc48ff +Subproject commit f9fcff1f31e4b5e4482e796cd41e7a02c917559a