Skip to content

Commit f745d0c

Browse files
committed
Merge branch 'master' into keeshux/fix-additional-targets
2 parents d3b8f1a + 2fec12a commit f745d0c

File tree

132 files changed

+898
-305
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

132 files changed

+898
-305
lines changed

COPYING

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright © 2018-2021 WireGuard LLC. All Rights Reserved.
1+
Copyright © 2018-2023 WireGuard LLC. All Rights Reserved.
22

33
Permission is hereby granted, free of charge, to any person obtaining a copy of
44
this software and associated documentation files (the "Software"), to deal in

Package.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ import PackageDescription
66
let package = Package(
77
name: "WireGuardKit",
88
platforms: [
9-
.macOS(.v10_14),
10-
.iOS(.v12)
9+
.macOS(.v12),
10+
.iOS(.v15)
1111
],
1212
products: [
1313
.library(name: "WireGuardKit", targets: ["WireGuardKit"])

README.md

Lines changed: 1 addition & 1 deletion

Sources/Shared/FileManager+Extension.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// SPDX-License-Identifier: MIT
2-
// Copyright © 2018-2021 WireGuard LLC. All Rights Reserved.
2+
// Copyright © 2018-2023 WireGuard LLC. All Rights Reserved.
33

44
import Foundation
55
import os.log

Sources/Shared/Keychain.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// SPDX-License-Identifier: MIT
2-
// Copyright © 2018-2021 WireGuard LLC. All Rights Reserved.
2+
// Copyright © 2018-2023 WireGuard LLC. All Rights Reserved.
33

44
import Foundation
55
import Security

Sources/Shared/Logging/Logger.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// SPDX-License-Identifier: MIT
2-
// Copyright © 2018-2021 WireGuard LLC. All Rights Reserved.
2+
// Copyright © 2018-2023 WireGuard LLC. All Rights Reserved.
33

44
import Foundation
55
import os.log

Sources/Shared/Logging/ringlogger.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* SPDX-License-Identifier: MIT
22
*
3-
* Copyright © 2018-2021 WireGuard LLC. All Rights Reserved.
3+
* Copyright © 2018-2023 WireGuard LLC. All Rights Reserved.
44
*/
55

66
#include <string.h>

Sources/Shared/Logging/ringlogger.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* SPDX-License-Identifier: MIT
22
*
3-
* Copyright © 2018-2021 WireGuard LLC. All Rights Reserved.
3+
* Copyright © 2018-2023 WireGuard LLC. All Rights Reserved.
44
*/
55

66
#ifndef RINGLOGGER_H

Sources/Shared/Model/NETunnelProviderProtocol+Extension.swift

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// SPDX-License-Identifier: MIT
2-
// Copyright © 2018-2021 WireGuard LLC. All Rights Reserved.
2+
// Copyright © 2018-2023 WireGuard LLC. All Rights Reserved.
33

44
import NetworkExtension
55

@@ -82,24 +82,22 @@ extension NETunnelProviderProtocol {
8282
return true
8383
}
8484
#elseif os(iOS)
85-
if #available(iOS 15, *) {
86-
/* Update the stored reference from the old iOS 14 one to the canonical iOS 15 one.
87-
* The iOS 14 ones are 96 bits, while the iOS 15 ones are 160 bits. We do this so
88-
* that we can have fast set exclusion in deleteReferences safely. */
89-
if passwordReference != nil && passwordReference!.count == 12 {
90-
var result: CFTypeRef?
91-
let ret = SecItemCopyMatching([kSecValuePersistentRef: passwordReference!,
92-
kSecReturnPersistentRef: true] as CFDictionary,
93-
&result)
94-
if ret != errSecSuccess || result == nil {
95-
return false
96-
}
97-
guard let newReference = result as? Data else { return false }
98-
if !newReference.elementsEqual(passwordReference!) {
99-
wg_log(.info, message: "Migrating iOS 14-style keychain reference to iOS 15-style keychain reference for '\(name)'")
100-
passwordReference = newReference
101-
return true
102-
}
85+
/* Update the stored reference from the old iOS 14 one to the canonical iOS 15 one.
86+
* The iOS 14 ones are 96 bits, while the iOS 15 ones are 160 bits. We do this so
87+
* that we can have fast set exclusion in deleteReferences safely. */
88+
if passwordReference != nil && passwordReference!.count == 12 {
89+
var result: CFTypeRef?
90+
let ret = SecItemCopyMatching([kSecValuePersistentRef: passwordReference!,
91+
kSecReturnPersistentRef: true] as CFDictionary,
92+
&result)
93+
if ret != errSecSuccess || result == nil {
94+
return false
95+
}
96+
guard let newReference = result as? Data else { return false }
97+
if !newReference.elementsEqual(passwordReference!) {
98+
wg_log(.info, message: "Migrating iOS 14-style keychain reference to iOS 15-style keychain reference for '\(name)'")
99+
passwordReference = newReference
100+
return true
103101
}
104102
}
105103
#endif

Sources/Shared/Model/String+ArrayConversion.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// SPDX-License-Identifier: MIT
2-
// Copyright © 2018-2021 WireGuard LLC. All Rights Reserved.
2+
// Copyright © 2018-2023 WireGuard LLC. All Rights Reserved.
33

44
import Foundation
55

Sources/Shared/Model/TunnelConfiguration+WgQuickConfig.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// SPDX-License-Identifier: MIT
2-
// Copyright © 2018-2021 WireGuard LLC. All Rights Reserved.
2+
// Copyright © 2018-2023 WireGuard LLC. All Rights Reserved.
33

44
import Foundation
55

Sources/Shared/NotificationToken.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// SPDX-License-Identifier: MIT
2-
// Copyright © 2018-2021 WireGuard LLC. All Rights Reserved.
2+
// Copyright © 2018-2023 WireGuard LLC. All Rights Reserved.
33

44
import Foundation
55

Sources/WireGuardApp/Base.lproj/InfoPlist.strings

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// SPDX-License-Identifier: MIT
2-
// Copyright © 2018-2021 WireGuard LLC. All Rights Reserved.
2+
// Copyright © 2018-2023 WireGuard LLC. All Rights Reserved.
33

44
// iOS permission prompts
55

Sources/WireGuardApp/Base.lproj/Localizable.strings

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// SPDX-License-Identifier: MIT
2-
// Copyright © 2018-2021 WireGuard LLC. All Rights Reserved.
2+
// Copyright © 2018-2023 WireGuard LLC. All Rights Reserved.
33

44
// Generic alert action names
55

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
VERSION_NAME = 1.0.15
2-
VERSION_ID = 26
1+
VERSION_NAME = 1.0.16
2+
VERSION_ID = 27

Sources/WireGuardApp/LocalizationHelper.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// SPDX-License-Identifier: MIT
2-
// Copyright © 2018-2021 WireGuard LLC. All Rights Reserved.
2+
// Copyright © 2018-2023 WireGuard LLC. All Rights Reserved.
33

44
import Foundation
55

Sources/WireGuardApp/Tunnel/ActivateOnDemandOption.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// SPDX-License-Identifier: MIT
2-
// Copyright © 2018-2021 WireGuard LLC. All Rights Reserved.
2+
// Copyright © 2018-2023 WireGuard LLC. All Rights Reserved.
33

44
import NetworkExtension
55

Sources/WireGuardApp/Tunnel/MockTunnels.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// SPDX-License-Identifier: MIT
2-
// Copyright © 2018-2021 WireGuard LLC. All Rights Reserved.
2+
// Copyright © 2018-2023 WireGuard LLC. All Rights Reserved.
33

44
import NetworkExtension
55

Sources/WireGuardApp/Tunnel/TunnelConfiguration+UapiConfig.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// SPDX-License-Identifier: MIT
2-
// Copyright © 2018-2021 WireGuard LLC. All Rights Reserved.
2+
// Copyright © 2018-2023 WireGuard LLC. All Rights Reserved.
33

44
import Foundation
55

Sources/WireGuardApp/Tunnel/TunnelErrors.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// SPDX-License-Identifier: MIT
2-
// Copyright © 2018-2021 WireGuard LLC. All Rights Reserved.
2+
// Copyright © 2018-2023 WireGuard LLC. All Rights Reserved.
33

44
import NetworkExtension
55

Sources/WireGuardApp/Tunnel/TunnelStatus.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// SPDX-License-Identifier: MIT
2-
// Copyright © 2018-2021 WireGuard LLC. All Rights Reserved.
2+
// Copyright © 2018-2023 WireGuard LLC. All Rights Reserved.
33

44
import Foundation
55
import NetworkExtension

Sources/WireGuardApp/Tunnel/TunnelsManager.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// SPDX-License-Identifier: MIT
2-
// Copyright © 2018-2021 WireGuard LLC. All Rights Reserved.
2+
// Copyright © 2018-2023 WireGuard LLC. All Rights Reserved.
33

44
import Foundation
55
import NetworkExtension

Sources/WireGuardApp/UI/ActivateOnDemandViewModel.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// SPDX-License-Identifier: MIT
2-
// Copyright © 2018-2021 WireGuard LLC. All Rights Reserved.
2+
// Copyright © 2018-2023 WireGuard LLC. All Rights Reserved.
33

44
import Foundation
55

Sources/WireGuardApp/UI/ErrorPresenterProtocol.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// SPDX-License-Identifier: MIT
2-
// Copyright © 2018-2021 WireGuard LLC. All Rights Reserved.
2+
// Copyright © 2018-2023 WireGuard LLC. All Rights Reserved.
33

44
protocol ErrorPresenterProtocol {
55
static func showErrorAlert(title: String, message: String, from sourceVC: AnyObject?, onPresented: (() -> Void)?, onDismissal: (() -> Void)?)

Sources/WireGuardApp/UI/LogViewHelper.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// SPDX-License-Identifier: MIT
2-
// Copyright © 2018-2021 WireGuard LLC. All Rights Reserved.
2+
// Copyright © 2018-2023 WireGuard LLC. All Rights Reserved.
33

44
import Foundation
55

Sources/WireGuardApp/UI/PrivateDataConfirmation.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// SPDX-License-Identifier: MIT
2-
// Copyright © 2018-2021 WireGuard LLC. All Rights Reserved.
2+
// Copyright © 2018-2023 WireGuard LLC. All Rights Reserved.
33

44
import Foundation
55
import LocalAuthentication

Sources/WireGuardApp/UI/TunnelImporter.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// SPDX-License-Identifier: MIT
2-
// Copyright © 2018-2021 WireGuard LLC. All Rights Reserved.
2+
// Copyright © 2018-2023 WireGuard LLC. All Rights Reserved.
33

44
import Foundation
55

Sources/WireGuardApp/UI/TunnelViewModel.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// SPDX-License-Identifier: MIT
2-
// Copyright © 2018-2021 WireGuard LLC. All Rights Reserved.
2+
// Copyright © 2018-2023 WireGuard LLC. All Rights Reserved.
33

44
import Foundation
55

Sources/WireGuardApp/UI/iOS/AppDelegate.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// SPDX-License-Identifier: MIT
2-
// Copyright © 2018-2021 WireGuard LLC. All Rights Reserved.
2+
// Copyright © 2018-2023 WireGuard LLC. All Rights Reserved.
33

44
import UIKit
55
import os.log

Sources/WireGuardApp/UI/iOS/ConfirmationAlertPresenter.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// SPDX-License-Identifier: MIT
2-
// Copyright © 2018-2021 WireGuard LLC. All Rights Reserved.
2+
// Copyright © 2018-2023 WireGuard LLC. All Rights Reserved.
33

44
import UIKit
55

Sources/WireGuardApp/UI/iOS/ErrorPresenter.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// SPDX-License-Identifier: MIT
2-
// Copyright © 2018-2021 WireGuard LLC. All Rights Reserved.
2+
// Copyright © 2018-2023 WireGuard LLC. All Rights Reserved.
33

44
import UIKit
55
import os.log

Sources/WireGuardApp/UI/iOS/QuickActionItem.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// SPDX-License-Identifier: MIT
2-
// Copyright © 2018-2021 WireGuard LLC. All Rights Reserved.
2+
// Copyright © 2018-2023 WireGuard LLC. All Rights Reserved.
33

44
import UIKit
55

Sources/WireGuardApp/UI/iOS/RecentTunnelsTracker.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// SPDX-License-Identifier: MIT
2-
// Copyright © 2018-2021 WireGuard LLC. All Rights Reserved.
2+
// Copyright © 2018-2023 WireGuard LLC. All Rights Reserved.
33

44
import Foundation
55

Sources/WireGuardApp/UI/iOS/UITableViewCell+Reuse.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// SPDX-License-Identifier: MIT
2-
// Copyright © 2018-2021 WireGuard LLC. All Rights Reserved.
2+
// Copyright © 2018-2023 WireGuard LLC. All Rights Reserved.
33

44
import UIKit
55

Sources/WireGuardApp/UI/iOS/View/BorderedTextButton.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// SPDX-License-Identifier: MIT
2-
// Copyright © 2018-2021 WireGuard LLC. All Rights Reserved.
2+
// Copyright © 2018-2023 WireGuard LLC. All Rights Reserved.
33

44
import UIKit
55

Sources/WireGuardApp/UI/iOS/View/ButtonCell.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// SPDX-License-Identifier: MIT
2-
// Copyright © 2018-2021 WireGuard LLC. All Rights Reserved.
2+
// Copyright © 2018-2023 WireGuard LLC. All Rights Reserved.
33

44
import UIKit
55

Sources/WireGuardApp/UI/iOS/View/CheckmarkCell.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// SPDX-License-Identifier: MIT
2-
// Copyright © 2018-2021 WireGuard LLC. All Rights Reserved.
2+
// Copyright © 2018-2023 WireGuard LLC. All Rights Reserved.
33

44
import UIKit
55

Sources/WireGuardApp/UI/iOS/View/ChevronCell.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// SPDX-License-Identifier: MIT
2-
// Copyright © 2018-2021 WireGuard LLC. All Rights Reserved.
2+
// Copyright © 2018-2023 WireGuard LLC. All Rights Reserved.
33

44
import UIKit
55

Sources/WireGuardApp/UI/iOS/View/EditableTextCell.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// SPDX-License-Identifier: MIT
2-
// Copyright © 2018-2021 WireGuard LLC. All Rights Reserved.
2+
// Copyright © 2018-2023 WireGuard LLC. All Rights Reserved.
33

44
import UIKit
55

Sources/WireGuardApp/UI/iOS/View/KeyValueCell.swift

Lines changed: 6 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// SPDX-License-Identifier: MIT
2-
// Copyright © 2018-2021 WireGuard LLC. All Rights Reserved.
2+
// Copyright © 2018-2023 WireGuard LLC. All Rights Reserved.
33

44
import UIKit
55

@@ -9,11 +9,7 @@ class KeyValueCell: UITableViewCell {
99
let keyLabel = UILabel()
1010
keyLabel.font = UIFont.preferredFont(forTextStyle: .body)
1111
keyLabel.adjustsFontForContentSizeCategory = true
12-
if #available(iOS 13.0, *) {
13-
keyLabel.textColor = .label
14-
} else {
15-
keyLabel.textColor = .black
16-
}
12+
keyLabel.textColor = .label
1713
keyLabel.textAlignment = .left
1814
return keyLabel
1915
}()
@@ -35,11 +31,7 @@ class KeyValueCell: UITableViewCell {
3531
valueTextField.autocapitalizationType = .none
3632
valueTextField.autocorrectionType = .no
3733
valueTextField.spellCheckingType = .no
38-
if #available(iOS 13.0, *) {
39-
valueTextField.textColor = .secondaryLabel
40-
} else {
41-
valueTextField.textColor = .gray
42-
}
34+
valueTextField.textColor = .secondaryLabel
4335
return valueTextField
4436
}()
4537

@@ -64,18 +56,10 @@ class KeyValueCell: UITableViewCell {
6456

6557
var isValueValid = true {
6658
didSet {
67-
if #available(iOS 13.0, *) {
68-
if isValueValid {
69-
keyLabel.textColor = .label
70-
} else {
71-
keyLabel.textColor = .systemRed
72-
}
59+
if isValueValid {
60+
keyLabel.textColor = .label
7361
} else {
74-
if isValueValid {
75-
keyLabel.textColor = .black
76-
} else {
77-
keyLabel.textColor = .red
78-
}
62+
keyLabel.textColor = .systemRed
7963
}
8064
}
8165
}

Sources/WireGuardApp/UI/iOS/View/SwitchCell.swift

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// SPDX-License-Identifier: MIT
2-
// Copyright © 2018-2021 WireGuard LLC. All Rights Reserved.
2+
// Copyright © 2018-2023 WireGuard LLC. All Rights Reserved.
33

44
import UIKit
55

@@ -16,11 +16,7 @@ class SwitchCell: UITableViewCell {
1616
get { return switchView.isEnabled }
1717
set(value) {
1818
switchView.isEnabled = value
19-
if #available(iOS 13.0, *) {
20-
textLabel?.textColor = value ? .label : .secondaryLabel
21-
} else {
22-
textLabel?.textColor = value ? .black : .gray
23-
}
19+
textLabel?.textColor = value ? .label : .secondaryLabel
2420
}
2521
}
2622

0 commit comments

Comments
 (0)