diff --git a/Pareto/Checks/Access Security/SSHKeys.swift b/Pareto/Checks/Access Security/SSHKeys.swift index 84574b9..94e00c7 100644 --- a/Pareto/Checks/Access Security/SSHKeys.swift +++ b/Pareto/Checks/Access Security/SSHKeys.swift @@ -47,18 +47,23 @@ class SSHKeysCheck: ParetoCheck { } override func checkPasses() -> Bool { - let files = try? FileManager.default.contentsOfDirectory(at: sshPath, includingPropertiesForKeys: nil) - for pub in (files!.filter { $0.pathExtension == "pub" }) { - let privateKey = pub.path.replacingOccurrences(of: ".pub", with: "") - if !itExists(privateKey) { - continue - } - if !isPasswordEnabled(withKey: privateKey) { - os_log("Checking %{public}s", pub.path) - sshKey = pub.lastPathComponent.replacingOccurrences(of: ".pub", with: "") - return false + do { + let files = try FileManager.default.contentsOfDirectory(at: sshPath, includingPropertiesForKeys: nil).filter { $0.pathExtension == "pub" } + for pub in files { + let privateKey = pub.path.replacingOccurrences(of: ".pub", with: "") + if !itExists(privateKey) { + continue + } + if !isPasswordEnabled(withKey: privateKey) { + os_log("Checking %{public}s", pub.path) + sshKey = pub.lastPathComponent.replacingOccurrences(of: ".pub", with: "") + return false + } } + return true + } catch { + os_log("Failed to check SSH keys %{public}s", error.localizedDescription) + return true } - return true } } diff --git a/Pareto/Info.plist b/Pareto/Info.plist index f2b8acc..b271c80 100644 --- a/Pareto/Info.plist +++ b/Pareto/Info.plist @@ -26,7 +26,7 @@ CFBundleVersion - 3626 + 3629 LSApplicationCategoryType public.app-category.utilities LSMinimumSystemVersion