Fix confusing indentation

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
This commit is contained in:
Jason A. Donenfeld 2018-12-15 04:42:11 +01:00
parent ccd8cfe478
commit 1e9c806614
1 changed files with 1 additions and 3 deletions

View File

@ -64,9 +64,7 @@ class TunnelViewModel {
scratchpad[field] = stringValue scratchpad[field] = stringValue
} }
if field == .privateKey { if field == .privateKey {
if (stringValue.count == TunnelViewModel.keyLengthInBase64), if stringValue.count == TunnelViewModel.keyLengthInBase64, let privateKey = Data(base64Encoded: stringValue), privateKey.count == TunnelConfiguration.keyLength {
let privateKey = Data(base64Encoded: stringValue),
privateKey.count == TunnelConfiguration.keyLength {
let publicKey = Curve25519.generatePublicKey(fromPrivateKey: privateKey) let publicKey = Curve25519.generatePublicKey(fromPrivateKey: privateKey)
scratchpad[.publicKey] = publicKey.base64EncodedString() scratchpad[.publicKey] = publicKey.base64EncodedString()
} else { } else {