From 693ef91fb889a39bf775e5d68a073b96387f1fae Mon Sep 17 00:00:00 2001 From: neon443 <69979447+neon443@users.noreply.github.com> Date: Fri, 8 Aug 2025 09:51:53 +0100 Subject: [PATCH] very wip auth with kbint (cant actually do anything cos i cba to make a server with kbint auth) --- ShhShell/SSH/SSHHandler.swift | 15 +++++++++++++++ ShhShell/SSH/SSHState.swift | 3 ++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/ShhShell/SSH/SSHHandler.swift b/ShhShell/SSH/SSHHandler.swift index d1fdcb5..25a6cc3 100644 --- a/ShhShell/SSH/SSHHandler.swift +++ b/ShhShell/SSH/SSHHandler.swift @@ -307,6 +307,21 @@ class SSHHandler: @unchecked Sendable, ObservableObject { return } + //MARK: very wip +// func authWithKbint() { +// withAnimation { state = .authorizingKbint } +// +// let status = ssh_userauth_kbdint(session, nil, nil) +// if status == SSH_AUTH_INFO.rawValue { +// print(ssh_userauth_kbdint_getnprompts(session)) +// print(ssh_userauth_kbdint_getname(session)) +// print(ssh_userauth_kbdint_getinstruction(session)) +// print(ssh_userauth_kbdint_getprompt(session, <#T##i: UInt32##UInt32#>, <#T##echo: UnsafeMutablePointer!##UnsafeMutablePointer!#>)) +// } +// +//// for prompt in +// } + func getAuthMethods() -> [AuthType] { var result: [AuthType] = [] let recievedMethod = UInt32(ssh_userauth_list(session, nil)) diff --git a/ShhShell/SSH/SSHState.swift b/ShhShell/SSH/SSHState.swift index 3933348..aeac9e2 100644 --- a/ShhShell/SSH/SSHState.swift +++ b/ShhShell/SSH/SSHState.swift @@ -12,6 +12,7 @@ enum SSHState { case idle case connecting case authorizing + case authorizingKbint case authorized case shellOpen @@ -23,7 +24,7 @@ enum SSHState { case .idle: return .gray - case .connecting, .authorizing: + case .connecting, .authorizing, .authorizingKbint: return .orange case .authorized, .shellOpen: