comparison process-packet.c @ 1739:13d834efc376 fuzz

merge from main
author Matt Johnston <matt@ucc.asn.au>
date Thu, 15 Oct 2020 19:55:15 +0800
parents 41bf8f216644
children
comparison
equal deleted inserted replaced
1562:768ebf737aa0 1739:13d834efc376
49 TRACE2(("enter process_packet")) 49 TRACE2(("enter process_packet"))
50 50
51 type = buf_getbyte(ses.payload); 51 type = buf_getbyte(ses.payload);
52 TRACE(("process_packet: packet type = %d, len %d", type, ses.payload->len)) 52 TRACE(("process_packet: packet type = %d, len %d", type, ses.payload->len))
53 53
54 ses.lastpacket = type;
55
56 now = monotonic_now(); 54 now = monotonic_now();
57 ses.last_packet_time_keepalive_recv = now; 55 ses.last_packet_time_keepalive_recv = now;
58 56
59 /* These packets we can receive at any time */ 57 /* These packets we can receive at any time */
60 switch(type) { 58 switch(type) {
76 74
77 /* Ignore these packet types so that keepalives don't interfere with 75 /* Ignore these packet types so that keepalives don't interfere with
78 idle detection. This is slightly incorrect since a tcp forwarded 76 idle detection. This is slightly incorrect since a tcp forwarded
79 global request with failure won't trigger the idle timeout, 77 global request with failure won't trigger the idle timeout,
80 but that's probably acceptable */ 78 but that's probably acceptable */
81 if (!(type == SSH_MSG_GLOBAL_REQUEST || type == SSH_MSG_REQUEST_FAILURE)) { 79 if (!(type == SSH_MSG_GLOBAL_REQUEST
80 || type == SSH_MSG_REQUEST_FAILURE
81 || type == SSH_MSG_CHANNEL_FAILURE)) {
82 ses.last_packet_time_idle = now; 82 ses.last_packet_time_idle = now;
83 } 83 }
84 84
85 /* This applies for KEX, where the spec says the next packet MUST be 85 /* This applies for KEX, where the spec says the next packet MUST be
86 * NEWKEYS */ 86 * NEWKEYS */
152 /* TODO do something more here? */ 152 /* TODO do something more here? */
153 TRACE(("preauth unknown packet")) 153 TRACE(("preauth unknown packet"))
154 recv_unimplemented(); 154 recv_unimplemented();
155 155
156 out: 156 out:
157 ses.lastpacket = type;
157 buf_free(ses.payload); 158 buf_free(ses.payload);
158 ses.payload = NULL; 159 ses.payload = NULL;
159 160
160 TRACE2(("leave process_packet")) 161 TRACE2(("leave process_packet"))
161 } 162 }