mirror of
https://github.com/neon443/ShhShell.git
synced 2026-03-11 13:26:16 +00:00
very wip auth with kbint (cant actually do anything cos i cba to make a server with kbint auth)
This commit is contained in:
@@ -307,6 +307,21 @@ class SSHHandler: @unchecked Sendable, ObservableObject {
|
|||||||
return
|
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] {
|
func getAuthMethods() -> [AuthType] {
|
||||||
var result: [AuthType] = []
|
var result: [AuthType] = []
|
||||||
let recievedMethod = UInt32(ssh_userauth_list(session, nil))
|
let recievedMethod = UInt32(ssh_userauth_list(session, nil))
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ enum SSHState {
|
|||||||
case idle
|
case idle
|
||||||
case connecting
|
case connecting
|
||||||
case authorizing
|
case authorizing
|
||||||
|
case authorizingKbint
|
||||||
case authorized
|
case authorized
|
||||||
case shellOpen
|
case shellOpen
|
||||||
|
|
||||||
@@ -23,7 +24,7 @@ enum SSHState {
|
|||||||
case .idle:
|
case .idle:
|
||||||
return .gray
|
return .gray
|
||||||
|
|
||||||
case .connecting, .authorizing:
|
case .connecting, .authorizing, .authorizingKbint:
|
||||||
return .orange
|
return .orange
|
||||||
|
|
||||||
case .authorized, .shellOpen:
|
case .authorized, .shellOpen:
|
||||||
|
|||||||
Reference in New Issue
Block a user