if the key is invalid, don't save the path

This commit is contained in:
cy384 2020-10-04 12:54:59 -04:00
parent b6cbaf43e1
commit f8a6cd1043
1 changed files with 5 additions and 0 deletions

View File

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