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 1ca4096174..241cafd5fa 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 @@ -201,7 +201,7 @@ class DeviceDetailsViewModel @Inject constructor( canBeRemoved = !result.isCurrentClient && isSelfClient && result.client.type != ClientType.LegalHold, mlsCipherSuiteSignature = MLSPublicKeyType.from( result.client.mlsPublicKeys?.keys?.firstOrNull().orEmpty() - ).value.toString() + ).let { mapCipherSuiteSignatureToShortName(it) } ) } } @@ -209,6 +209,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()) {