mirror of
https://github.com/neon443/ShhShell.git
synced 2026-03-11 05:19:13 +00:00
fix warnings
This commit is contained in:
@@ -61,7 +61,7 @@ class KeyManager: ObservableObject {
|
||||
}
|
||||
print(privateKey)
|
||||
|
||||
print(SecKeyCopyPublicKey(privateKey))
|
||||
print(SecKeyCopyPublicKey(privateKey) ?? "")
|
||||
// do {
|
||||
// try storeKey(privateKey, label: label)
|
||||
// } catch {
|
||||
|
||||
@@ -89,12 +89,14 @@ kSecUseDataProtectionKeychain: true,
|
||||
switch SecItemCopyMatching(query as CFDictionary, &item) {
|
||||
case errSecSuccess: secKey = item as! SecKey
|
||||
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
|
||||
|
||||
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)
|
||||
}
|
||||
// let key = try T(x963Representation: data)
|
||||
|
||||
@@ -110,7 +110,7 @@ struct ConnectionView: View {
|
||||
}
|
||||
defer { fileURL.stopAccessingSecurityScopedResource() }
|
||||
privkey = try? Data(contentsOf: fileURL)
|
||||
print(privkey)
|
||||
print(privkey ?? "")
|
||||
print(fileURL)
|
||||
} catch {
|
||||
print(error.localizedDescription)
|
||||
|
||||
Reference in New Issue
Block a user