]> git.ipfire.org Git - thirdparty/wireguard-apple.git/commitdiff
Keychain: remove class constraint when copying
authorJason A. Donenfeld <Jason@zx2c4.com>
Wed, 22 Sep 2021 14:51:25 +0000 (16:51 +0200)
committerJason A. Donenfeld <Jason@zx2c4.com>
Wed, 22 Sep 2021 14:51:25 +0000 (16:51 +0200)
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Sources/Shared/Keychain.swift

index 5400c67e128c524bed471fd1ed96d570898e6f70..fb00062f498be9a808b7c1262df1e43ef5681564 100644 (file)
@@ -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
     }
 }