| 94 |
we could put them there. |
we could put them there. |
| 95 |
*/ |
*/ |
| 96 |
typedef struct _TS_SSH { |
typedef struct _TS_SSH { |
| 97 |
BOOL Enabled; |
BOOL Enabled; |
| 98 |
int CompressionLevel; /* 0 = NONE, else 1-9 */ |
int CompressionLevel; /* 0 = NONE, else 1-9 */ |
| 99 |
char DefaultUserName[256]; |
char DefaultUserName[256]; |
| 100 |
|
|
| 101 |
/* this next option is a string of digits. Each digit represents a |
/* this next option is a string of digits. Each digit represents a |
| 102 |
cipher. The first digit is the most preferred cipher, and so on. |
cipher. The first digit is the most preferred cipher, and so on. |
| 103 |
The digit SSH_CIPHER_NONE signifies that any ciphers after it are |
The digit SSH_CIPHER_NONE signifies that any ciphers after it are |
| 104 |
disabled. */ |
disabled. */ |
| 105 |
char CipherOrder[16]; |
char CipherOrder[16]; |
| 106 |
|
|
| 107 |
char KnownHostsFiles[2048]; |
char KnownHostsFiles[2048]; |
| 108 |
int DefaultAuthMethod; |
int DefaultAuthMethod; |
| 109 |
char DefaultRhostsLocalUserName[256]; |
char DefaultRhostsLocalUserName[256]; |
| 110 |
char DefaultRhostsHostPrivateKeyFile[1024]; |
char DefaultRhostsHostPrivateKeyFile[1024]; |
| 111 |
char DefaultRSAPrivateKeyFile[1024]; |
char DefaultRSAPrivateKeyFile[1024]; |
| 112 |
|
|
| 113 |
char DefaultForwarding[2048]; |
char DefaultForwarding[2048]; |
| 114 |
BOOL TryDefaultAuth; |
BOOL TryDefaultAuth; |
| 115 |
|
|
| 116 |
int LogLevel; /* 0 = NONE, 100 = Verbose */ |
int LogLevel; /* 0 = NONE, 100 = Verbose */ |
| 117 |
int WriteBufferSize; |
int WriteBufferSize; |
| 118 |
int LocalForwardingIdentityCheck; |
int LocalForwardingIdentityCheck; |
| 119 |
|
|
| 120 |
int ssh_protocol_version; // SSH version (2004.10.11 yutaka) |
int ssh_protocol_version; // SSH version (2004.10.11 yutaka) |
| 121 |
int ssh_heartbeat_overtime; // SSH heartbeat(keepalive) (2004.12.11 yutaka) |
int ssh_heartbeat_overtime; // SSH heartbeat(keepalive) (2004.12.11 yutaka) |
| 122 |
int ssh2_keyboard_interactive; // SSH2 keyboard-interactive (2005.1.23 yutaka) |
int ssh2_keyboard_interactive; // SSH2 keyboard-interactive (2005.1.23 yutaka) |
| 123 |
int remember_password; // whether password will permanently store on heap memory (2006.8.5 yutaka) |
int remember_password; // whether password will permanently store on heap memory (2006.8.5 yutaka) |
| 124 |
} TS_SSH; |
} TS_SSH; |
| 125 |
|
|
| 126 |
typedef struct _TInstVar { |
typedef struct _TInstVar { |
| 127 |
PTTSet ts; |
PTTSet ts; |
| 128 |
PComVar cv; |
PComVar cv; |
| 129 |
|
|
| 130 |
/* shared memory for settings across instances. Basically it's |
/* shared memory for settings across instances. Basically it's |
| 131 |
a cache for the INI file.*/ |
a cache for the INI file.*/ |
| 132 |
TS_SSH FAR * ts_SSH; |
TS_SSH FAR * ts_SSH; |
| 133 |
|
|
| 134 |
int fatal_error; |
int fatal_error; |
| 135 |
int showing_err; |
int showing_err; |
| 136 |
char FAR * err_msg; |
char FAR * err_msg; |
| 137 |
|
|
| 138 |
Tconnect Pconnect; |
Tconnect Pconnect; |
| 139 |
Trecv Precv; |
Trecv Precv; |
| 140 |
Tsend Psend; |
Tsend Psend; |
| 141 |
TWSAAsyncSelect PWSAAsyncSelect; |
TWSAAsyncSelect PWSAAsyncSelect; |
| 142 |
TWSAGetLastError PWSAGetLastError; |
TWSAGetLastError PWSAGetLastError; |
| 143 |
|
|
| 144 |
PReadIniFile ReadIniFile; |
PReadIniFile ReadIniFile; |
| 145 |
PWriteIniFile WriteIniFile; |
PWriteIniFile WriteIniFile; |
| 146 |
PParseParam ParseParam; |
PParseParam ParseParam; |
| 147 |
|
|
| 148 |
SOCKET socket; |
SOCKET socket; |
| 149 |
HWND NotificationWindow; |
HWND NotificationWindow; |
| 150 |
unsigned int notification_msg; |
unsigned int notification_msg; |
| 151 |
long notification_events; |
long notification_events; |
| 152 |
HICON OldSmallIcon; |
HICON OldSmallIcon; |
| 153 |
HICON OldLargeIcon; |
HICON OldLargeIcon; |
| 154 |
|
|
| 155 |
BOOL hostdlg_activated; |
BOOL hostdlg_activated; |
| 156 |
BOOL hostdlg_Enabled; |
BOOL hostdlg_Enabled; |
| 157 |
|
|
| 158 |
int protocol_major; |
int protocol_major; |
| 159 |
int protocol_minor; |
int protocol_minor; |
| 160 |
|
|
| 161 |
PKTState pkt_state; |
PKTState pkt_state; |
| 162 |
SSHState ssh_state; |
SSHState ssh_state; |
| 163 |
AUTHState auth_state; |
AUTHState auth_state; |
| 164 |
CRYPTState crypt_state; |
CRYPTState crypt_state; |
| 165 |
HOSTSState hosts_state; |
HOSTSState hosts_state; |
| 166 |
FWDState fwd_state; |
FWDState fwd_state; |
| 167 |
|
|
| 168 |
/* The settings applied to the current session. The user may change |
/* The settings applied to the current session. The user may change |
| 169 |
the settings but usually we don't want that to affect the session |
the settings but usually we don't want that to affect the session |
| 170 |
in progress (race conditions). So user setup changes usually |
in progress (race conditions). So user setup changes usually |
| 171 |
modify the 'settings' field below. */ |
modify the 'settings' field below. */ |
| 172 |
TS_SSH session_settings; |
TS_SSH session_settings; |
| 173 |
|
|
| 174 |
/* our copy of the global settings. This is synced up with the shared |
/* our copy of the global settings. This is synced up with the shared |
| 175 |
memory only when we do a ReadIniFile or WriteIniFile |
memory only when we do a ReadIniFile or WriteIniFile |
| 176 |
(i.e. the user loads or saves setup) */ |
(i.e. the user loads or saves setup) */ |
| 177 |
TS_SSH settings; |
TS_SSH settings; |
| 178 |
|
|
| 179 |
// SSH2 |
// SSH2 |
| 180 |
DH *kexdh; |
DH *kexdh; |
| 181 |
char server_version_string[128]; |
char server_version_string[128]; |
| 182 |
char client_version_string[128]; |
char client_version_string[128]; |
| 183 |
buffer_t *my_kex; |
buffer_t *my_kex; |
| 184 |
buffer_t *peer_kex; |
buffer_t *peer_kex; |
| 185 |
enum kex_exchange kex_type; // KEX algorithm |
enum kex_exchange kex_type; // KEX algorithm |
| 186 |
enum hostkey_type hostkey_type; |
enum hostkey_type hostkey_type; |
| 187 |
SSHCipher ctos_cipher; |
SSHCipher ctos_cipher; |
| 188 |
SSHCipher stoc_cipher; |
SSHCipher stoc_cipher; |
| 189 |
enum hmac_type ctos_hmac; |
enum hmac_type ctos_hmac; |
| 190 |
enum hmac_type stoc_hmac; |
enum hmac_type stoc_hmac; |
| 191 |
enum compression_algorithm ctos_compression; |
enum compression_algorithm ctos_compression; |
| 192 |
enum compression_algorithm stoc_compression; |
enum compression_algorithm stoc_compression; |
| 193 |
int we_need; |
int we_need; |
| 194 |
int key_done; |
int key_done; |
| 195 |
int rekeying; |
int rekeying; |
| 196 |
char *session_id; |
char *session_id; |
| 197 |
int session_id_len; |
int session_id_len; |
| 198 |
Newkeys ssh2_keys[MODE_MAX]; |
Newkeys ssh2_keys[MODE_MAX]; |
| 199 |
EVP_CIPHER_CTX evpcip[MODE_MAX]; |
EVP_CIPHER_CTX evpcip[MODE_MAX]; |
| 200 |
int userauth_success; |
int userauth_success; |
| 201 |
int shell_id; |
int shell_id; |
| 202 |
/*int remote_id;*/ |
/*int remote_id;*/ |
| 203 |
int session_nego_status; |
int session_nego_status; |
| 204 |
/* |
/* |
| 205 |
unsigned int local_window; |
unsigned int local_window; |
| 206 |
unsigned int local_window_max; |
unsigned int local_window_max; |
| 207 |
unsigned int local_consumed; |
unsigned int local_consumed; |
| 208 |
unsigned int local_maxpacket; |
unsigned int local_maxpacket; |
| 209 |
unsigned int remote_window; |
unsigned int remote_window; |
| 210 |
unsigned int remote_maxpacket; |
unsigned int remote_maxpacket; |
| 211 |
*/ |
*/ |
| 212 |
int client_key_bits; |
int client_key_bits; |
| 213 |
int server_key_bits; |
int server_key_bits; |
| 214 |
int kexgex_min; |
int kexgex_min; |
| 215 |
int kexgex_bits; |
int kexgex_bits; |
| 216 |
int kexgex_max; |
int kexgex_max; |
| 217 |
int ssh2_autologin; |
int ssh2_autologin; |
| 218 |
int ask4passwd; |
int ask4passwd; |
| 219 |
SSHAuthMethod ssh2_authmethod; |
SSHAuthMethod ssh2_authmethod; |
| 220 |
char ssh2_username[MAX_PATH]; |
char ssh2_username[MAX_PATH]; |
| 221 |
char ssh2_password[MAX_PATH]; |
char ssh2_password[MAX_PATH]; |
| 222 |
char ssh2_keyfile[MAX_PATH]; |
char ssh2_keyfile[MAX_PATH]; |
| 223 |
time_t ssh_heartbeat_tick; |
time_t ssh_heartbeat_tick; |
| 224 |
HANDLE ssh_heartbeat_thread; |
HANDLE ssh_heartbeat_thread; |
| 225 |
int keyboard_interactive_done; |
int keyboard_interactive_done; |
| 226 |
int keyboard_interactive_password_input; |
int keyboard_interactive_password_input; |
| 227 |
int userauth_retry_count; |
int userauth_retry_count; |
| 228 |
buffer_t *decomp_buffer; |
buffer_t *decomp_buffer; |
| 229 |
char *ssh2_authlist; |
char *ssh2_authlist; |
| 230 |
} TInstVar; |
} TInstVar; |
| 231 |
|
|
| 232 |
#define LOG_LEVEL_FATAL 5 |
#define LOG_LEVEL_FATAL 5 |
| 250 |
int uuencode(unsigned char *src, int srclen, unsigned char *target, int targsize); |
int uuencode(unsigned char *src, int srclen, unsigned char *target, int targsize); |
| 251 |
|
|
| 252 |
#endif |
#endif |
|
|
|