| 1127 |
FWDUI_load_settings(pvar); |
FWDUI_load_settings(pvar); |
| 1128 |
} |
} |
| 1129 |
|
|
| 1130 |
|
|
| 1131 |
|
// @をブランクに置換する。 (2005.1.26 yutaka) |
| 1132 |
|
static void replace_to_blank(char *src, char *dst, int dst_len) |
| 1133 |
|
{ |
| 1134 |
|
int len, i; |
| 1135 |
|
|
| 1136 |
|
len = strlen(src); |
| 1137 |
|
if (dst_len < len) // buffer overflow check |
| 1138 |
|
return; |
| 1139 |
|
|
| 1140 |
|
for (i = 0 ; i < len ; i++) { |
| 1141 |
|
if (src[i] == '@') { // @ が登場したら |
| 1142 |
|
if (i < len - 1 && src[i + 1] == '@') { // その次も @ ならアットマークと認識する |
| 1143 |
|
*dst++ = '@'; |
| 1144 |
|
i++; |
| 1145 |
|
} else { |
| 1146 |
|
*dst++ = ' '; // 空白に置き換える |
| 1147 |
|
} |
| 1148 |
|
} else { |
| 1149 |
|
*dst++ = src[i]; |
| 1150 |
|
} |
| 1151 |
|
} |
| 1152 |
|
*dst = '\0'; |
| 1153 |
|
} |
| 1154 |
|
|
| 1155 |
/* returns 1 if the option text must be deleted */ |
/* returns 1 if the option text must be deleted */ |
| 1156 |
static int parse_option(PTInstVar pvar, char FAR * option) |
static int parse_option(PTInstVar pvar, char FAR * option) |
| 1157 |
{ |
{ |
| 1216 |
pvar->settings.Enabled = 0; |
pvar->settings.Enabled = 0; |
| 1217 |
|
|
| 1218 |
} else if (MATCH_STR(option + 1, "auth") == 0) { |
} else if (MATCH_STR(option + 1, "auth") == 0) { |
| 1219 |
// SSH2自動ログインオプションの追加 (2004.11.30 yutaka) |
// SSH2自動ログインオプションの追加 |
| 1220 |
|
// |
| 1221 |
|
// SYNOPSIS: /ssh /auth=passowrd /user=ユーザ名 /passwd=パスワード |
| 1222 |
|
// /ssh /auth=publickey /user=ユーザ名 /passwd=パスワード /keyfile=パス |
| 1223 |
|
// EXAMPLE: /ssh /auth=password /user=nike /passwd=a@bc |
| 1224 |
|
// /ssh /auth=publickey /user=foo /passwd=bar /keyfile=d:\tmp\id_rsa |
| 1225 |
|
// NOTICE: パスワードやパスに空白が含む場合は、ブランクの代わりに @ を使うこと。 |
| 1226 |
// |
// |
| 1227 |
// SYNOPSIS: /ssh /auth=認証メソッド /user=ユーザ名 /passwd=パスワード |
// (2004.11.30 yutaka) |
| 1228 |
// EXAMPLE: /ssh /auth=password /user=nike "/passwd=a b c" |
// (2005.1.26 yutaka) 空白対応。公開鍵認証サポート。 |
|
// NOTICE: パスワードに空白が含まれる場合は、オプション全体を引用符で囲むこと。 |
|
| 1229 |
// |
// |
| 1230 |
pvar->ssh2_autologin = 1; // for SSH2 (2004.11.30 yutaka) |
pvar->ssh2_autologin = 1; // for SSH2 (2004.11.30 yutaka) |
| 1231 |
|
|
| 1232 |
if (MATCH_STR(option + 5, "=password") == 0) { // パスワード認証 |
if (MATCH_STR(option + 5, "=password") == 0) { // パスワード/keyboard-interactive認証 |
| 1233 |
pvar->auth_state.cur_cred.method = SSH_AUTH_PASSWORD; |
//pvar->auth_state.cur_cred.method = SSH_AUTH_PASSWORD; |
| 1234 |
|
pvar->ssh2_authmethod = SSH_AUTH_PASSWORD; |
| 1235 |
|
|
| 1236 |
|
} else if (MATCH_STR(option + 5, "=publickey") == 0) { // 公開鍵認証 |
| 1237 |
|
//pvar->auth_state.cur_cred.method = SSH_AUTH_RSA; |
| 1238 |
|
pvar->ssh2_authmethod = SSH_AUTH_RSA; |
| 1239 |
|
|
| 1240 |
} else { |
} else { |
| 1241 |
// TODO: |
// TODO: |
| 1243 |
} |
} |
| 1244 |
|
|
| 1245 |
} else if (MATCH_STR(option + 1, "user=") == 0) { |
} else if (MATCH_STR(option + 1, "user=") == 0) { |
| 1246 |
_snprintf(pvar->ssh2_username, sizeof(pvar->ssh2_username), "%s", option + 6); |
replace_to_blank(option + 6, pvar->ssh2_username, sizeof(pvar->ssh2_username)); |
| 1247 |
|
//_snprintf(pvar->ssh2_username, sizeof(pvar->ssh2_username), "%s", option + 6); |
| 1248 |
|
|
| 1249 |
} else if (MATCH_STR(option + 1, "passwd=") == 0) { |
} else if (MATCH_STR(option + 1, "passwd=") == 0) { |
| 1250 |
_snprintf(pvar->ssh2_password, sizeof(pvar->ssh2_password), "%s", option + 8); |
replace_to_blank(option + 8, pvar->ssh2_password, sizeof(pvar->ssh2_password)); |
| 1251 |
|
//_snprintf(pvar->ssh2_password, sizeof(pvar->ssh2_password), "%s", option + 8); |
| 1252 |
|
|
| 1253 |
|
} else if (MATCH_STR(option + 1, "keyfile=") == 0) { |
| 1254 |
|
replace_to_blank(option + 9, pvar->ssh2_keyfile, sizeof(pvar->ssh2_keyfile)); |
| 1255 |
|
|
| 1256 |
} |
} |
| 1257 |
|
|
| 2103 |
|
|
| 2104 |
/* |
/* |
| 2105 |
* $Log: not supported by cvs2svn $ |
* $Log: not supported by cvs2svn $ |
| 2106 |
|
* Revision 1.9 2005/01/24 14:07:07 yutakakn |
| 2107 |
|
* ・keyboard-interactive認証をサポートした。 |
| 2108 |
|
* それに伴い、teraterm.iniに "KeyboardInteractive" エントリを追加した。 |
| 2109 |
|
* ・バージョンダイアログに OpenSSLバージョン を追加 |
| 2110 |
|
* |
| 2111 |
* Revision 1.8 2004/12/27 14:05:08 yutakakn |
* Revision 1.8 2004/12/27 14:05:08 yutakakn |
| 2112 |
* 'Auto window close'が有効の場合、切断後の接続ができない問題を修正した。 |
* 'Auto window close'が有効の場合、切断後の接続ができない問題を修正した。 |
| 2113 |
* ・スレッドの終了待ち合わせ処理の追加 |
* ・スレッドの終了待ち合わせ処理の追加 |