sforkowany z mirror/meshtastic-android
fix: allow empty (no crypto) and 128 bit PSKs
rodzic
41d0315b63
commit
d1ce014a88
|
|
@ -90,9 +90,9 @@ fun EditChannelDialog(
|
||||||
value = pskString,
|
value = pskString,
|
||||||
onValueChange = {
|
onValueChange = {
|
||||||
try {
|
try {
|
||||||
pskString = it
|
pskString = it // empty (no crypto), 128 or 256 bit only
|
||||||
val decoded = Base64.decode(it, base64Flags).toByteString()
|
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) {
|
} catch (ex: Throwable) {
|
||||||
// Base64 decode failed, pskError true
|
// Base64 decode failed, pskError true
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Ładowanie…
Reference in New Issue