Keychain: store configurations in keychain instead of providerConfig

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
This commit is contained in:
Jason A. Donenfeld
2019-02-06 06:20:23 +01:00
parent a26d620f11
commit 8c3557a907
8 changed files with 201 additions and 31 deletions
+5 -2
View File
@@ -5,7 +5,7 @@ import Foundation
import os.log
extension FileManager {
private static var sharedFolderURL: URL? {
static var appGroupId: String? {
#if os(iOS)
let appGroupIdInfoDictionaryKey = "com.wireguard.ios.app_group_id"
#elseif os(macOS)
@@ -13,7 +13,10 @@ extension FileManager {
#else
#error("Unimplemented")
#endif
guard let appGroupId = Bundle.main.object(forInfoDictionaryKey: appGroupIdInfoDictionaryKey) as? String else {
return Bundle.main.object(forInfoDictionaryKey: appGroupIdInfoDictionaryKey) as? String
}
private static var sharedFolderURL: URL? {
guard let appGroupId = FileManager.appGroupId else {
os_log("Cannot obtain app group ID from bundle", log: OSLog.default, type: .error)
return nil
}