diff options
-rw-r--r-- | WireGuard/WireGuard/UI/TunnelViewModel.swift | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/WireGuard/WireGuard/UI/TunnelViewModel.swift b/WireGuard/WireGuard/UI/TunnelViewModel.swift index d542f98..7e19bb7 100644 --- a/WireGuard/WireGuard/UI/TunnelViewModel.swift +++ b/WireGuard/WireGuard/UI/TunnelViewModel.swift @@ -64,9 +64,7 @@ class TunnelViewModel { scratchpad[field] = stringValue } if field == .privateKey { - if (stringValue.count == TunnelViewModel.keyLengthInBase64), - let privateKey = Data(base64Encoded: stringValue), - privateKey.count == TunnelConfiguration.keyLength { + if stringValue.count == TunnelViewModel.keyLengthInBase64, let privateKey = Data(base64Encoded: stringValue), privateKey.count == TunnelConfiguration.keyLength { let publicKey = Curve25519.generatePublicKey(fromPrivateKey: privateKey) scratchpad[.publicKey] = publicKey.base64EncodedString() } else { |