ssh key passphrase fix

This commit is contained in:
Nicolas Viennot 2015-12-31 18:21:14 -05:00
parent 55e6a774a8
commit 4c5522f7fa
2 changed files with 9 additions and 8 deletions

View File

@ -283,11 +283,13 @@ static void on_session_event(struct tmate_ssh_client *client)
case SSH_AUTH_PARTIAL:
case SSH_AUTH_INFO:
case SSH_AUTH_DENIED:
if (client->tmate_session->need_passphrase &&
!client->tried_passphrase)
if (client->tmate_session->need_passphrase)
request_passphrase(client);
else
kill_session(client, "SSH keys not found. Run 'ssh-keygen' to create keys and try again.");
if (client->tried_passphrase)
tmate_status_message("Can't load SSH key. Try typing passphrase again in case of typo. ctrl-c to abort.");
return;
case SSH_AUTH_ERROR:
reconnect_session(client, "Auth error: %s",

View File

@ -669,6 +669,10 @@ __window_copy_key(struct window_pane *wp, struct client *c, struct session *sess
case MODEKEYCOPY_SEARCHAGAIN:
case MODEKEYCOPY_SEARCHREVERSE:
switch (data->searchtype) {
#ifdef TMATE
case WINDOW_COPY_PASSWORD:
break;
#endif
case WINDOW_COPY_OFF:
case WINDOW_COPY_GOTOLINE:
case WINDOW_COPY_JUMPFORWARD:
@ -677,10 +681,6 @@ __window_copy_key(struct window_pane *wp, struct client *c, struct session *sess
case WINDOW_COPY_JUMPTOBACK:
case WINDOW_COPY_NAMEDBUFFER:
case WINDOW_COPY_NUMERICPREFIX:
#ifdef TMATE
case WINDOW_COPY_PASSWORD:
break;
#endif
case WINDOW_COPY_SEARCHUP:
ss = data->searchstr;
if (cmd == MODEKEYCOPY_SEARCHAGAIN) {
@ -850,9 +850,8 @@ window_copy_key_input(struct window_pane *wp, key_code key)
data->password_cb(data->inputstr,
data->password_cb_private);
}
*data->inputstr = '\0';
window_copy_copy_selection(wp, NULL);
window_pane_reset_mode(wp);
return 0;
#endif
}
data->numprefix = -1;