aboutsummaryrefslogtreecommitdiffstats
path: root/WireGuard/WireGuard/ZipArchive
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2018-12-22 00:28:18 +0100
committerJason A. Donenfeld <Jason@zx2c4.com>2018-12-22 00:28:18 +0100
commit4ed646973ee4e1871cda792083bf4fe70afa8c3f (patch)
tree4f7df25ce19ada60ed792c729e562cb2b367a72b /WireGuard/WireGuard/ZipArchive
parentFix paren typo (diff)
downloadwireguard-apple-4ed646973ee4e1871cda792083bf4fe70afa8c3f.tar.xz
wireguard-apple-4ed646973ee4e1871cda792083bf4fe70afa8c3f.zip
Move name from interface to tunnel
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'WireGuard/WireGuard/ZipArchive')
-rw-r--r--WireGuard/WireGuard/ZipArchive/ZipExporter.swift2
-rw-r--r--WireGuard/WireGuard/ZipArchive/ZipImporter.swift2
2 files changed, 2 insertions, 2 deletions
diff --git a/WireGuard/WireGuard/ZipArchive/ZipExporter.swift b/WireGuard/WireGuard/ZipArchive/ZipExporter.swift
index 052242ad..1f7c2da9 100644
--- a/WireGuard/WireGuard/ZipArchive/ZipExporter.swift
+++ b/WireGuard/WireGuard/ZipArchive/ZipExporter.swift
@@ -23,7 +23,7 @@ class ZipExporter {
var lastTunnelName: String = ""
for tunnelConfiguration in tunnelConfigurations {
if let contents = tunnelConfiguration.asWgQuickConfig().data(using: .utf8) {
- let name = tunnelConfiguration.interface.name ?? ""
+ let name = tunnelConfiguration.name ?? "untitled"
if name.isEmpty || name == lastTunnelName { continue }
inputsToArchiver.append((fileName: "\(name).conf", contents: contents))
lastTunnelName = name
diff --git a/WireGuard/WireGuard/ZipArchive/ZipImporter.swift b/WireGuard/WireGuard/ZipArchive/ZipImporter.swift
index a8819e27..18a00e8b 100644
--- a/WireGuard/WireGuard/ZipArchive/ZipImporter.swift
+++ b/WireGuard/WireGuard/ZipArchive/ZipImporter.swift
@@ -44,7 +44,7 @@ class ZipImporter {
continue
}
guard let fileContents = String(data: file.contents, encoding: .utf8) else { continue }
- guard let tunnelConfig = try? TunnelConfiguration(fileContents, name: file.fileBaseName) else { continue }
+ guard let tunnelConfig = try? TunnelConfiguration(fromWgQuickConfig: fileContents, called: file.fileBaseName) else { continue }
configs[index] = tunnelConfig
}
DispatchQueue.main.async { completion(.success(configs)) }