updated gethostkey to work with strings, and the rest of the ui had been updated to reflect this

This commit is contained in:
neon443 committed 2025-06-25 14:07:27 +01:00
1 parent 43b407b038
commit 548beca410
3 files changed
+14 -11

No files matched your search

+7 -3
View File
@@ -33,7 +33,7 @@ class SSHHandler: @unchecked Sendable, ObservableObject {
self.host = host
}
func getHostkey() -> Data? {
func getHostkey() -> String? {
var hostkey: ssh_key?
ssh_get_server_publickey(session, &hostkey)
@@ -41,7 +41,7 @@ class SSHHandler: @unchecked Sendable, ObservableObject {
let status = ssh_pki_export_pubkey_base64(hostkey, &hostkeyB64)
guard status == SSH_OK, let cString = hostkeyB64 else { return nil }
return String(cString: cString).data(using: .utf8)
return String(cString: cString)
}
func go() {
@@ -60,7 +60,11 @@ class SSHHandler: @unchecked Sendable, ObservableObject {
try? authWithNone()
getAuthMethods()
self.host.key = getHostkey()
if self.host.key != getHostkey() {
self.host.key = getHostkey()
return
}
if !host.password.isEmpty {
do { try authWithPw() } catch {
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.