| 1497 |
#else |
#else |
| 1498 |
notify_fatal_error(pvar, |
notify_fatal_error(pvar, |
| 1499 |
"This program does not understand the server's version of the protocol."); |
"This program does not understand the server's version of the protocol."); |
| 1500 |
#else |
#endif |
| 1501 |
} else { |
} else { |
| 1502 |
char TTSSH_ID[1024]; |
char TTSSH_ID[1024]; |
| 1503 |
int TTSSH_ID_len; |
int TTSSH_ID_len; |
| 3280 |
{NULL, NULL, 0}, |
{NULL, NULL, 0}, |
| 3281 |
}; |
}; |
| 3282 |
|
|
| 3283 |
|
|
| 3284 |
|
char *ssh_comp[] = { |
| 3285 |
|
"none", |
| 3286 |
|
"zlib", |
| 3287 |
|
"zlib@openssh.com", |
| 3288 |
|
}; |
| 3289 |
|
|
| 3290 |
static Newkeys current_keys[MODE_MAX]; |
static Newkeys current_keys[MODE_MAX]; |
| 3291 |
|
|
| 3292 |
|
|
| 3327 |
return (val); |
return (val); |
| 3328 |
} |
} |
| 3329 |
|
|
| 3330 |
|
static char * get_cipher_string(SSHCipher cipher) |
| 3331 |
|
{ |
| 3332 |
|
ssh2_cipher_t *ptr = ssh2_ciphers; |
| 3333 |
|
static char buf[32]; |
| 3334 |
|
|
| 3335 |
|
while (ptr->name != NULL) { |
| 3336 |
|
if (cipher == ptr->cipher) { |
| 3337 |
|
strncpy(buf, ptr->name, sizeof(buf)); |
| 3338 |
|
break; |
| 3339 |
|
} |
| 3340 |
|
ptr++; |
| 3341 |
|
} |
| 3342 |
|
return buf; |
| 3343 |
|
} |
| 3344 |
|
|
| 3345 |
#if 0 |
#if 0 |
| 3346 |
static int get_mac_index(char *name) |
static int get_mac_index(char *name) |
| 3745 |
pvar->kex_type = KEX_DH_GEX_SHA1; |
pvar->kex_type = KEX_DH_GEX_SHA1; |
| 3746 |
} |
} |
| 3747 |
|
|
| 3748 |
|
_snprintf(buf, sizeof(buf), "KEX algorithm: %s", ptr); |
| 3749 |
|
notify_verbose_message(pvar, buf, LOG_LEVEL_VERBOSE); |
| 3750 |
|
|
| 3751 |
// ホストキーアルゴリズムチェック |
// ホストキーアルゴリズムチェック |
| 3752 |
size = get_payload_uint32(pvar, offset); |
size = get_payload_uint32(pvar, offset); |
| 3793 |
} |
} |
| 3794 |
#endif |
#endif |
| 3795 |
|
|
| 3796 |
|
_snprintf(buf, sizeof(buf), "server host key algorithm: %s", ptr); |
| 3797 |
|
notify_verbose_message(pvar, buf, LOG_LEVEL_VERBOSE); |
| 3798 |
|
|
| 3799 |
// クライアント -> サーバ暗号アルゴリズムチェック |
// クライアント -> サーバ暗号アルゴリズムチェック |
| 3800 |
size = get_payload_uint32(pvar, offset); |
size = get_payload_uint32(pvar, offset); |
| 3801 |
offset += 4; |
offset += 4; |
| 3812 |
goto error; |
goto error; |
| 3813 |
} |
} |
| 3814 |
|
|
| 3815 |
|
_snprintf(buf, sizeof(buf), "encryption algorithm client to server: %s", get_cipher_string(pvar->ctos_cipher)); |
| 3816 |
|
notify_verbose_message(pvar, buf, LOG_LEVEL_VERBOSE); |
| 3817 |
|
|
| 3818 |
// サーバ -> クライアント暗号アルゴリズムチェック |
// サーバ -> クライアント暗号アルゴリズムチェック |
| 3819 |
size = get_payload_uint32(pvar, offset); |
size = get_payload_uint32(pvar, offset); |
| 3820 |
offset += 4; |
offset += 4; |
| 3831 |
goto error; |
goto error; |
| 3832 |
} |
} |
| 3833 |
|
|
| 3834 |
|
_snprintf(buf, sizeof(buf), "encryption algorithm server to client: %s", get_cipher_string(pvar->stoc_cipher)); |
| 3835 |
|
notify_verbose_message(pvar, buf, LOG_LEVEL_VERBOSE); |
| 3836 |
|
|
| 3837 |
// HMAC(Hash Message Authentication Code)アルゴリズムの決定 (2004.12.17 yutaka) |
// HMAC(Hash Message Authentication Code)アルゴリズムの決定 (2004.12.17 yutaka) |
| 3838 |
size = get_payload_uint32(pvar, offset); |
size = get_payload_uint32(pvar, offset); |
| 3850 |
goto error; |
goto error; |
| 3851 |
} |
} |
| 3852 |
|
|
| 3853 |
|
_snprintf(buf, sizeof(buf), "MAC algorithm client to server: %s", ssh2_macs[pvar->ctos_hmac]); |
| 3854 |
|
notify_verbose_message(pvar, buf, LOG_LEVEL_VERBOSE); |
| 3855 |
|
|
| 3856 |
size = get_payload_uint32(pvar, offset); |
size = get_payload_uint32(pvar, offset); |
| 3857 |
offset += 4; |
offset += 4; |
| 3858 |
for (i = 0; i < size; i++) { |
for (i = 0; i < size; i++) { |
| 3868 |
goto error; |
goto error; |
| 3869 |
} |
} |
| 3870 |
|
|
| 3871 |
|
_snprintf(buf, sizeof(buf), "MAC algorithm server to client: %s", ssh2_macs[pvar->stoc_hmac]); |
| 3872 |
|
notify_verbose_message(pvar, buf, LOG_LEVEL_VERBOSE); |
| 3873 |
|
|
| 3874 |
// 圧縮アルゴリズムの決定 |
// 圧縮アルゴリズムの決定 |
| 3875 |
// pvar->ssh_state.compressing = FALSE; として下記メンバを使用する。 |
// pvar->ssh_state.compressing = FALSE; として下記メンバを使用する。 |
| 3889 |
goto error; |
goto error; |
| 3890 |
} |
} |
| 3891 |
|
|
| 3892 |
|
_snprintf(buf, sizeof(buf), "compression algorithm client to server: %s", ssh_comp[pvar->ctos_compression]); |
| 3893 |
|
notify_verbose_message(pvar, buf, LOG_LEVEL_VERBOSE); |
| 3894 |
|
|
| 3895 |
size = get_payload_uint32(pvar, offset); |
size = get_payload_uint32(pvar, offset); |
| 3896 |
offset += 4; |
offset += 4; |
| 3897 |
for (i = 0; i < size; i++) { |
for (i = 0; i < size; i++) { |
| 3907 |
goto error; |
goto error; |
| 3908 |
} |
} |
| 3909 |
|
|
| 3910 |
|
_snprintf(buf, sizeof(buf), "compression algorithm server to client: %s", ssh_comp[pvar->stoc_compression]); |
| 3911 |
|
notify_verbose_message(pvar, buf, LOG_LEVEL_VERBOSE); |
| 3912 |
|
|
| 3913 |
// we_needの決定 (2004.11.6 yutaka) |
// we_needの決定 (2004.11.6 yutaka) |
| 3914 |
// キー再作成の場合はスキップする。 |
// キー再作成の場合はスキップする。 |
| 7110 |
|
|
| 7111 |
/* |
/* |
| 7112 |
* $Log: not supported by cvs2svn $ |
* $Log: not supported by cvs2svn $ |
| 7113 |
|
* Revision 1.65 2006/11/30 09:56:43 maya |
| 7114 |
|
* 表示メッセージの読み込み対応 |
| 7115 |
|
* |
| 7116 |
* Revision 1.64 2006/11/28 13:20:52 maya |
* Revision 1.64 2006/11/28 13:20:52 maya |
| 7117 |
* Cisco ルータの送信する SSH2_MSG_IGNORE のデータが不正なようなので、何も処理しないようにした。 |
* Cisco ルータの送信する SSH2_MSG_IGNORE のデータが不正なようなので、何も処理しないようにした。 |
| 7118 |
* |
* |