mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-04-02 05:04:37 -04:00
fix: allow empty (no crypto) and 128 bit PSKs
This commit is contained in:
@@ -90,9 +90,9 @@ fun EditChannelDialog(
|
||||
value = pskString,
|
||||
onValueChange = {
|
||||
try {
|
||||
pskString = it
|
||||
pskString = it // empty (no crypto), 128 or 256 bit only
|
||||
val decoded = Base64.decode(it, base64Flags).toByteString()
|
||||
if (decoded.size() == 32) pskInput = decoded // 256 bit only
|
||||
if (decoded.size() in setOf(0, 16, 32)) pskInput = decoded
|
||||
} catch (ex: Throwable) {
|
||||
// Base64 decode failed, pskError true
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user