just tried to revert to it being pastable textfields but nope it doesnt work

its bc its not base64 encoded
maybe try that after?
This commit is contained in:
neon443
2025-06-19 17:38:54 +01:00
parent 15615e76a4
commit 2e1c624bec
3 changed files with 38 additions and 24 deletions

View File

@@ -47,7 +47,7 @@ struct blankHost: HostPr {
struct debugHost: HostPr {
var address: String = "localhost"
var port: Int = 32222
var port: Int = 22
var username: String = "default"
var password: String = ""
var key: Data? = nil

View File

@@ -169,7 +169,7 @@ class SSHHandler: ObservableObject {
return
}
func authWithPubkey(pub: Data, priv: Data, pass: String) {
func authWithPubkey(pub: String, priv: String, pass: String) {
guard session != nil else {
withAnimation { authorized = false }
return
@@ -184,8 +184,8 @@ class SSHHandler: ObservableObject {
fileManager.createFile(atPath: tempPubkey.path(), contents: nil)
fileManager.createFile(atPath: tempKey.path(), contents: nil)
try? pub.write(to: tempPubkey)
try? priv.write(to: tempKey)
try? Data(base64Encoded: pub)?.write(to: tempPubkey)
try? Data(base64Encoded: priv)?.write(to: tempKey)
var pubkey: ssh_key?
ssh_pki_import_pubkey_file(tempPubkey.path(), &pubkey)