fix: channel PSK validation

pull/810/head
andrekir 2024-01-10 05:27:05 -03:00
rodzic 35364a6685
commit 1691acb59d
1 zmienionych plików z 2 dodań i 1 usunięć

Wyświetl plik

@ -98,7 +98,8 @@ fun EditChannelDialog(
try {
pskString = it // empty (no crypto), 128 or 256 bit only
val decoded = Base64.decode(it, base64Flags).toByteString()
if (decoded.size() in setOf(0, 16, 32)) pskInput = decoded
val fullPsk = Channel(channelSettings { psk = decoded }).psk
if (fullPsk.size() in setOf(0, 16, 32)) pskInput = decoded
} catch (ex: Throwable) {
// Base64 decode failed, pskError true
}