implemented actually using Host.publicKey and Host.privateKey to store pubkeys and privkeys

- this gives u icloud synced pub/privkeys
 - per host!!
made it load the key's string representation (if present) into the textboxes to tell the user that the key is there
made the privkey box a securefield to show .... instead of the key

added a handler.go() to handler disconnecting if connected and choosing password/pubkey auth
- really cleaned up the view code
added getPubkey(_: SecKey) to keychainmanager
added SSHErrors - commfail, connectionFail, backenderror
added AuthError - rejectedCreds, notconnected
added KeyError - importpub/privError, pub/priv rejected
made most functions throw in sshhandler
fix memoryLayoutsize(ofvalue to buffer.count in testexec
[weak self] in the async loop to prevent memory leaks i guess
added loccritical for easy red logging
This commit is contained in:
neon443
2025-06-23 12:51:41 +01:00
parent c9eab9dde8
commit 8df8c77c7a
7 changed files with 113 additions and 75 deletions

View File

@@ -32,6 +32,7 @@
A985545F2E056EDD009051BD /* KeychainLayer.swift in Sources */ = {isa = PBXBuildFile; fileRef = A985545E2E056EDD009051BD /* KeychainLayer.swift */; };
A98554612E058433009051BD /* HostsManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = A98554602E058433009051BD /* HostsManager.swift */; };
A98554632E0587DF009051BD /* HostsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A98554622E0587DF009051BD /* HostsView.swift */; };
A9C4140C2E096DB7005E3047 /* SSHError.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9C4140B2E096DB7005E3047 /* SSHError.swift */; };
A9C897EF2DF1A9A400EF9A5F /* SSHHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9C897EE2DF1A9A400EF9A5F /* SSHHandler.swift */; };
/* End PBXBuildFile section */
@@ -97,6 +98,7 @@
A985545E2E056EDD009051BD /* KeychainLayer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KeychainLayer.swift; sourceTree = "<group>"; };
A98554602E058433009051BD /* HostsManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HostsManager.swift; sourceTree = "<group>"; };
A98554622E0587DF009051BD /* HostsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HostsView.swift; sourceTree = "<group>"; };
A9C4140B2E096DB7005E3047 /* SSHError.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SSHError.swift; sourceTree = "<group>"; };
A9C897EE2DF1A9A400EF9A5F /* SSHHandler.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SSHHandler.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */
@@ -219,6 +221,7 @@
isa = PBXGroup;
children = (
A9C897EE2DF1A9A400EF9A5F /* SSHHandler.swift */,
A9C4140B2E096DB7005E3047 /* SSHError.swift */,
);
path = SSH;
sourceTree = "<group>";
@@ -425,6 +428,7 @@
A9C897EF2DF1A9A400EF9A5F /* SSHHandler.swift in Sources */,
A98554552E05535F009051BD /* KeyManagerView.swift in Sources */,
A923172D2E07138000ECE1E6 /* SSHTerminalView.swift in Sources */,
A9C4140C2E096DB7005E3047 /* SSHError.swift in Sources */,
A923172A2E07113100ECE1E6 /* TerminalController.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;