From 989b6c41e52ebaffa71585e29ab092259c1430a0 Mon Sep 17 00:00:00 2001 From: Garth Vander Houwen Date: Sun, 10 Mar 2024 00:25:02 -0800 Subject: [PATCH] Add 1 byte key to channel validation. --- Meshtastic/Views/Settings/Channels.swift | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Meshtastic/Views/Settings/Channels.swift b/Meshtastic/Views/Settings/Channels.swift index 0f5cc6e5..db9c9a03 100644 --- a/Meshtastic/Views/Settings/Channels.swift +++ b/Meshtastic/Views/Settings/Channels.swift @@ -68,6 +68,8 @@ struct Channels: View { channelKeySize = 0 } else if channelKey == "AQ==" { channelKeySize = -1 + } else if channelKey.count == 4 { + channelKeySize = 1 } else if channelKey.count == 24 { channelKeySize = 16 } else if channelKey.count == 32 { @@ -303,7 +305,7 @@ struct Channels: View { } .onAppear { let tempKey = Data(base64Encoded: channelKey) ?? Data() - if tempKey.count == channelKeySize || channelKeySize == -1{ + if tempKey.count == channelKeySize || channelKeySize == -1 { hasValidKey = true } else {