• R/O
  • SSH
  • HTTPS

ttssh2: Commit


Commit MetaInfo

Revision7477 (tree)
Time2019-03-13 12:14:00
Authordoda

Log Message

keyboard-interactive 認証時、prompt の echo フラグが無視されるのを修正。

Ticket: #37294

パスワード入力では制御文字の入力を可能にしているが、表示可能にする事によって
記号等として表示されて文字化けしているように見えるのが課題。

Change Summary

Incremental Difference

--- trunk/doc/en/html/about/history.html (revision 7476)
+++ trunk/doc/en/html/about/history.html (revision 7477)
@@ -3112,6 +3112,7 @@
31123112 <li>Bug fixes
31133113 <ul>
31143114 <li>garbage data is added to the CipherOrder and MacOrder settings when saving settings.</li>
3115+ <li>when echo flag is 1 in the server's authentication informatin message, password string is masked on the keyboard-interactive authentication dialog.</li>
31153116 </ul>
31163117 </li>
31173118 </ul>
--- trunk/doc/ja/html/about/history.html (revision 7476)
+++ trunk/doc/ja/html/about/history.html (revision 7477)
@@ -3118,6 +3118,7 @@
31183118 <li>バグ修正
31193119 <ul>
31203120 <li>設定の保存時、CipherOrder, MacOrder 設定にゴミが付加される問題を修正した。</li>
3121+ <li>サーバの認証情報メッセージで echo フラグが 1 の時にもキーボードインタラクティブ認証ダイアログでパスワードがマスクされる問題を修正した。</li>
31213122 </ul>
31223123 </li>
31233124 </ul>
--- trunk/ttssh2/ttxssh/auth.c (revision 7476)
+++ trunk/ttssh2/ttxssh/auth.c (revision 7477)
@@ -1112,6 +1112,10 @@
11121112 pvar->auth_state.TIS_prompt);
11131113 destroy_malloced_string(&pvar->auth_state.TIS_prompt);
11141114 }
1115+
1116+ if (pvar->auth_state.echo) {
1117+ SendMessage(GetDlgItem(dlg, IDC_SSHPASSWORD), EM_SETPASSWORDCHAR, 0, 0);
1118+ }
11151119 }
11161120
11171121 static BOOL end_TIS_dlg(PTInstVar pvar, HWND dlg)
@@ -1443,6 +1447,7 @@
14431447 pvar->auth_state.user = NULL;
14441448 pvar->auth_state.flags = 0;
14451449 pvar->auth_state.TIS_prompt = NULL;
1450+ pvar->auth_state.echo = 0;
14461451 pvar->auth_state.supported_types = 0;
14471452 pvar->auth_state.cur_cred.method = SSH_AUTH_NONE;
14481453 pvar->auth_state.cur_cred.password = NULL;
@@ -1457,7 +1462,7 @@
14571462 destroy_malloced_string(&pvar->auth_state.TIS_prompt);
14581463 }
14591464
1460-void AUTH_set_TIS_mode(PTInstVar pvar, char *prompt, int len)
1465+void AUTH_set_TIS_mode(PTInstVar pvar, char *prompt, int len, int echo)
14611466 {
14621467 if (pvar->auth_state.cur_cred.method == SSH_AUTH_TIS) {
14631468 pvar->auth_state.mode = TIS_AUTH_MODE;
@@ -1466,6 +1471,7 @@
14661471 pvar->auth_state.TIS_prompt = malloc(len + 1);
14671472 memcpy(pvar->auth_state.TIS_prompt, prompt, len);
14681473 pvar->auth_state.TIS_prompt[len] = 0;
1474+ pvar->auth_state.echo = echo;
14691475 } else {
14701476 AUTH_set_generic_mode(pvar);
14711477 }
--- trunk/ttssh2/ttxssh/auth.h (revision 7476)
+++ trunk/ttssh2/ttxssh/auth.h (revision 7477)
@@ -56,6 +56,7 @@
5656
5757 AuthMode mode;
5858 char *TIS_prompt;
59+ int echo;
5960 } AUTHState;
6061
6162 void AUTH_init(PTInstVar pvar);
@@ -62,7 +63,7 @@
6263 char *AUTH_get_user_name(PTInstVar pvar);
6364 int AUTH_set_supported_auth_types(PTInstVar pvar, int types);
6465 void AUTH_set_generic_mode(PTInstVar pvar);
65-void AUTH_set_TIS_mode(PTInstVar pvar, char *prompt, int len);
66+void AUTH_set_TIS_mode(PTInstVar pvar, char *prompt, int len, int echo);
6667 void AUTH_advance_to_next_cred(PTInstVar pvar);
6768 void AUTH_do_cred_dialog(PTInstVar pvar);
6869 void AUTH_do_default_cred_dialog(PTInstVar pvar);
--- trunk/ttssh2/ttxssh/ssh.c (revision 7476)
+++ trunk/ttssh2/ttxssh/ssh.c (revision 7477)
@@ -1452,7 +1452,7 @@
14521452 if (grab_payload(pvar, len)) {
14531453 logputs(LOG_LEVEL_VERBOSE, "Received TIS challenge");
14541454
1455- AUTH_set_TIS_mode(pvar, pvar->ssh_state.payload + 4, len);
1455+ AUTH_set_TIS_mode(pvar, pvar->ssh_state.payload + 4, len, 0);
14561456 AUTH_advance_to_next_cred(pvar);
14571457 pvar->ssh_state.status_flags &= ~STATUS_DONT_SEND_CREDENTIALS;
14581458 try_send_credentials(pvar);
@@ -7200,7 +7200,7 @@
72007200 // keyboard-interactive method (2005.3.12 yutaka)
72017201 if (pvar->keyboard_interactive_password_input == 0 &&
72027202 pvar->auth_state.cur_cred.method == SSH_AUTH_TIS) {
7203- AUTH_set_TIS_mode(pvar, prompt, slen);
7203+ AUTH_set_TIS_mode(pvar, prompt, slen, echo);
72047204 AUTH_advance_to_next_cred(pvar);
72057205 pvar->ssh_state.status_flags &= ~STATUS_DONT_SEND_CREDENTIALS;
72067206 //try_send_credentials(pvar);
Show on old repository browser