Skip to content

Commit

Permalink
fix: adjustments for short signature names (WPB-15188) πŸ’ (#3771)
Browse files Browse the repository at this point in the history
Co-authored-by: Yamil Medina <[email protected]>
  • Loading branch information
github-actions[bot] and yamilmedina authored Dec 31, 2024
1 parent 4896d60 commit 1ad848d
Showing 1 changed file with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -201,14 +201,25 @@ 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) }
)
}
}
}
}
}

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()) {
Expand Down

0 comments on commit 1ad848d

Please sign in to comment.