mirror of
https://github.com/meshtastic/Meshtastic-Apple.git
synced 2026-04-20 22:13:56 +00:00
Update Meshtastic/Views/Settings/Config/SecurityConfig.swift
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
parent
e4b9881956
commit
d93064cd29
1 changed files with 5 additions and 4 deletions
|
|
@ -37,11 +37,12 @@ struct SecurityConfig: View {
|
|||
@State var privateKeyIsSecure = true
|
||||
|
||||
private var isValidKeyPair: Bool {
|
||||
if let privateKeyBytes = Data(base64Encoded: privateKey),
|
||||
let calculatedPublicKey = generatePublicKey(from: privateKeyBytes) {
|
||||
return calculatedPublicKey.base64EncodedString() == publicKey
|
||||
guard let privateKeyBytes = Data(base64Encoded: privateKey),
|
||||
let calculatedPublicKey = generatePublicKey(from: privateKeyBytes),
|
||||
let decodedPublicKey = Data(base64Encoded: publicKey) else {
|
||||
return false
|
||||
}
|
||||
return false
|
||||
return calculatedPublicKey == decodedPublicKey
|
||||
}
|
||||
|
||||
var body: some View {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue