Develop and Download Open Source Software

Browse Subversion Repository

Contents of /branches/ssh_chacha20poly1305/ttssh2/ttxssh/auth.c

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2994 - (show annotations) (download) (as text)
Mon Aug 13 22:30:03 2007 UTC (16 years, 8 months ago) by maya
Original Path: ttssh2/trunk/ttxssh/auth.c
File MIME type: text/x-csrc
File size: 47243 byte(s)
国際化関数を修正した。
NO_I18N マクロを削除した。

1 /*
2 Copyright (c) 1998-2001, Robert O'Callahan
3 All rights reserved.
4
5 Redistribution and use in source and binary forms, with or without modification,
6 are permitted provided that the following conditions are met:
7
8 Redistributions of source code must retain the above copyright notice, this list of
9 conditions and the following disclaimer.
10
11 Redistributions in binary form must reproduce the above copyright notice, this list
12 of conditions and the following disclaimer in the documentation and/or other materials
13 provided with the distribution.
14
15 The name of Robert O'Callahan may not be used to endorse or promote products derived from
16 this software without specific prior written permission.
17
18 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' AND
19 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
20 OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
21 THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
22 EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
23 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
25 OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
26 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 */
28
29 #include "ttxssh.h"
30 #include "util.h"
31 #include "ssh.h"
32
33 #include <io.h>
34 #include <fcntl.h>
35 #include <stdlib.h>
36 #include <errno.h>
37
38 #include "resource.h"
39 #include "keyfiles.h"
40
41 #define AUTH_START_USER_AUTH_ON_ERROR_END 1
42
43 #define MAX_AUTH_CONTROL IDC_SSHUSETIS
44
45 static HFONT DlgAuthFont;
46 static HFONT DlgTisFont;
47 static HFONT DlgAuthSetupFont;
48
49 void destroy_malloced_string(char FAR * FAR * str)
50 {
51 if (*str != NULL) {
52 memset(*str, 0, strlen(*str));
53 free(*str);
54 *str = NULL;
55 }
56 }
57
58 static int auth_types_to_control_IDs[] = {
59 -1, IDC_SSHUSERHOSTS, IDC_SSHUSERSA, IDC_SSHUSEPASSWORD,
60 IDC_SSHUSERHOSTS, IDC_SSHUSETIS, -1
61 };
62
63 static LRESULT CALLBACK password_wnd_proc(HWND control, UINT msg,
64 WPARAM wParam, LPARAM lParam)
65 {
66 switch (msg) {
67 case WM_CHAR:
68 if ((GetKeyState(VK_CONTROL) & 0x8000) != 0) {
69 char chars[] = { (char) wParam, 0 };
70
71 SendMessage(control, EM_REPLACESEL, (WPARAM) TRUE,
72 (LPARAM) (char FAR *) chars);
73 return 0;
74 }
75 }
76
77 return CallWindowProc((WNDPROC) GetWindowLong(control, GWL_USERDATA),
78 control, msg, wParam, lParam);
79 }
80
81 static void init_password_control(HWND dlg)
82 {
83 HWND passwordControl = GetDlgItem(dlg, IDC_SSHPASSWORD);
84
85 SetWindowLong(passwordControl, GWL_USERDATA,
86 SetWindowLong(passwordControl, GWL_WNDPROC,
87 (LONG) password_wnd_proc));
88
89 SetFocus(passwordControl);
90 }
91
92 static void set_auth_options_status(HWND dlg, int controlID)
93 {
94 BOOL RSA_enabled = controlID == IDC_SSHUSERSA;
95 BOOL rhosts_enabled = controlID == IDC_SSHUSERHOSTS;
96 BOOL TIS_enabled = controlID == IDC_SSHUSETIS;
97 int i;
98
99 CheckRadioButton(dlg, IDC_SSHUSEPASSWORD, MAX_AUTH_CONTROL, controlID);
100
101 EnableWindow(GetDlgItem(dlg, IDC_SSHPASSWORDCAPTION), !TIS_enabled);
102 EnableWindow(GetDlgItem(dlg, IDC_SSHPASSWORD), !TIS_enabled);
103
104 for (i = IDC_CHOOSERSAFILE; i <= IDC_RSAFILENAME; i++) {
105 EnableWindow(GetDlgItem(dlg, i), RSA_enabled);
106 }
107
108 for (i = IDC_LOCALUSERNAMELABEL; i <= IDC_HOSTRSAFILENAME; i++) {
109 EnableWindow(GetDlgItem(dlg, i), rhosts_enabled);
110 }
111 }
112
113 static void init_auth_machine_banner(PTInstVar pvar, HWND dlg)
114 {
115 char buf[1024], buf2[1024];
116
117 GetDlgItemText(dlg, IDC_SSHAUTHBANNER, buf2, sizeof(buf2));
118 _snprintf_s(buf, sizeof(buf), _TRUNCATE, buf2, SSH_get_host_name(pvar));
119 SetDlgItemText(dlg, IDC_SSHAUTHBANNER, buf);
120 }
121
122 static void update_server_supported_types(PTInstVar pvar, HWND dlg)
123 {
124 int supported_methods = pvar->auth_state.supported_types;
125 int cur_control = -1;
126 int control;
127 HWND focus = GetFocus();
128
129 if (supported_methods == 0) {
130 return;
131 }
132
133 for (control = IDC_SSHUSEPASSWORD; control <= MAX_AUTH_CONTROL;
134 control++) {
135 BOOL enabled = FALSE;
136 int method;
137 HWND item = GetDlgItem(dlg, control);
138
139 if (item != NULL) {
140 for (method = 0; method <= SSH_AUTH_MAX; method++) {
141 if (auth_types_to_control_IDs[method] == control
142 && (supported_methods & (1 << method)) != 0) {
143 enabled = TRUE;
144 }
145 }
146
147 EnableWindow(item, enabled);
148
149 if (IsDlgButtonChecked(dlg, control)) {
150 cur_control = control;
151 }
152 }
153 }
154
155 if (cur_control >= 0) {
156 if (!IsWindowEnabled(GetDlgItem(dlg, cur_control))) {
157 do {
158 cur_control++;
159 if (cur_control > MAX_AUTH_CONTROL) {
160 cur_control = IDC_SSHUSEPASSWORD;
161 }
162 } while (!IsWindowEnabled(GetDlgItem(dlg, cur_control)));
163
164 set_auth_options_status(dlg, cur_control);
165
166 if (focus != NULL && !IsWindowEnabled(focus)) {
167 SetFocus(GetDlgItem(dlg, cur_control));
168 }
169 }
170 }
171 }
172
173 static void init_auth_dlg(PTInstVar pvar, HWND dlg)
174 {
175 int default_method = pvar->session_settings.DefaultAuthMethod;
176 char uimsg[MAX_UIMSG];
177
178 GetWindowText(dlg, uimsg, sizeof(uimsg));
179 UTIL_get_lang_msg("DLG_AUTH_TITLE", pvar, uimsg);
180 SetWindowText(dlg, pvar->ts->UIMsg);
181 GetDlgItemText(dlg, IDC_SSHAUTHBANNER, uimsg, sizeof(uimsg));
182 UTIL_get_lang_msg("DLG_AUTH_BANNER", pvar, uimsg);
183 SetDlgItemText(dlg, IDC_SSHAUTHBANNER, pvar->ts->UIMsg);
184 GetDlgItemText(dlg, IDC_SSHAUTHBANNER2, uimsg, sizeof(uimsg));
185 UTIL_get_lang_msg("DLG_AUTH_BANNER2", pvar, uimsg);
186 SetDlgItemText(dlg, IDC_SSHAUTHBANNER2, pvar->ts->UIMsg);
187 GetDlgItemText(dlg, IDC_SSHUSERNAMELABEL, uimsg, sizeof(uimsg));
188 UTIL_get_lang_msg("DLG_AUTH_USERNAME", pvar, uimsg);
189 SetDlgItemText(dlg, IDC_SSHUSERNAMELABEL, pvar->ts->UIMsg);
190 GetDlgItemText(dlg, IDC_SSHPASSWORDCAPTION, uimsg, sizeof(uimsg));
191 UTIL_get_lang_msg("DLG_AUTH_PASSWORD", pvar, uimsg);
192 SetDlgItemText(dlg, IDC_SSHPASSWORDCAPTION, pvar->ts->UIMsg);
193 GetDlgItemText(dlg, IDC_REMEMBER_PASSWORD, uimsg, sizeof(uimsg));
194 UTIL_get_lang_msg("DLG_AUTH_REMEMBER_PASSWORD", pvar, uimsg);
195 SetDlgItemText(dlg, IDC_REMEMBER_PASSWORD, pvar->ts->UIMsg);
196 GetDlgItemText(dlg, IDC_SSHUSEPASSWORD, uimsg, sizeof(uimsg));
197 UTIL_get_lang_msg("DLG_AUTH_METHOD_PASSWORD", pvar, uimsg);
198 SetDlgItemText(dlg, IDC_SSHUSEPASSWORD, pvar->ts->UIMsg);
199 GetDlgItemText(dlg, IDC_SSHUSERSA, uimsg, sizeof(uimsg));
200 UTIL_get_lang_msg("DLG_AUTH_METHOD_RSA", pvar, uimsg);
201 SetDlgItemText(dlg, IDC_SSHUSERSA, pvar->ts->UIMsg);
202 GetDlgItemText(dlg, IDC_SSHUSERHOSTS, uimsg, sizeof(uimsg));
203 UTIL_get_lang_msg("DLG_AUTH_METHOD_RHOST", pvar, uimsg);
204 SetDlgItemText(dlg, IDC_SSHUSERHOSTS, pvar->ts->UIMsg);
205 GetDlgItemText(dlg, IDC_CHOOSERSAFILE, uimsg, sizeof(uimsg));
206 UTIL_get_lang_msg("DLG_AUTH_PRIVATEKEY", pvar, uimsg);
207 SetDlgItemText(dlg, IDC_CHOOSERSAFILE, pvar->ts->UIMsg);
208 GetDlgItemText(dlg, IDC_LOCALUSERNAMELABEL, uimsg, sizeof(uimsg));
209 UTIL_get_lang_msg("DLG_AUTH_LOCALUSER", pvar, uimsg);
210 SetDlgItemText(dlg, IDC_LOCALUSERNAMELABEL, pvar->ts->UIMsg);
211 GetDlgItemText(dlg, IDC_CHOOSEHOSTRSAFILE, uimsg, sizeof(uimsg));
212 UTIL_get_lang_msg("DLG_AUTH_HOST_PRIVATEKEY", pvar, uimsg);
213 SetDlgItemText(dlg, IDC_CHOOSEHOSTRSAFILE, pvar->ts->UIMsg);
214 GetDlgItemText(dlg, IDOK, uimsg, sizeof(uimsg));
215 UTIL_get_lang_msg("BTN_OK", pvar, uimsg);
216 SetDlgItemText(dlg, IDOK, pvar->ts->UIMsg);
217 GetDlgItemText(dlg, IDCANCEL, uimsg, sizeof(uimsg));
218 UTIL_get_lang_msg("BTN_DISCONNECT", pvar, uimsg);
219 SetDlgItemText(dlg, IDCANCEL, pvar->ts->UIMsg);
220
221 init_auth_machine_banner(pvar, dlg);
222 init_password_control(dlg);
223
224 if (pvar->auth_state.failed_method != SSH_AUTH_NONE) {
225 /* must be retrying a failed attempt */
226 UTIL_get_lang_msg("DLG_AUTH_BANNER2_FAILED", pvar, "Authentication failed. Please retry.");
227 SetDlgItemText(dlg, IDC_SSHAUTHBANNER2, pvar->ts->UIMsg);
228 UTIL_get_lang_msg("DLG_AUTH_TITLE_FAILED", pvar, "Retrying SSH Authentication");
229 SetWindowText(dlg, pvar->ts->UIMsg);
230 default_method = pvar->auth_state.failed_method;
231 }
232
233 set_auth_options_status(dlg,
234 auth_types_to_control_IDs[default_method]);
235
236 if (default_method == SSH_AUTH_TIS) {
237 /* we disabled the password control, so fix the focus */
238 SetFocus(GetDlgItem(dlg, IDC_SSHUSETIS));
239 }
240
241 if (pvar->auth_state.user != NULL) {
242 SetDlgItemText(dlg, IDC_SSHUSERNAME, pvar->auth_state.user);
243 EnableWindow(GetDlgItem(dlg, IDC_SSHUSERNAME), FALSE);
244 EnableWindow(GetDlgItem(dlg, IDC_SSHUSERNAMELABEL), FALSE);
245 } else if (pvar->session_settings.DefaultUserName[0] != 0) {
246 SetDlgItemText(dlg, IDC_SSHUSERNAME,
247 pvar->session_settings.DefaultUserName);
248 } else {
249 SetFocus(GetDlgItem(dlg, IDC_SSHUSERNAME));
250 }
251
252 SetDlgItemText(dlg, IDC_RSAFILENAME,
253 pvar->session_settings.DefaultRSAPrivateKeyFile);
254 SetDlgItemText(dlg, IDC_HOSTRSAFILENAME,
255 pvar->session_settings.DefaultRhostsHostPrivateKeyFile);
256 SetDlgItemText(dlg, IDC_LOCALUSERNAME,
257 pvar->session_settings.DefaultRhostsLocalUserName);
258
259 update_server_supported_types(pvar, dlg);
260
261 // SSH2 autologin
262 // ���[�U�A�p�X���[�h�A�F�����\�b�h���������������A������������OK�{�^�������������B
263 //
264 // (2004.12.1 yutaka)
265 // (2005.1.26 yutaka) ���J���F���T�|�[�g
266 // �������O�C���������������A�������������������X���\ (2006.9.18 maya)
267 #if 0
268 if (pvar->ssh2_autologin == 1) {
269 #endif
270 if (strlen(pvar->ssh2_username) > 0) {
271 SetDlgItemText(dlg, IDC_SSHUSERNAME, pvar->ssh2_username);
272 }
273 if (pvar->ssh2_autologin == 1) {
274 EnableWindow(GetDlgItem(dlg, IDC_SSHUSERNAME), FALSE);
275 EnableWindow(GetDlgItem(dlg, IDC_SSHUSERNAMELABEL), FALSE);
276 }
277
278 SetDlgItemText(dlg, IDC_SSHPASSWORD, pvar->ssh2_password);
279 if (pvar->ssh2_autologin == 1) {
280 EnableWindow(GetDlgItem(dlg, IDC_SSHPASSWORD), FALSE);
281 EnableWindow(GetDlgItem(dlg, IDC_SSHPASSWORDCAPTION), FALSE);
282 }
283
284 // '/I' �w�������������������������� (2005.9.5 yutaka)
285 if (pvar->ts->Minimize) {
286 //20050822���� start T.Takahashi
287 ShowWindow(dlg,SW_MINIMIZE);
288 //20050822���� end T.Takahashi
289 }
290
291 if (pvar->ssh2_authmethod == SSH_AUTH_PASSWORD) {
292 CheckRadioButton(dlg, IDC_SSHUSEPASSWORD, MAX_AUTH_CONTROL, IDC_SSHUSEPASSWORD);
293
294 } else if (pvar->ssh2_authmethod == SSH_AUTH_RSA) {
295 CheckRadioButton(dlg, IDC_SSHUSEPASSWORD, MAX_AUTH_CONTROL, IDC_SSHUSERSA);
296
297 SetDlgItemText(dlg, IDC_RSAFILENAME, pvar->ssh2_keyfile);
298 if (pvar->ssh2_autologin == 1) {
299 EnableWindow(GetDlgItem(dlg, IDC_CHOOSERSAFILE), FALSE);
300 EnableWindow(GetDlgItem(dlg, IDC_RSAFILENAME), FALSE);
301 }
302
303 } else {
304 // TODO
305
306 }
307
308 if (pvar->ask4passwd == 1) {
309 SetFocus(GetDlgItem(dlg, IDC_SSHPASSWORD));
310 }
311 #if 0
312 }
313 #endif
314
315 #if 1
316 // �p�X���[�h�F���������O���Akeyboard-interactive���\�b�h�������������A���x������
317 // ���X�����B(2005.3.12 yutaka)
318 if (pvar->settings.ssh2_keyboard_interactive == 1) {
319 UTIL_get_lang_msg("DLG_AUTH_METHOD_PASSWORD_KBDINT", pvar,
320 "Use p&lain password to log in (with keyboard-interactive)");
321 SetDlgItemText(dlg, IDC_SSHUSEPASSWORD, pvar->ts->UIMsg);
322 }
323
324 if (pvar->settings.ssh_protocol_version == 1) {
325 UTIL_get_lang_msg("DLG_AUTH_METHOD_CHALLENGE1", pvar,
326 "Use challenge/response to log in(&TIS)");
327 SetDlgItemText(dlg, IDC_SSHUSETIS, pvar->ts->UIMsg);
328 } else {
329 UTIL_get_lang_msg("DLG_AUTH_METHOD_CHALLENGE2", pvar,
330 "Use &challenge/response to log in(keyboard-interactive)");
331 SetDlgItemText(dlg, IDC_SSHUSETIS, pvar->ts->UIMsg);
332 }
333 #endif
334
335 // �p�X���[�h���o���������`�F�b�N�{�b�N�X�����f�t�H���g���L�������� (2006.8.3 yutaka)
336 if (pvar->ts_SSH->remember_password) {
337 SendMessage(GetDlgItem(dlg, IDC_REMEMBER_PASSWORD), BM_SETCHECK, BST_CHECKED, 0);
338 } else {
339 SendMessage(GetDlgItem(dlg, IDC_REMEMBER_PASSWORD), BM_SETCHECK, BST_UNCHECKED, 0);
340 }
341
342 }
343
344 static char FAR *alloc_control_text(HWND ctl)
345 {
346 int len = GetWindowTextLength(ctl);
347 char FAR *result = malloc(len + 1);
348
349 if (result != NULL) {
350 GetWindowText(ctl, result, len + 1);
351 result[len] = 0;
352 }
353
354 return result;
355 }
356
357 static int get_key_file_name(HWND parent, char FAR * buf, int bufsize, PTInstVar pvar)
358 {
359 #ifdef TERATERM32
360 OPENFILENAME params;
361 char fullname_buf[2048] = "identity";
362 char filter[MAX_UIMSG];
363
364 ZeroMemory(&params, sizeof(params));
365 params.lStructSize = sizeof(OPENFILENAME);
366 params.hwndOwner = parent;
367 // �t�B���^������ (2004.12.19 yutaka)
368 // 3�t�@�C���t�B���^������ (2005.4.26 yutaka)
369 UTIL_get_lang_msg("FILEDLG_OPEN_PRIVATEKEY_FILTER", pvar,
370 "identity files\\0identity;id_rsa;id_dsa\\0identity(RSA1)\\0identity\\0id_rsa(SSH2)\\0id_rsa\\0id_dsa(SSH2)\\0id_dsa\\0all(*.*)\\0*.*\\0\\0");
371 memcpy(filter, pvar->ts->UIMsg, sizeof(filter));
372 params.lpstrFilter = filter;
373 params.lpstrCustomFilter = NULL;
374 params.nFilterIndex = 0;
375 buf[0] = 0;
376 params.lpstrFile = fullname_buf;
377 params.nMaxFile = sizeof(fullname_buf);
378 params.lpstrFileTitle = NULL;
379 params.lpstrInitialDir = NULL;
380 UTIL_get_lang_msg("FILEDLG_OPEN_PRIVATEKEY_TITLE", pvar,
381 "Choose a file with the RSA/DSA private key");
382 params.lpstrTitle = pvar->ts->UIMsg;
383 params.Flags =
384 OFN_FILEMUSTEXIST | OFN_PATHMUSTEXIST | OFN_HIDEREADONLY;
385 params.lpstrDefExt = NULL;
386
387 if (GetOpenFileName(&params) != 0) {
388 copy_teraterm_dir_relative_path(buf, bufsize, fullname_buf);
389 return 1;
390 } else {
391 return 0;
392 }
393 #else
394 return 0;
395 #endif
396 }
397
398 static void choose_RSA_key_file(HWND dlg, PTInstVar pvar)
399 {
400 char buf[1024];
401
402 if (get_key_file_name(dlg, buf, sizeof(buf), pvar)) {
403 SetDlgItemText(dlg, IDC_RSAFILENAME, buf);
404 }
405 }
406
407 static void choose_host_RSA_key_file(HWND dlg, PTInstVar pvar)
408 {
409 char buf[1024];
410
411 if (get_key_file_name(dlg, buf, sizeof(buf), pvar)) {
412 SetDlgItemText(dlg, IDC_HOSTRSAFILENAME, buf);
413 }
414 }
415
416 static BOOL end_auth_dlg(PTInstVar pvar, HWND dlg)
417 {
418 int method = SSH_AUTH_PASSWORD;
419 char FAR *password =
420 alloc_control_text(GetDlgItem(dlg, IDC_SSHPASSWORD));
421 CRYPTKeyPair FAR *key_pair = NULL;
422
423 if (IsDlgButtonChecked(dlg, IDC_SSHUSERSA)) {
424 method = SSH_AUTH_RSA;
425 } else if (IsDlgButtonChecked(dlg, IDC_SSHUSERHOSTS)) {
426 if (GetWindowTextLength(GetDlgItem(dlg, IDC_HOSTRSAFILENAME)) > 0) {
427 method = SSH_AUTH_RHOSTS_RSA;
428 } else {
429 method = SSH_AUTH_RHOSTS;
430 }
431 } else if (IsDlgButtonChecked(dlg, IDC_SSHUSETIS)) {
432 method = SSH_AUTH_TIS;
433 }
434
435 if (method == SSH_AUTH_RSA || method == SSH_AUTH_RHOSTS_RSA) {
436 char buf[2048];
437 int file_ctl_ID =
438 method == SSH_AUTH_RSA ? IDC_RSAFILENAME : IDC_HOSTRSAFILENAME;
439
440 buf[0] = 0;
441 GetDlgItemText(dlg, file_ctl_ID, buf, sizeof(buf));
442 if (buf[0] == 0) {
443 UTIL_get_lang_msg("MSG_KEYSPECIFY_ERROR", pvar,
444 "You must specify a file containing the RSA/DSA private key.");
445 notify_nonfatal_error(pvar, pvar->ts->UIMsg);
446 SetFocus(GetDlgItem(dlg, file_ctl_ID));
447 destroy_malloced_string(&password);
448 return FALSE;
449 }
450
451 if (SSHv1(pvar)) {
452 BOOL invalid_passphrase = FALSE;
453
454 key_pair = KEYFILES_read_private_key(pvar, buf, password,
455 &invalid_passphrase,
456 FALSE);
457
458 if (key_pair == NULL) {
459 if (invalid_passphrase) {
460 HWND passwordCtl = GetDlgItem(dlg, IDC_SSHPASSWORD);
461
462 SetFocus(passwordCtl);
463 SendMessage(passwordCtl, EM_SETSEL, 0, -1);
464 } else {
465 SetFocus(GetDlgItem(dlg, file_ctl_ID));
466 }
467 destroy_malloced_string(&password);
468 return FALSE;
469 }
470
471 } else { // SSH2(yutaka)
472 BOOL invalid_passphrase = FALSE;
473 char errmsg[256];
474
475 memset(errmsg, 0, sizeof(errmsg));
476 //GetCurrentDirectory(sizeof(errmsg), errmsg);
477
478 key_pair = read_SSH2_private_key(pvar, buf, password,
479 &invalid_passphrase,
480 FALSE,
481 errmsg,
482 sizeof(errmsg)
483 );
484
485 if (key_pair == NULL) { // read error
486 char buf[1024];
487 UTIL_get_lang_msg("MSG_READKEY_ERROR", pvar,
488 "read error SSH2 private key file\r\n%s");
489 _snprintf_s(buf, sizeof(buf), _TRUNCATE, pvar->ts->UIMsg, errmsg);
490 notify_nonfatal_error(pvar, buf);
491 // �p�X�t���[�Y���������v����������������IDC_SSHPASSWORD���t�H�[�J�X������ (2006.10.29 yasuhide)
492 if (invalid_passphrase) {
493 HWND passwordCtl = GetDlgItem(dlg, IDC_SSHPASSWORD);
494
495 SetFocus(passwordCtl);
496 SendMessage(passwordCtl, EM_SETSEL, 0, -1);
497 } else {
498 SetFocus(GetDlgItem(dlg, file_ctl_ID));
499 }
500 destroy_malloced_string(&password);
501 return FALSE;
502 }
503
504 }
505
506 }
507
508 /* from here on, we cannot fail, so just munge cur_cred in place */
509 pvar->auth_state.cur_cred.method = method;
510 pvar->auth_state.cur_cred.key_pair = key_pair;
511 /* we can't change the user name once it's set. It may already have
512 been sent to the server, and it can only be sent once. */
513 if (pvar->auth_state.user == NULL) {
514 pvar->auth_state.user =
515 alloc_control_text(GetDlgItem(dlg, IDC_SSHUSERNAME));
516 }
517
518 // �p�X���[�h���������������������������� (2006.8.3 yutaka)
519 if (SendMessage(GetDlgItem(dlg, IDC_REMEMBER_PASSWORD), BM_GETCHECK, 0,0) == BST_CHECKED) {
520 pvar->settings.remember_password = 1; // �o��������
521 pvar->ts_SSH->remember_password = 1;
522 } else {
523 pvar->settings.remember_password = 0; // ���������������Y����
524 pvar->ts_SSH->remember_password = 0;
525 }
526
527 // ���J���F���������A�Z�b�V�������������p�X���[�h���g�����������������������������������B
528 // (2005.4.8 yutaka)
529 if (method == SSH_AUTH_PASSWORD || method == SSH_AUTH_RSA) {
530 pvar->auth_state.cur_cred.password = password;
531 } else {
532 destroy_malloced_string(&password);
533 }
534 if (method == SSH_AUTH_RHOSTS || method == SSH_AUTH_RHOSTS_RSA) {
535 if (pvar->session_settings.DefaultAuthMethod != SSH_AUTH_RHOSTS) {
536 UTIL_get_lang_msg("MSG_RHOSTS_NOTDEFAULT_ERROR", pvar,
537 "Rhosts authentication will probably fail because it was not "
538 "the default authentication method.\n"
539 "To use Rhosts authentication "
540 "in TTSSH, you need to set it to be the default by restarting\n"
541 "TTSSH and selecting \"SSH Authentication...\" from the Setup menu"
542 "before connecting.");
543 notify_nonfatal_error(pvar, pvar->ts->UIMsg);
544 }
545
546 pvar->auth_state.cur_cred.rhosts_client_user =
547 alloc_control_text(GetDlgItem(dlg, IDC_LOCALUSERNAME));
548 }
549 pvar->auth_state.auth_dialog = NULL;
550
551 GetDlgItemText(dlg, IDC_RSAFILENAME,
552 pvar->session_settings.DefaultRSAPrivateKeyFile,
553 sizeof(pvar->session_settings.
554 DefaultRSAPrivateKeyFile));
555 GetDlgItemText(dlg, IDC_HOSTRSAFILENAME,
556 pvar->session_settings.DefaultRhostsHostPrivateKeyFile,
557 sizeof(pvar->session_settings.
558 DefaultRhostsHostPrivateKeyFile));
559 GetDlgItemText(dlg, IDC_LOCALUSERNAME,
560 pvar->session_settings.DefaultRhostsLocalUserName,
561 sizeof(pvar->session_settings.
562 DefaultRhostsLocalUserName));
563
564 if (SSHv1(pvar)) {
565 SSH_notify_user_name(pvar);
566 SSH_notify_cred(pvar);
567 } else {
568 // for SSH2(yutaka)
569 do_SSH2_userauth(pvar);
570 }
571
572 EndDialog(dlg, 1);
573 if (DlgAuthFont != NULL) {
574 DeleteObject(DlgAuthFont);
575 }
576
577 return TRUE;
578 }
579
580 static BOOL CALLBACK auth_dlg_proc(HWND dlg, UINT msg, WPARAM wParam,
581 LPARAM lParam)
582 {
583 const int IDC_TIMER1 = 300;
584 const int autologin_timeout = 10; // �~���b
585 PTInstVar pvar;
586 LOGFONT logfont;
587 HFONT font;
588
589 switch (msg) {
590 case WM_INITDIALOG:
591 pvar = (PTInstVar) lParam;
592 pvar->auth_state.auth_dialog = dlg;
593 SetWindowLong(dlg, DWL_USER, lParam);
594
595 init_auth_dlg(pvar, dlg);
596
597 font = (HFONT)SendMessage(dlg, WM_GETFONT, 0, 0);
598 GetObject(font, sizeof(LOGFONT), &logfont);
599 if (UTIL_get_lang_font("DLG_TAHOMA_FONT", dlg, &logfont, &DlgAuthFont, pvar)) {
600 SendDlgItemMessage(dlg, IDC_SSHAUTHBANNER, WM_SETFONT, (WPARAM)DlgAuthFont, MAKELPARAM(TRUE,0));
601 SendDlgItemMessage(dlg, IDC_SSHAUTHBANNER2, WM_SETFONT, (WPARAM)DlgAuthFont, MAKELPARAM(TRUE,0));
602 SendDlgItemMessage(dlg, IDC_SSHUSERNAMELABEL, WM_SETFONT, (WPARAM)DlgAuthFont, MAKELPARAM(TRUE,0));
603 SendDlgItemMessage(dlg, IDC_SSHUSERNAME, WM_SETFONT, (WPARAM)DlgAuthFont, MAKELPARAM(TRUE,0));
604 SendDlgItemMessage(dlg, IDC_SSHPASSWORDCAPTION, WM_SETFONT, (WPARAM)DlgAuthFont, MAKELPARAM(TRUE,0));
605 SendDlgItemMessage(dlg, IDC_SSHPASSWORD, WM_SETFONT, (WPARAM)DlgAuthFont, MAKELPARAM(TRUE,0));
606 SendDlgItemMessage(dlg, IDC_REMEMBER_PASSWORD, WM_SETFONT, (WPARAM)DlgAuthFont, MAKELPARAM(TRUE,0));
607 SendDlgItemMessage(dlg, IDC_SSHUSEPASSWORD, WM_SETFONT, (WPARAM)DlgAuthFont, MAKELPARAM(TRUE,0));
608 SendDlgItemMessage(dlg, IDC_SSHUSERSA, WM_SETFONT, (WPARAM)DlgAuthFont, MAKELPARAM(TRUE,0));
609 SendDlgItemMessage(dlg, IDC_CHOOSERSAFILE, WM_SETFONT, (WPARAM)DlgAuthFont, MAKELPARAM(TRUE,0));
610 SendDlgItemMessage(dlg, IDC_RSAFILENAME, WM_SETFONT, (WPARAM)DlgAuthFont, MAKELPARAM(TRUE,0));
611 SendDlgItemMessage(dlg, IDC_SSHUSERHOSTS, WM_SETFONT, (WPARAM)DlgAuthFont, MAKELPARAM(TRUE,0));
612 SendDlgItemMessage(dlg, IDC_LOCALUSERNAMELABEL, WM_SETFONT, (WPARAM)DlgAuthFont, MAKELPARAM(TRUE,0));
613 SendDlgItemMessage(dlg, IDC_LOCALUSERNAME, WM_SETFONT, (WPARAM)DlgAuthFont, MAKELPARAM(TRUE,0));
614 SendDlgItemMessage(dlg, IDC_CHOOSEHOSTRSAFILE, WM_SETFONT, (WPARAM)DlgAuthFont, MAKELPARAM(TRUE,0));
615 SendDlgItemMessage(dlg, IDC_HOSTRSAFILENAME, WM_SETFONT, (WPARAM)DlgAuthFont, MAKELPARAM(TRUE,0));
616 SendDlgItemMessage(dlg, IDC_SSHUSETIS, WM_SETFONT, (WPARAM)DlgAuthFont, MAKELPARAM(TRUE,0));
617 SendDlgItemMessage(dlg, IDOK, WM_SETFONT, (WPARAM)DlgAuthFont, MAKELPARAM(TRUE,0));
618 SendDlgItemMessage(dlg, IDCANCEL, WM_SETFONT, (WPARAM)DlgAuthFont, MAKELPARAM(TRUE,0));
619 }
620 else {
621 DlgAuthFont = NULL;
622 }
623
624 // SSH2 autologin���L�����������A�^�C�}���d�|�����B (2004.12.1 yutaka)
625 if (pvar->ssh2_autologin == 1) {
626 SetTimer(dlg, IDC_TIMER1, autologin_timeout, 0);
627 }
628 return FALSE; /* because we set the focus */
629
630 case WM_TIMER:
631 pvar = (PTInstVar) GetWindowLong(dlg, DWL_USER);
632 // �F�������������������A�F���f�[�^�����M�����B�����������A�������B(2004.12.16 yutaka)
633 if (!(pvar->ssh_state.status_flags & STATUS_DONT_SEND_USER_NAME)) {
634 KillTimer(dlg, IDC_TIMER1);
635 SendMessage(dlg, WM_COMMAND, IDOK, 0);
636 }
637 return TRUE;
638
639 case WM_COMMAND:
640 pvar = (PTInstVar) GetWindowLong(dlg, DWL_USER);
641
642 switch (LOWORD(wParam)) {
643 case IDOK:
644 // �F�������������������A�F���f�[�^�����M�����B�����������A�������B(2001.1.25 yutaka)
645 if (pvar->userauth_retry_count == 0 && (pvar->ssh_state.status_flags & STATUS_DONT_SEND_USER_NAME)) {
646 return FALSE;
647 }
648
649 return end_auth_dlg(pvar, dlg);
650
651 case IDCANCEL: /* kill the connection */
652 pvar->auth_state.auth_dialog = NULL;
653 notify_closed_connection(pvar);
654 EndDialog(dlg, 0);
655
656 if (DlgAuthFont != NULL) {
657 DeleteObject(DlgAuthFont);
658 }
659
660 return TRUE;
661
662 case IDC_SSHUSEPASSWORD:
663 case IDC_SSHUSERSA:
664 case IDC_SSHUSERHOSTS:
665 case IDC_SSHUSETIS:
666 set_auth_options_status(dlg, LOWORD(wParam));
667 return TRUE;
668
669 case IDC_CHOOSERSAFILE:
670 choose_RSA_key_file(dlg, pvar);
671 return TRUE;
672
673 case IDC_CHOOSEHOSTRSAFILE:
674 choose_host_RSA_key_file(dlg, pvar);
675 return TRUE;
676
677 default:
678 return FALSE;
679 }
680
681 default:
682 return FALSE;
683 }
684 }
685
686 char FAR *AUTH_get_user_name(PTInstVar pvar)
687 {
688 return pvar->auth_state.user;
689 }
690
691 int AUTH_set_supported_auth_types(PTInstVar pvar, int types)
692 {
693 char buf[1024];
694
695 _snprintf_s(buf, sizeof(buf), _TRUNCATE,
696 "Server reports supported authentication method mask = %d",
697 types);
698 buf[sizeof(buf) - 1] = 0;
699 notify_verbose_message(pvar, buf, LOG_LEVEL_VERBOSE);
700
701 if (SSHv1(pvar)) {
702 types &= (1 << SSH_AUTH_PASSWORD) | (1 << SSH_AUTH_RSA)
703 | (1 << SSH_AUTH_RHOSTS_RSA) | (1 << SSH_AUTH_RHOSTS)
704 | (1 << SSH_AUTH_TIS);
705 } else {
706 // for SSH2(yutaka)
707 // types &= (1 << SSH_AUTH_PASSWORD);
708 // ���J���F�����L�������� (2004.12.18 yutaka)
709 // TIS�������BSSH2����keyboard-interactive�����������B(2005.3.12 yutaka)
710 types &= (1 << SSH_AUTH_PASSWORD) | (1 << SSH_AUTH_RSA)
711 | (1 << SSH_AUTH_DSA)
712 | (1 << SSH_AUTH_TIS);
713 }
714 pvar->auth_state.supported_types = types;
715
716 if (types == 0) {
717 UTIL_get_lang_msg("MSG_NOAUTHMETHOD_ERROR", pvar,
718 "Server does not support any of the authentication options\n"
719 "provided by TTSSH. This connection will now close.");
720 notify_fatal_error(pvar, pvar->ts->UIMsg);
721 return 0;
722 } else {
723 if (pvar->auth_state.auth_dialog != NULL) {
724 update_server_supported_types(pvar,
725 pvar->auth_state.auth_dialog);
726 }
727
728 return 1;
729 }
730 }
731
732 static void start_user_auth(PTInstVar pvar)
733 {
734 // �F���_�C�A���O���\�������� (2004.12.1 yutaka)
735 PostMessage(pvar->NotificationWindow, WM_COMMAND, (WPARAM) ID_SSHAUTH,
736 (LPARAM) NULL);
737 pvar->auth_state.cur_cred.method = SSH_AUTH_NONE;
738 }
739
740 static void try_default_auth(PTInstVar pvar)
741 {
742 if (pvar->session_settings.TryDefaultAuth) {
743 switch (pvar->session_settings.DefaultAuthMethod) {
744 case SSH_AUTH_RSA:{
745 BOOL invalid_passphrase;
746 char password[] = "";
747
748 pvar->auth_state.cur_cred.key_pair
749 =
750 KEYFILES_read_private_key(pvar,
751 pvar->session_settings.
752 DefaultRSAPrivateKeyFile,
753 password,
754 &invalid_passphrase, TRUE);
755 if (pvar->auth_state.cur_cred.key_pair == NULL) {
756 return;
757 } else {
758 pvar->auth_state.cur_cred.method = SSH_AUTH_RSA;
759 }
760 break;
761 }
762
763 case SSH_AUTH_RHOSTS:
764 if (pvar->session_settings.
765 DefaultRhostsHostPrivateKeyFile[0] != 0) {
766 BOOL invalid_passphrase;
767 char password[] = "";
768
769 pvar->auth_state.cur_cred.key_pair
770 =
771 KEYFILES_read_private_key(pvar,
772 pvar->session_settings.
773 DefaultRhostsHostPrivateKeyFile,
774 password,
775 &invalid_passphrase, TRUE);
776 if (pvar->auth_state.cur_cred.key_pair == NULL) {
777 return;
778 } else {
779 pvar->auth_state.cur_cred.method = SSH_AUTH_RHOSTS_RSA;
780 }
781 } else {
782 pvar->auth_state.cur_cred.method = SSH_AUTH_RHOSTS;
783 }
784
785 pvar->auth_state.cur_cred.rhosts_client_user =
786 _strdup(pvar->session_settings.DefaultRhostsLocalUserName);
787 break;
788
789 case SSH_AUTH_PASSWORD:
790 pvar->auth_state.cur_cred.password = _strdup("");
791 pvar->auth_state.cur_cred.method = SSH_AUTH_PASSWORD;
792 break;
793
794 case SSH_AUTH_TIS:
795 default:
796 return;
797 }
798
799 pvar->auth_state.user =
800 _strdup(pvar->session_settings.DefaultUserName);
801 }
802 }
803
804 void AUTH_notify_end_error(PTInstVar pvar)
805 {
806 if ((pvar->auth_state.flags & AUTH_START_USER_AUTH_ON_ERROR_END) != 0) {
807 start_user_auth(pvar);
808 pvar->auth_state.flags &= ~AUTH_START_USER_AUTH_ON_ERROR_END;
809 }
810 }
811
812 void AUTH_advance_to_next_cred(PTInstVar pvar)
813 {
814 pvar->auth_state.failed_method = pvar->auth_state.cur_cred.method;
815
816 if (pvar->auth_state.cur_cred.method == SSH_AUTH_NONE) {
817 try_default_auth(pvar);
818
819 if (pvar->auth_state.cur_cred.method == SSH_AUTH_NONE) {
820 if (pvar->err_msg != NULL) {
821 pvar->auth_state.flags |=
822 AUTH_START_USER_AUTH_ON_ERROR_END;
823 } else {
824 // �������F���_�C�A���O���o�������� (2004.12.1 yutaka)
825 // �R�}���h���C���w������������
826 start_user_auth(pvar);
827 }
828 }
829 } else {
830 // �������F���_�C�A���O���o�������� (2004.12.1 yutaka)
831 // �R�}���h���C���w������(/auth=xxxx)������
832 start_user_auth(pvar);
833 }
834 }
835
836 static void init_TIS_dlg(PTInstVar pvar, HWND dlg)
837 {
838 char uimsg[MAX_UIMSG];
839
840 GetWindowText(dlg, uimsg, sizeof(uimsg));
841 UTIL_get_lang_msg("DLG_TIS_TITLE", pvar, uimsg);
842 SetWindowText(dlg, pvar->ts->UIMsg);
843 GetDlgItemText(dlg, IDC_SSHAUTHBANNER, uimsg, sizeof(uimsg));
844 UTIL_get_lang_msg("DLG_TIS_BANNER", pvar, uimsg);
845 SetDlgItemText(dlg, IDC_SSHAUTHBANNER, pvar->ts->UIMsg);
846 GetDlgItemText(dlg, IDOK, uimsg, sizeof(uimsg));
847 UTIL_get_lang_msg("BTN_OK", pvar, uimsg);
848 SetDlgItemText(dlg, IDOK, pvar->ts->UIMsg);
849 GetDlgItemText(dlg, IDCANCEL, uimsg, sizeof(uimsg));
850 UTIL_get_lang_msg("BTN_DISCONNECT", pvar, uimsg);
851 SetDlgItemText(dlg, IDCANCEL, pvar->ts->UIMsg);
852
853 init_auth_machine_banner(pvar, dlg);
854 init_password_control(dlg);
855
856 if (pvar->auth_state.TIS_prompt != NULL) {
857 if (strlen(pvar->auth_state.TIS_prompt) > 10000) {
858 pvar->auth_state.TIS_prompt[10000] = 0;
859 }
860 SetDlgItemText(dlg, IDC_SSHAUTHBANNER2,
861 pvar->auth_state.TIS_prompt);
862 destroy_malloced_string(&pvar->auth_state.TIS_prompt);
863 }
864 }
865
866 static BOOL end_TIS_dlg(PTInstVar pvar, HWND dlg)
867 {
868 char FAR *password =
869 alloc_control_text(GetDlgItem(dlg, IDC_SSHPASSWORD));
870
871 pvar->auth_state.cur_cred.method = SSH_AUTH_TIS;
872 pvar->auth_state.cur_cred.password = password;
873 pvar->auth_state.auth_dialog = NULL;
874
875 // add
876 if (SSHv2(pvar)) {
877 pvar->keyboard_interactive_password_input = 1;
878 handle_SSH2_userauth_inforeq(pvar);
879 }
880
881 SSH_notify_cred(pvar);
882
883 EndDialog(dlg, 1);
884 return TRUE;
885 }
886
887 static BOOL CALLBACK TIS_dlg_proc(HWND dlg, UINT msg, WPARAM wParam,
888 LPARAM lParam)
889 {
890 PTInstVar pvar;
891 LOGFONT logfont;
892 HFONT font;
893
894 switch (msg) {
895 case WM_INITDIALOG:
896 pvar = (PTInstVar) lParam;
897 pvar->auth_state.auth_dialog = dlg;
898 SetWindowLong(dlg, DWL_USER, lParam);
899
900 init_TIS_dlg(pvar, dlg);
901
902 font = (HFONT)SendMessage(dlg, WM_GETFONT, 0, 0);
903 GetObject(font, sizeof(LOGFONT), &logfont);
904 if (UTIL_get_lang_font("DLG_TAHOMA_FONT", dlg, &logfont, &DlgTisFont, pvar)) {
905 SendDlgItemMessage(dlg, IDC_SSHAUTHBANNER, WM_SETFONT, (WPARAM)DlgTisFont, MAKELPARAM(TRUE,0));
906 SendDlgItemMessage(dlg, IDC_SSHAUTHBANNER2, WM_SETFONT, (WPARAM)DlgTisFont, MAKELPARAM(TRUE,0));
907 SendDlgItemMessage(dlg, IDC_SSHPASSWORD, WM_SETFONT, (WPARAM)DlgTisFont, MAKELPARAM(TRUE,0));
908 SendDlgItemMessage(dlg, IDOK, WM_SETFONT, (WPARAM)DlgTisFont, MAKELPARAM(TRUE,0));
909 SendDlgItemMessage(dlg, IDCANCEL, WM_SETFONT, (WPARAM)DlgTisFont, MAKELPARAM(TRUE,0));
910 }
911 else {
912 DlgTisFont = NULL;
913 }
914
915 return FALSE; /* because we set the focus */
916
917 case WM_COMMAND:
918 pvar = (PTInstVar) GetWindowLong(dlg, DWL_USER);
919
920 switch (LOWORD(wParam)) {
921 case IDOK:
922 if (DlgTisFont != NULL) {
923 DeleteObject(DlgTisFont);
924 }
925
926 return end_TIS_dlg(pvar, dlg);
927
928 case IDCANCEL: /* kill the connection */
929 pvar->auth_state.auth_dialog = NULL;
930 notify_closed_connection(pvar);
931 EndDialog(dlg, 0);
932
933 if (DlgTisFont != NULL) {
934 DeleteObject(DlgTisFont);
935 }
936
937 return TRUE;
938
939 default:
940 return FALSE;
941 }
942
943 default:
944 return FALSE;
945 }
946 }
947
948 void AUTH_do_cred_dialog(PTInstVar pvar)
949 {
950 if (pvar->auth_state.auth_dialog == NULL) {
951 HWND cur_active = GetActiveWindow();
952 DLGPROC dlg_proc;
953 LPCTSTR dialog_template;
954
955 switch (pvar->auth_state.mode) {
956 case TIS_AUTH_MODE:
957 dialog_template = MAKEINTRESOURCE(IDD_SSHTISAUTH);
958 dlg_proc = TIS_dlg_proc;
959 break;
960 case GENERIC_AUTH_MODE:
961 default:
962 dialog_template = MAKEINTRESOURCE(IDD_SSHAUTH);
963 dlg_proc = auth_dlg_proc;
964 }
965
966 if (!DialogBoxParam(hInst, dialog_template,
967 cur_active !=
968 NULL ? cur_active : pvar->NotificationWindow,
969 dlg_proc, (LPARAM) pvar) == -1) {
970 UTIL_get_lang_msg("MSG_CREATEWINDOW_AUTH_ERROR", pvar,
971 "Unable to display authentication dialog box.\n"
972 "Connection terminated.");
973 notify_fatal_error(pvar, pvar->ts->UIMsg);
974 }
975 }
976 }
977
978 static void init_default_auth_dlg(PTInstVar pvar, HWND dlg)
979 {
980 char uimsg[MAX_UIMSG];
981
982 GetWindowText(dlg, uimsg, sizeof(uimsg));
983 UTIL_get_lang_msg("DLG_AUTHSETUP_TITLE", pvar, uimsg);
984 SetWindowText(dlg, pvar->ts->UIMsg);
985 GetDlgItemText(dlg, IDC_SSHAUTHBANNER, uimsg, sizeof(uimsg));
986 UTIL_get_lang_msg("DLG_AUTHSETUP_BANNER", pvar, uimsg);
987 SetDlgItemText(dlg, IDC_SSHAUTHBANNER, pvar->ts->UIMsg);
988 GetDlgItemText(dlg, IDC_SSHUSERNAMELABEL, uimsg, sizeof(uimsg));
989 UTIL_get_lang_msg("DLG_AUTHSETUP_USERNAME", pvar, uimsg);
990 SetDlgItemText(dlg, IDC_SSHUSERNAMELABEL, pvar->ts->UIMsg);
991 GetDlgItemText(dlg, IDC_SSHUSEPASSWORD, uimsg, sizeof(uimsg));
992 UTIL_get_lang_msg("DLG_AUTHSETUP_METHOD_PASSWORD", pvar, uimsg);
993 SetDlgItemText(dlg, IDC_SSHUSEPASSWORD, pvar->ts->UIMsg);
994 GetDlgItemText(dlg, IDC_KEYBOARD_INTERACTIVE_CHECK, uimsg, sizeof(uimsg));
995 UTIL_get_lang_msg("DLG_AUTHSETUP_METHOD_PASSWORD_KBDINT", pvar, uimsg);
996 SetDlgItemText(dlg, IDC_KEYBOARD_INTERACTIVE_CHECK, pvar->ts->UIMsg);
997 GetDlgItemText(dlg, IDC_SSHUSERSA, uimsg, sizeof(uimsg));
998 UTIL_get_lang_msg("DLG_AUTHSETUP_METHOD_RSA", pvar, uimsg);
999 SetDlgItemText(dlg, IDC_SSHUSERSA, pvar->ts->UIMsg);
1000 GetDlgItemText(dlg, IDC_SSHUSERHOSTS, uimsg, sizeof(uimsg));
1001 UTIL_get_lang_msg("DLG_AUTHSETUP_METHOD_RHOST", pvar, uimsg);
1002 SetDlgItemText(dlg, IDC_SSHUSERHOSTS, pvar->ts->UIMsg);
1003 GetDlgItemText(dlg, IDC_SSHUSETIS, uimsg, sizeof(uimsg));
1004 UTIL_get_lang_msg("DLG_AUTHSETUP_METHOD_CHALLENGE", pvar, uimsg);
1005 SetDlgItemText(dlg, IDC_SSHUSETIS, pvar->ts->UIMsg);
1006 GetDlgItemText(dlg, IDC_CHOOSERSAFILE, uimsg, sizeof(uimsg));
1007 UTIL_get_lang_msg("DLG_AUTH_PRIVATEKEY", pvar, uimsg);
1008 SetDlgItemText(dlg, IDC_CHOOSERSAFILE, pvar->ts->UIMsg);
1009 GetDlgItemText(dlg, IDC_LOCALUSERNAMELABEL, uimsg, sizeof(uimsg));
1010 UTIL_get_lang_msg("DLG_AUTH_LOCALUSER", pvar, uimsg);
1011 SetDlgItemText(dlg, IDC_LOCALUSERNAMELABEL, pvar->ts->UIMsg);
1012 GetDlgItemText(dlg, IDC_CHOOSEHOSTRSAFILE, uimsg, sizeof(uimsg));
1013 UTIL_get_lang_msg("DLG_AUTH_HOST_PRIVATEKEY", pvar, uimsg);
1014 SetDlgItemText(dlg, IDC_CHOOSEHOSTRSAFILE, pvar->ts->UIMsg);
1015 GetDlgItemText(dlg, IDOK, uimsg, sizeof(uimsg));
1016 UTIL_get_lang_msg("BTN_OK", pvar, uimsg);
1017 SetDlgItemText(dlg, IDOK, pvar->ts->UIMsg);
1018 GetDlgItemText(dlg, IDCANCEL, uimsg, sizeof(uimsg));
1019 UTIL_get_lang_msg("BTN_CANCEL", pvar, uimsg);
1020 SetDlgItemText(dlg, IDCANCEL, pvar->ts->UIMsg);
1021
1022 switch (pvar->settings.DefaultAuthMethod) {
1023 case SSH_AUTH_RSA:
1024 CheckRadioButton(dlg, IDC_SSHUSEPASSWORD, MAX_AUTH_CONTROL,
1025 IDC_SSHUSERSA);
1026 break;
1027 case SSH_AUTH_RHOSTS:
1028 case SSH_AUTH_RHOSTS_RSA:
1029 CheckRadioButton(dlg, IDC_SSHUSEPASSWORD, MAX_AUTH_CONTROL,
1030 IDC_SSHUSERHOSTS);
1031 break;
1032 case SSH_AUTH_TIS:
1033 CheckRadioButton(dlg, IDC_SSHUSEPASSWORD, MAX_AUTH_CONTROL,
1034 IDC_SSHUSETIS);
1035 break;
1036 case SSH_AUTH_PASSWORD:
1037 default:
1038 CheckRadioButton(dlg, IDC_SSHUSEPASSWORD, MAX_AUTH_CONTROL,
1039 IDC_SSHUSEPASSWORD);
1040 }
1041
1042 SetDlgItemText(dlg, IDC_SSHUSERNAME, pvar->settings.DefaultUserName);
1043 SetDlgItemText(dlg, IDC_RSAFILENAME,
1044 pvar->settings.DefaultRSAPrivateKeyFile);
1045 SetDlgItemText(dlg, IDC_HOSTRSAFILENAME,
1046 pvar->settings.DefaultRhostsHostPrivateKeyFile);
1047 SetDlgItemText(dlg, IDC_LOCALUSERNAME,
1048 pvar->settings.DefaultRhostsLocalUserName);
1049
1050 // SSH2 keyboard-interactive method (2005.2.22 yutaka)
1051 if (pvar->settings.ssh2_keyboard_interactive) {
1052 SendMessage(GetDlgItem(dlg, IDC_KEYBOARD_INTERACTIVE_CHECK), BM_SETCHECK, BST_CHECKED, 0);
1053 }
1054
1055 }
1056
1057 static BOOL end_default_auth_dlg(PTInstVar pvar, HWND dlg)
1058 {
1059 if (IsDlgButtonChecked(dlg, IDC_SSHUSERSA)) {
1060 pvar->settings.DefaultAuthMethod = SSH_AUTH_RSA;
1061 } else if (IsDlgButtonChecked(dlg, IDC_SSHUSERHOSTS)) {
1062 if (GetWindowTextLength(GetDlgItem(dlg, IDC_HOSTRSAFILENAME)) > 0) {
1063 pvar->settings.DefaultAuthMethod = SSH_AUTH_RHOSTS_RSA;
1064 } else {
1065 pvar->settings.DefaultAuthMethod = SSH_AUTH_RHOSTS;
1066 }
1067 } else if (IsDlgButtonChecked(dlg, IDC_SSHUSETIS)) {
1068 pvar->settings.DefaultAuthMethod = SSH_AUTH_TIS;
1069 } else {
1070 pvar->settings.DefaultAuthMethod = SSH_AUTH_PASSWORD;
1071 }
1072
1073 GetDlgItemText(dlg, IDC_SSHUSERNAME, pvar->settings.DefaultUserName,
1074 sizeof(pvar->settings.DefaultUserName));
1075 GetDlgItemText(dlg, IDC_RSAFILENAME,
1076 pvar->settings.DefaultRSAPrivateKeyFile,
1077 sizeof(pvar->settings.DefaultRSAPrivateKeyFile));
1078 GetDlgItemText(dlg, IDC_HOSTRSAFILENAME,
1079 pvar->settings.DefaultRhostsHostPrivateKeyFile,
1080 sizeof(pvar->settings.DefaultRhostsHostPrivateKeyFile));
1081 GetDlgItemText(dlg, IDC_LOCALUSERNAME,
1082 pvar->settings.DefaultRhostsLocalUserName,
1083 sizeof(pvar->settings.DefaultRhostsLocalUserName));
1084
1085 // SSH2 keyboard-interactive method (2005.2.22 yutaka)
1086 {
1087 LRESULT ret;
1088 ret = SendMessage(GetDlgItem(dlg, IDC_KEYBOARD_INTERACTIVE_CHECK), BM_GETCHECK, 0, 0);
1089 if (ret & BST_CHECKED) {
1090 pvar->settings.ssh2_keyboard_interactive = 1;
1091 } else {
1092 pvar->settings.ssh2_keyboard_interactive = 0;
1093 }
1094 }
1095
1096 EndDialog(dlg, 1);
1097 return TRUE;
1098 }
1099
1100 static BOOL CALLBACK default_auth_dlg_proc(HWND dlg, UINT msg,
1101 WPARAM wParam, LPARAM lParam)
1102 {
1103 PTInstVar pvar;
1104 LOGFONT logfont;
1105 HFONT font;
1106
1107 switch (msg) {
1108 case WM_INITDIALOG:
1109 pvar = (PTInstVar) lParam;
1110 SetWindowLong(dlg, DWL_USER, lParam);
1111
1112 init_default_auth_dlg(pvar, dlg);
1113
1114 font = (HFONT)SendMessage(dlg, WM_GETFONT, 0, 0);
1115 GetObject(font, sizeof(LOGFONT), &logfont);
1116 if (UTIL_get_lang_font("DLG_TAHOMA_FONT", dlg, &logfont, &DlgAuthSetupFont, pvar)) {
1117 SendDlgItemMessage(dlg, IDC_SSHAUTHBANNER, WM_SETFONT, (WPARAM)DlgAuthSetupFont, MAKELPARAM(TRUE,0));
1118 SendDlgItemMessage(dlg, IDC_SSHUSERNAMELABEL, WM_SETFONT, (WPARAM)DlgAuthSetupFont, MAKELPARAM(TRUE,0));
1119 SendDlgItemMessage(dlg, IDC_SSHUSERNAME, WM_SETFONT, (WPARAM)DlgAuthSetupFont, MAKELPARAM(TRUE,0));
1120 SendDlgItemMessage(dlg, IDC_SSHUSEPASSWORD, WM_SETFONT, (WPARAM)DlgAuthSetupFont, MAKELPARAM(TRUE,0));
1121 SendDlgItemMessage(dlg, IDC_KEYBOARD_INTERACTIVE_CHECK, WM_SETFONT, (WPARAM)DlgAuthSetupFont, MAKELPARAM(TRUE,0));
1122 SendDlgItemMessage(dlg, IDC_SSHUSERSA, WM_SETFONT, (WPARAM)DlgAuthSetupFont, MAKELPARAM(TRUE,0));
1123 SendDlgItemMessage(dlg, IDC_CHOOSERSAFILE, WM_SETFONT, (WPARAM)DlgAuthSetupFont, MAKELPARAM(TRUE,0));
1124 SendDlgItemMessage(dlg, IDC_RSAFILENAME, WM_SETFONT, (WPARAM)DlgAuthSetupFont, MAKELPARAM(TRUE,0));
1125 SendDlgItemMessage(dlg, IDC_SSHUSERHOSTS, WM_SETFONT, (WPARAM)DlgAuthSetupFont, MAKELPARAM(TRUE,0));
1126 SendDlgItemMessage(dlg, IDC_LOCALUSERNAMELABEL, WM_SETFONT, (WPARAM)DlgAuthSetupFont, MAKELPARAM(TRUE,0));
1127 SendDlgItemMessage(dlg, IDC_LOCALUSERNAME, WM_SETFONT, (WPARAM)DlgAuthSetupFont, MAKELPARAM(TRUE,0));
1128 SendDlgItemMessage(dlg, IDC_CHOOSEHOSTRSAFILE, WM_SETFONT, (WPARAM)DlgAuthSetupFont, MAKELPARAM(TRUE,0));
1129 SendDlgItemMessage(dlg, IDC_HOSTRSAFILENAME, WM_SETFONT, (WPARAM)DlgAuthSetupFont, MAKELPARAM(TRUE,0));
1130 SendDlgItemMessage(dlg, IDC_SSHUSETIS, WM_SETFONT, (WPARAM)DlgAuthSetupFont, MAKELPARAM(TRUE,0));
1131 SendDlgItemMessage(dlg, IDOK, WM_SETFONT, (WPARAM)DlgAuthSetupFont, MAKELPARAM(TRUE,0));
1132 SendDlgItemMessage(dlg, IDCANCEL, WM_SETFONT, (WPARAM)DlgAuthSetupFont, MAKELPARAM(TRUE,0));
1133 }
1134 else {
1135 DlgAuthSetupFont = NULL;
1136 }
1137
1138 return TRUE; /* because we do not set the focus */
1139
1140 case WM_COMMAND:
1141 pvar = (PTInstVar) GetWindowLong(dlg, DWL_USER);
1142
1143 switch (LOWORD(wParam)) {
1144 case IDOK:
1145
1146 if (DlgAuthSetupFont != NULL) {
1147 DeleteObject(DlgAuthSetupFont);
1148 }
1149
1150 return end_default_auth_dlg(pvar, dlg);
1151
1152 case IDCANCEL:
1153 EndDialog(dlg, 0);
1154
1155 if (DlgAuthSetupFont != NULL) {
1156 DeleteObject(DlgAuthSetupFont);
1157 }
1158
1159 return TRUE;
1160
1161 case IDC_CHOOSERSAFILE:
1162 choose_RSA_key_file(dlg, pvar);
1163 return TRUE;
1164
1165 case IDC_CHOOSEHOSTRSAFILE:
1166 choose_host_RSA_key_file(dlg, pvar);
1167 return TRUE;
1168
1169 default:
1170 return FALSE;
1171 }
1172
1173 default:
1174 return FALSE;
1175 }
1176 }
1177
1178 void AUTH_init(PTInstVar pvar)
1179 {
1180 pvar->auth_state.failed_method = SSH_AUTH_NONE;
1181 pvar->auth_state.auth_dialog = NULL;
1182 pvar->auth_state.user = NULL;
1183 pvar->auth_state.flags = 0;
1184 pvar->auth_state.TIS_prompt = NULL;
1185 pvar->auth_state.supported_types = 0;
1186 pvar->auth_state.cur_cred.method = SSH_AUTH_NONE;
1187 pvar->auth_state.cur_cred.password = NULL;
1188 pvar->auth_state.cur_cred.rhosts_client_user = NULL;
1189 pvar->auth_state.cur_cred.key_pair = NULL;
1190 AUTH_set_generic_mode(pvar);
1191 }
1192
1193 void AUTH_set_generic_mode(PTInstVar pvar)
1194 {
1195 pvar->auth_state.mode = GENERIC_AUTH_MODE;
1196 destroy_malloced_string(&pvar->auth_state.TIS_prompt);
1197 }
1198
1199 void AUTH_set_TIS_mode(PTInstVar pvar, char FAR * prompt, int len)
1200 {
1201 if (pvar->auth_state.cur_cred.method == SSH_AUTH_TIS) {
1202 pvar->auth_state.mode = TIS_AUTH_MODE;
1203
1204 destroy_malloced_string(&pvar->auth_state.TIS_prompt);
1205 pvar->auth_state.TIS_prompt = malloc(len + 1);
1206 memcpy(pvar->auth_state.TIS_prompt, prompt, len);
1207 pvar->auth_state.TIS_prompt[len] = 0;
1208 } else {
1209 AUTH_set_generic_mode(pvar);
1210 }
1211 }
1212
1213 void AUTH_do_default_cred_dialog(PTInstVar pvar)
1214 {
1215 HWND cur_active = GetActiveWindow();
1216
1217 if (DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_SSHAUTHSETUP),
1218 cur_active !=
1219 NULL ? cur_active : pvar->NotificationWindow,
1220 default_auth_dlg_proc, (LPARAM) pvar) == -1) {
1221 UTIL_get_lang_msg("MSG_CREATEWINDOW_AUTHSETUP_ERROR", pvar,
1222 "Unable to display authentication setup dialog box.");
1223 notify_nonfatal_error(pvar, pvar->ts->UIMsg);
1224 }
1225 }
1226
1227 void AUTH_destroy_cur_cred(PTInstVar pvar)
1228 {
1229 destroy_malloced_string(&pvar->auth_state.cur_cred.password);
1230 destroy_malloced_string(&pvar->auth_state.cur_cred.rhosts_client_user);
1231 if (pvar->auth_state.cur_cred.key_pair != NULL) {
1232 CRYPT_free_key_pair(pvar->auth_state.cur_cred.key_pair);
1233 pvar->auth_state.cur_cred.key_pair = NULL;
1234 }
1235 }
1236
1237 static char FAR *get_auth_method_name(SSHAuthMethod auth)
1238 {
1239 switch (auth) {
1240 case SSH_AUTH_PASSWORD:
1241 return "password";
1242 case SSH_AUTH_RSA:
1243 return "RSA";
1244 case SSH_AUTH_RHOSTS:
1245 return "rhosts";
1246 case SSH_AUTH_RHOSTS_RSA:
1247 return "rhosts with RSA";
1248 case SSH_AUTH_TIS:
1249 return "challenge/response (TIS)";
1250 default:
1251 return "unknown method";
1252 }
1253 }
1254
1255 void AUTH_get_auth_info(PTInstVar pvar, char FAR * dest, int len)
1256 {
1257 char *method = "unknown";
1258
1259 if (pvar->auth_state.user == NULL) {
1260 strncpy_s(dest, len, "None", _TRUNCATE);
1261 } else if (pvar->auth_state.cur_cred.method != SSH_AUTH_NONE) {
1262 if (SSHv1(pvar)) {
1263 UTIL_get_lang_msg("DLG_ABOUT_AUTH_INFO", pvar, "User '%s', using %s");
1264 _snprintf_s(dest, len, _TRUNCATE, pvar->ts->UIMsg, pvar->auth_state.user,
1265 get_auth_method_name(pvar->auth_state.cur_cred.method));
1266
1267 } else {
1268 // SSH2:�F�����\�b�h������ (2004.12.23 yutaka)
1269 // keyboard-interactive���\�b�h������ (2005.3.12 yutaka)
1270 if (pvar->auth_state.cur_cred.method == SSH_AUTH_PASSWORD ||
1271 pvar->auth_state.cur_cred.method == SSH_AUTH_TIS) {
1272 // keyboard-interactive���\�b�h������ (2005.1.24 yutaka)
1273 if (pvar->keyboard_interactive_done == 1 ||
1274 pvar->auth_state.cur_cred.method == SSH_AUTH_TIS) {
1275 method = "keyboard-interactive";
1276 } else {
1277 method = get_auth_method_name(pvar->auth_state.cur_cred.method);
1278 }
1279 UTIL_get_lang_msg("DLG_ABOUT_AUTH_INFO", pvar, "User '%s', using %s");
1280 _snprintf_s(dest, len, _TRUNCATE,
1281 pvar->ts->UIMsg, pvar->auth_state.user, method);
1282
1283 } else {
1284 if (pvar->auth_state.cur_cred.key_pair->RSA_key != NULL) {
1285 method = "RSA";
1286 } else if (pvar->auth_state.cur_cred.key_pair->DSA_key != NULL) {
1287 method = "DSA";
1288 }
1289 UTIL_get_lang_msg("DLG_ABOUT_AUTH_INFO", pvar, "User '%s', using %s");
1290 _snprintf_s(dest, len, _TRUNCATE,
1291 pvar->ts->UIMsg, pvar->auth_state.user, method);
1292 }
1293
1294 }
1295
1296 } else {
1297 UTIL_get_lang_msg("DLG_ABOUT_AUTH_INFO", pvar, "User '%s', using %s");
1298 _snprintf_s(dest, len, _TRUNCATE, pvar->ts->UIMsg, pvar->auth_state.user,
1299 get_auth_method_name(pvar->auth_state.failed_method));
1300 }
1301
1302 dest[len - 1] = 0;
1303 }
1304
1305 void AUTH_notify_disconnecting(PTInstVar pvar)
1306 {
1307 if (pvar->auth_state.auth_dialog != NULL) {
1308 PostMessage(pvar->auth_state.auth_dialog, WM_COMMAND, IDCANCEL, 0);
1309 /* the main window might not go away if it's not enabled. (see vtwin.cpp) */
1310 EnableWindow(pvar->NotificationWindow, TRUE);
1311 }
1312 }
1313
1314 void AUTH_end(PTInstVar pvar)
1315 {
1316 destroy_malloced_string(&pvar->auth_state.user);
1317 destroy_malloced_string(&pvar->auth_state.TIS_prompt);
1318
1319 AUTH_destroy_cur_cred(pvar);
1320 }
1321
1322 /*
1323 * $Log: not supported by cvs2svn $
1324 * Revision 1.34 2007/08/08 16:04:08 maya
1325 * ���S���������g�p�������������X�����B
1326 *
1327 * Revision 1.33 2007/06/06 14:10:12 maya
1328 * �v���v���Z�b�T�������\�������������������������AINET6 �� I18N �� #define ���t�]�������B
1329 *
1330 * Revision 1.32 2007/03/17 11:53:29 doda
1331 * �v���C���e�L�X�g�F�����������L�[�{�[�h�C���^���N�e�B�u�F�����g�p�������������������������ASSH�F���_�C�A���O���v���C���e�L�X�g�F����rhosts�F�����\�������������C�������B
1332 *
1333 * Revision 1.31 2007/02/17 17:31:55 yasuhide
1334 * �R�}���h���C����ask4passwd ���w�����������A���O�C���_�C�A���O���p�X�t���[�Y�������t�H�[�J�X����
1335 *
1336 * Revision 1.30 2007/02/17 16:20:21 yasuhide
1337 * SSH2 �����p�����F�����p�X�t���[�Y�������������A�p�X�t���[�Y�_�C�A���O���t�H�[�J�X������
1338 *
1339 * Revision 1.29 2007/02/17 14:01:03 maya
1340 * �\�����b�Z�[�W��������������
1341 *
1342 * Revision 1.28 2007/01/31 13:15:08 maya
1343 * �����t�@�C�������������� \0 ���������F�����������o�O���C�������B
1344 *
1345 * Revision 1.27 2007/01/27 14:29:59 maya
1346 * �p���������{�������A�N�Z�����[�^�L�[�����������B
1347 *
1348 * Revision 1.26 2007/01/22 13:45:19 maya
1349 * �\�����b�Z�[�W��������������
1350 *
1351 * Revision 1.25 2007/01/04 08:36:42 maya
1352 * �t�H���g�����X�������������������B
1353 *
1354 * Revision 1.24 2006/12/06 14:31:13 maya
1355 * �\�����b�Z�[�W��������������
1356 *
1357 * Revision 1.23 2006/12/06 14:25:40 maya
1358 * �\�����b�Z�[�W��������������
1359 *
1360 * Revision 1.22 2006/11/29 16:58:52 maya
1361 * �\�����b�Z�[�W��������������
1362 *
1363 * Revision 1.21 2006/11/23 02:19:30 maya
1364 * �\�����b�Z�[�W�������t�@�C�����������������R�[�h���������J�n�����B
1365 *
1366 * Revision 1.20 2006/09/18 05:08:04 maya
1367 * �R�}���h���C���p�����[�^ '/ask4passwd' �����������B
1368 *
1369 * Revision 1.19 2006/08/05 03:47:49 yutakakn
1370 * �p�X���[�h�������������o������������������������ teraterm.ini �����f�����������������B
1371 *
1372 * Revision 1.18 2006/08/03 15:04:37 yutakakn
1373 * �p�X���[�h�������������������������������������`�F�b�N�{�b�N�X���F���_�C�A���O�����������B
1374 *
1375 * Revision 1.17 2005/09/05 10:46:22 yutakakn
1376 * '/I' �w�����������������F���_�C�A���O�����������������������B
1377 *
1378 * Revision 1.16 2005/08/26 16:26:02 yutakakn
1379 * �������O�C������SSH�F���_�C�A���O�����������������������B
1380 *
1381 * Revision 1.15 2005/07/15 14:58:04 yutakakn
1382 * SSH1���������x���[�U�F�������s�������A�������F�����������������o�O���C���B
1383 *
1384 * Revision 1.14 2005/04/26 13:57:57 yutakakn
1385 * private key�t�@�C���_�C�A���O��3�t�@�C���t�B���^�����������B
1386 *
1387 * Revision 1.13 2005/04/08 14:55:03 yutakakn
1388 * "Duplicate session"��������SSH�������O�C�����s�������������B
1389 *
1390 * Revision 1.12 2005/03/23 12:39:35 yutakakn
1391 * SSH2�F���_�C�A���O�� Use challenge/response to log in ���A�N�Z�����[�^�L�[�������������B
1392 *
1393 * Revision 1.11 2005/03/12 15:07:33 yutakakn
1394 * SSH2 keyboard-interactive�F����TIS�_�C�A���O�����������B
1395 *
1396 * Revision 1.10 2005/03/12 12:08:05 yutakakn
1397 * �p�X���[�h�F�����O���s��keyboard-interactive���\�b�h���A�f�t�H���g�����l������(0)�������B
1398 * �����A�F���_�C�A���O�����x�������������L�����������X���������������B
1399 *
1400 * Revision 1.9 2005/02/22 08:48:11 yutakakn
1401 * TTSSH setup�_�C�A���O�� HeartBeat �����������B
1402 * TTSSH authentication setup�_�C�A���O�� keyboard-interactive �����������B
1403 *
1404 * Revision 1.8 2005/01/27 13:30:33 yutakakn
1405 * ���J���F���������O�C�����T�|�[�g�B
1406 * /auth=publickey, /keyfile �I�v�V�������V�K���������B
1407 * �����A�����������������T�|�[�g�B
1408 *
1409 * Revision 1.7 2005/01/25 13:38:22 yutakakn
1410 * SSH�F���_�C�A���O���ARhosts/TIS���O���[�������O���AEnter�L�[�������������A
1411 * �A�v���P�[�V�����G���[���������������������B
1412 *
1413 * Revision 1.6 2005/01/24 14:07:07 yutakakn
1414 * �Ekeyboard-interactive�F�����T�|�[�g�����B
1415 * �@�����������Ateraterm.ini�� "KeyboardInteractive" �G���g�������������B
1416 * �E�o�[�W�����_�C�A���O�� OpenSSL�o�[�W���� ������
1417 *
1418 * Revision 1.5 2004/12/27 14:35:41 yutakakn
1419 * SSH2�����������������s�����G���[���b�Z�[�W�����������B
1420 *
1421 * Revision 1.4 2004/12/22 17:28:14 yutakakn
1422 * SSH2���J���F��(RSA/DSA)���T�|�[�g�����B
1423 *
1424 * Revision 1.3 2004/12/16 13:01:09 yutakakn
1425 * SSH�������O�C�����A�v���P�[�V�����G���[�������������C�������B
1426 *
1427 * Revision 1.2 2004/12/01 15:37:49 yutakakn
1428 * SSH2�������O�C���@�\�������B
1429 * �����A�p�X���[�h�F�������������B
1430 * �E�R�}���h���C��
1431 * /ssh /auth=�F�����\�b�h /user=���[�U�� /passwd=�p�X���[�h
1432 *
1433 */

Back to OSDN">Back to OSDN
ViewVC Help
Powered by ViewVC 1.1.26