very wip auth with kbint (cant actually do anything cos i cba to make a server with kbint auth)

This commit is contained in:
neon443
2025-08-08 09:51:53 +01:00
parent 100ffb0349
commit 693ef91fb8
2 changed files with 17 additions and 1 deletions

View File

@@ -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<CChar>!##UnsafeMutablePointer<CChar>!#>))
// }
//
//// for prompt in
// }
func getAuthMethods() -> [AuthType] {
var result: [AuthType] = []
let recievedMethod = UInt32(ssh_userauth_list(session, nil))

View File

@@ -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: