Lines 44-49
void process_packet() {
Link Here
|
44 |
|
44 |
|
45 |
unsigned char type; |
45 |
unsigned char type; |
46 |
unsigned int i; |
46 |
unsigned int i; |
|
|
47 |
unsigned int first_strict_kex = ses.kexstate.strict_kex && !ses.kexstate.donefirstkex; |
47 |
time_t now; |
48 |
time_t now; |
48 |
|
49 |
|
49 |
TRACE2(("enter process_packet")) |
50 |
TRACE2(("enter process_packet")) |
Lines 54-75
void process_packet() {
Link Here
|
54 |
now = monotonic_now(); |
55 |
now = monotonic_now(); |
55 |
ses.last_packet_time_keepalive_recv = now; |
56 |
ses.last_packet_time_keepalive_recv = now; |
56 |
|
57 |
|
57 |
/* These packets we can receive at any time */ |
|
|
58 |
switch(type) { |
59 |
|
58 |
|
60 |
case SSH_MSG_IGNORE: |
59 |
if (type == SSH_MSG_DISCONNECT) { |
61 |
goto out; |
60 |
/* Allowed at any time */ |
62 |
case SSH_MSG_DEBUG: |
61 |
dropbear_close("Disconnect received"); |
63 |
goto out; |
62 |
} |
64 |
|
63 |
|
65 |
case SSH_MSG_UNIMPLEMENTED: |
64 |
/* These packets may be received at any time, |
66 |
/* debugging XXX */ |
65 |
except during first kex with strict kex */ |
67 |
TRACE(("SSH_MSG_UNIMPLEMENTED")) |
66 |
if (!first_strict_kex) { |
68 |
goto out; |
67 |
switch(type) { |
69 |
|
68 |
case SSH_MSG_IGNORE: |
70 |
case SSH_MSG_DISCONNECT: |
69 |
goto out; |
71 |
/* TODO cleanup? */ |
70 |
case SSH_MSG_DEBUG: |
72 |
dropbear_close("Disconnect received"); |
71 |
goto out; |
|
|
72 |
case SSH_MSG_UNIMPLEMENTED: |
73 |
TRACE(("SSH_MSG_UNIMPLEMENTED")) |
74 |
goto out; |
75 |
} |
73 |
} |
76 |
} |
74 |
|
77 |
|
75 |
/* Ignore these packet types so that keepalives don't interfere with |
78 |
/* Ignore these packet types so that keepalives don't interfere with |
Lines 98-104
void process_packet() {
Link Here
|
98 |
if (type >= 1 && type <= 49 |
101 |
if (type >= 1 && type <= 49 |
99 |
&& type != SSH_MSG_SERVICE_REQUEST |
102 |
&& type != SSH_MSG_SERVICE_REQUEST |
100 |
&& type != SSH_MSG_SERVICE_ACCEPT |
103 |
&& type != SSH_MSG_SERVICE_ACCEPT |
101 |
&& type != SSH_MSG_KEXINIT) |
104 |
&& type != SSH_MSG_KEXINIT |
|
|
105 |
&& !first_strict_kex) |
102 |
{ |
106 |
{ |
103 |
TRACE(("unknown allowed packet during kexinit")) |
107 |
TRACE(("unknown allowed packet during kexinit")) |
104 |
recv_unimplemented(); |
108 |
recv_unimplemented(); |