Mercurial > dropbear
comparison cli-session.c @ 293:9d110777f345 contrib-blacklist
propagate from branch 'au.asn.ucc.matt.dropbear' (head 7ad1775ed65e75dbece27fe6b65bf1a234db386a)
to branch 'au.asn.ucc.matt.dropbear.contrib.blacklist' (head 1d86a4f0a401cc68c2670d821a2f6366c37af143)
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Fri, 10 Mar 2006 06:31:29 +0000 |
parents | 3be7ae2e8dfa |
children | 6b41e2cbf071 79bf1023cf11 973fccb59ea4 0e4f225b7e07 |
comparison
equal
deleted
inserted
replaced
247:c07de41b53d7 | 293:9d110777f345 |
---|---|
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 |
76 NULL /* Null termination */ | 74 NULL /* Null termination */ |
77 }; | 75 }; |
78 | 76 |
79 void cli_session(int sock, char* remotehost) { | 77 void cli_session(int sock, char* remotehost) { |
80 | 78 |
79 seedrandom(); | |
80 | |
81 crypto_init(); | 81 crypto_init(); |
82 | |
82 common_session_init(sock, remotehost); | 83 common_session_init(sock, remotehost); |
83 | 84 |
84 chaninitialise(cli_chantypes); | 85 chaninitialise(cli_chantypes); |
85 | |
86 | 86 |
87 /* Set up cli_ses vars */ | 87 /* Set up cli_ses vars */ |
88 cli_session_init(); | 88 cli_session_init(); |
89 | 89 |
90 /* Ready to go */ | 90 /* Ready to go */ |
91 sessinitdone = 1; | 91 sessinitdone = 1; |
92 | 92 |
93 /* Exchange identification */ | 93 /* Exchange identification */ |
94 session_identification(); | 94 session_identification(); |
95 | 95 |
96 seedrandom(); | |
97 | |
98 send_msg_kexinit(); | 96 send_msg_kexinit(); |
99 | |
100 /* XXX here we do stuff differently */ | |
101 | 97 |
102 session_loop(cli_sessionloop); | 98 session_loop(cli_sessionloop); |
103 | 99 |
104 /* Not reached */ | 100 /* Not reached */ |
105 | 101 |
283 ses.sock = -1; | 279 ses.sock = -1; |
284 dropbear_exit("remote closed the connection"); | 280 dropbear_exit("remote closed the connection"); |
285 } | 281 } |
286 | 282 |
287 /* Operates in-place turning dirty (untrusted potentially containing control | 283 /* Operates in-place turning dirty (untrusted potentially containing control |
288 * characters) text into clean text. */ | 284 * characters) text into clean text. |
285 * Note: this is safe only with ascii - other charsets could have problems. */ | |
289 void cleantext(unsigned char* dirtytext) { | 286 void cleantext(unsigned char* dirtytext) { |
290 | 287 |
291 unsigned int i, j; | 288 unsigned int i, j; |
292 unsigned char c; | 289 unsigned char c; |
293 | 290 |