From f8a6cd10434564a93bb41e78a86402823ebb73af Mon Sep 17 00:00:00 2001 From: cy384 Date: Sun, 4 Oct 2020 12:54:59 -0400 Subject: [PATCH] if the key is invalid, don't save the path --- ssheven.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ssheven.c b/ssheven.c index 05d6ce9..4d3693c 100644 --- a/ssheven.c +++ b/ssheven.c @@ -1134,6 +1134,11 @@ void* read_thread(void* arg) else if (rc == LIBSSH2_ERROR_PUBLICKEY_UNVERIFIED) { printf_i("Username/public key combination invalid!\r\n"); // TODO: have an alert for this + if (prefs.pubkey_path[0] != '\0' || prefs.privkey_path[0] != '\0') + { + prefs.pubkey_path[0] = '\0'; + prefs.privkey_path[0] = '\0'; + } } else printf_i("unexpected failure: %s\r\n", libssh2_error_string(rc)); ok = 0;