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 2943 - (show annotations) (download) (as text)
Wed Dec 6 14:25:40 2006 UTC (17 years, 4 months ago) by maya
Original Path: ttssh2/trunk/ttxssh/auth.c
File MIME type: text/x-csrc
File size: 47401 byte(s)
表示メッセージの読み込み対応

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

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