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

0 commit comments

Comments
 (0)