Mercurial > dropbear
comparison cli-session.c @ 297:79bf1023cf11 agent-client
propagate from branch 'au.asn.ucc.matt.dropbear' (head 0501e6f661b5415eb76f3b312d183c3adfbfb712)
to branch 'au.asn.ucc.matt.dropbear.cli-agent' (head 01038174ec27245b51bd43a66c01ad930880f67b)
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Tue, 21 Mar 2006 16:20:59 +0000 |
parents | ca7e76d981d9 3be7ae2e8dfa |
children | c1e9c81d1d27 |
comparison
equal
deleted
inserted
replaced
225:ca7e76d981d9 | 297:79bf1023cf11 |
---|---|
61 {SSH_MSG_CHANNEL_EOF, recv_msg_channel_eof}, | 61 {SSH_MSG_CHANNEL_EOF, recv_msg_channel_eof}, |
62 {SSH_MSG_CHANNEL_CLOSE, recv_msg_channel_close}, | 62 {SSH_MSG_CHANNEL_CLOSE, recv_msg_channel_close}, |
63 {SSH_MSG_CHANNEL_OPEN_CONFIRMATION, recv_msg_channel_open_confirmation}, | 63 {SSH_MSG_CHANNEL_OPEN_CONFIRMATION, recv_msg_channel_open_confirmation}, |
64 {SSH_MSG_CHANNEL_OPEN_FAILURE, recv_msg_channel_open_failure}, | 64 {SSH_MSG_CHANNEL_OPEN_FAILURE, recv_msg_channel_open_failure}, |
65 {SSH_MSG_USERAUTH_BANNER, recv_msg_userauth_banner}, /* client */ | 65 {SSH_MSG_USERAUTH_BANNER, recv_msg_userauth_banner}, /* client */ |
66 #ifdef ENABLE_CLI_PUBKEY_AUTH | 66 {SSH_MSG_USERAUTH_SPECIFIC_60, recv_msg_userauth_specific_60}, /* client */ |
67 {SSH_MSG_USERAUTH_PK_OK, recv_msg_userauth_pk_ok}, /* client */ | |
68 #endif | |
69 {0, 0} /* End */ | 67 {0, 0} /* End */ |
70 }; | 68 }; |
71 | 69 |
72 static const struct ChanType *cli_chantypes[] = { | 70 static const struct ChanType *cli_chantypes[] = { |
73 #ifdef ENABLE_CLI_REMOTETCPFWD | 71 #ifdef ENABLE_CLI_REMOTETCPFWD |
79 NULL /* Null termination */ | 77 NULL /* Null termination */ |
80 }; | 78 }; |
81 | 79 |
82 void cli_session(int sock, char* remotehost) { | 80 void cli_session(int sock, char* remotehost) { |
83 | 81 |
82 seedrandom(); | |
83 | |
84 crypto_init(); | 84 crypto_init(); |
85 | |
85 common_session_init(sock, remotehost); | 86 common_session_init(sock, remotehost); |
86 | 87 |
87 chaninitialise(cli_chantypes); | 88 chaninitialise(cli_chantypes); |
88 | |
89 | 89 |
90 /* Set up cli_ses vars */ | 90 /* Set up cli_ses vars */ |
91 cli_session_init(); | 91 cli_session_init(); |
92 | 92 |
93 /* Ready to go */ | 93 /* Ready to go */ |
94 sessinitdone = 1; | 94 sessinitdone = 1; |
95 | 95 |
96 /* Exchange identification */ | 96 /* Exchange identification */ |
97 session_identification(); | 97 session_identification(); |
98 | 98 |
99 seedrandom(); | |
100 | |
101 send_msg_kexinit(); | 99 send_msg_kexinit(); |
102 | |
103 /* XXX here we do stuff differently */ | |
104 | 100 |
105 session_loop(cli_sessionloop); | 101 session_loop(cli_sessionloop); |
106 | 102 |
107 /* Not reached */ | 103 /* Not reached */ |
108 | 104 |
286 ses.sock = -1; | 282 ses.sock = -1; |
287 dropbear_exit("remote closed the connection"); | 283 dropbear_exit("remote closed the connection"); |
288 } | 284 } |
289 | 285 |
290 /* Operates in-place turning dirty (untrusted potentially containing control | 286 /* Operates in-place turning dirty (untrusted potentially containing control |
291 * characters) text into clean text. */ | 287 * characters) text into clean text. |
288 * Note: this is safe only with ascii - other charsets could have problems. */ | |
292 void cleantext(unsigned char* dirtytext) { | 289 void cleantext(unsigned char* dirtytext) { |
293 | 290 |
294 unsigned int i, j; | 291 unsigned int i, j; |
295 unsigned char c; | 292 unsigned char c; |
296 | 293 |