fix warnings

This commit is contained in:
neon443 committed 2025-06-23 09:44:33 +01:00
1 parent b691224e39
commit ea857a8960
3 files changed
+6 -4

No files matched your search

+1 -1
View File
@@ -61,7 +61,7 @@ class KeyManager: ObservableObject {
} }
print(privateKey) print(privateKey)
print(SecKeyCopyPublicKey(privateKey)) print(SecKeyCopyPublicKey(privateKey) ?? "")
// do { // do {
// try storeKey(privateKey, label: label) // try storeKey(privateKey, label: label)
// } catch { // } catch {
+4 -2
View File
@@ -89,12 +89,14 @@ kSecUseDataProtectionKeychain: true,
switch SecItemCopyMatching(query as CFDictionary, &item) { switch SecItemCopyMatching(query as CFDictionary, &item) {
case errSecSuccess: secKey = item as! SecKey case errSecSuccess: secKey = item as! SecKey
case errSecItemNotFound: return nil case errSecItemNotFound: return nil
case let status: throw KeyStoreError.KeyStoreError("keychain read failed") case let status:
print(status)
throw KeyStoreError.KeyStoreError("keychain read failed")
} }
// return secKey // return secKey
var error: Unmanaged<CFError>? var error: Unmanaged<CFError>?
guard let data = SecKeyCopyExternalRepresentation(secKey, &error) as Data? else { guard (SecKeyCopyExternalRepresentation(secKey, &error) as Data?) != nil else {
throw KeyStoreError.KeyStoreError(error.debugDescription) throw KeyStoreError.KeyStoreError(error.debugDescription)
} }
// let key = try T(x963Representation: data) // let key = try T(x963Representation: data)
+1 -1
View File
@@ -110,7 +110,7 @@ struct ConnectionView: View {
} }
defer { fileURL.stopAccessingSecurityScopedResource() } defer { fileURL.stopAccessingSecurityScopedResource() }
privkey = try? Data(contentsOf: fileURL) privkey = try? Data(contentsOf: fileURL)
print(privkey) print(privkey ?? "")
print(fileURL) print(fileURL)
} catch { } catch {
print(error.localizedDescription) print(error.localizedDescription)
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.