comparison packet.c @ 556:ccdc4c6183c0

- Payload length doesn't include macsize.
author Matt Johnston <matt@ucc.asn.au>
date Sun, 26 Jul 2009 16:11:27 +0000
parents 21490eea261d
children 005530560594
comparison
equal deleted inserted replaced
555:daf52f813328 556:ccdc4c6183c0
259 buf_setpos(ses.readbuf, PACKET_PADDING_OFF); 259 buf_setpos(ses.readbuf, PACKET_PADDING_OFF);
260 padlen = buf_getbyte(ses.readbuf); 260 padlen = buf_getbyte(ses.readbuf);
261 261
262 /* payload length */ 262 /* payload length */
263 /* - 4 - 1 is for LEN and PADLEN values */ 263 /* - 4 - 1 is for LEN and PADLEN values */
264 len = ses.readbuf->len - padlen - 4 - 1; 264 len = ses.readbuf->len - padlen - 4 - 1 - macsize;
265 if ((len > RECV_MAX_PAYLOAD_LEN) || (len < 1)) { 265 if ((len > RECV_MAX_PAYLOAD_LEN) || (len < 1)) {
266 dropbear_exit("bad packet size"); 266 dropbear_exit("bad packet size");
267 } 267 }
268 268
269 buf_setpos(ses.readbuf, PACKET_PAYLOAD_OFF); 269 buf_setpos(ses.readbuf, PACKET_PAYLOAD_OFF);