aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2021-09-22 16:51:25 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2021-09-22 16:51:25 +0200
commitd882a486a9d0370bf7d4a34580907e30eb6319f2 (patch)
treec0392f236c7419eb8b13f2b0351bf59a3d9ea749
parentWireGuardApp: do not delete unverifying profiles ever (diff)
downloadwireguard-apple-d882a486a9d0370bf7d4a34580907e30eb6319f2.tar.xz
wireguard-apple-d882a486a9d0370bf7d4a34580907e30eb6319f2.zip
Keychain: remove class constraint when copying
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
-rw-r--r--Sources/Shared/Keychain.swift6
1 files changed, 2 insertions, 4 deletions
diff --git a/Sources/Shared/Keychain.swift b/Sources/Shared/Keychain.swift
index 5400c67..fb00062 100644
--- a/Sources/Shared/Keychain.swift
+++ b/Sources/Shared/Keychain.swift
@@ -7,8 +7,7 @@ import Security
class Keychain {
static func openReference(called ref: Data) -> String? {
var result: CFTypeRef?
- let ret = SecItemCopyMatching([kSecClass: kSecClassGenericPassword,
- kSecValuePersistentRef: ref,
+ let ret = SecItemCopyMatching([kSecValuePersistentRef: ref,
kSecReturnData: true] as CFDictionary,
&result)
if ret != errSecSuccess || result == nil {
@@ -109,8 +108,7 @@ class Keychain {
}
static func verifyReference(called ref: Data) -> Bool {
- return SecItemCopyMatching([kSecClass: kSecClassGenericPassword,
- kSecValuePersistentRef: ref] as CFDictionary,
+ return SecItemCopyMatching([kSecValuePersistentRef: ref] as CFDictionary,
nil) != errSecItemNotFound
}
}