mirror of
https://github.com/neon443/ShhShell.git
synced 2026-03-11 13:26:16 +00:00
fix warnings
This commit is contained in:
@@ -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 {
|
||||||
|
|||||||
@@ -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)
|
||||||
|
|||||||
@@ -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