comparison common-kex.c @ 1055:4d7b4c5526c5 nocircbuffer

A bit of a bodge to avoid memcpy if zlib is disabled
author Matt Johnston <matt@ucc.asn.au>
date Sun, 01 Mar 2015 00:57:21 +0800
parents a1e79ffa5862
children c45d65392c1a
comparison
equal deleted inserted replaced
1054:c71df09bc610 1055:4d7b4c5526c5
532 532
533 /* I_C, the payload of the client's SSH_MSG_KEXINIT */ 533 /* I_C, the payload of the client's SSH_MSG_KEXINIT */
534 buf_putstring(ses.kexhashbuf, 534 buf_putstring(ses.kexhashbuf,
535 ses.transkexinit->data, ses.transkexinit->len); 535 ses.transkexinit->data, ses.transkexinit->len);
536 /* I_S, the payload of the server's SSH_MSG_KEXINIT */ 536 /* I_S, the payload of the server's SSH_MSG_KEXINIT */
537 buf_setpos(ses.payload, 0); 537 buf_setpos(ses.payload, ses.payload_beginning);
538 buf_putstring(ses.kexhashbuf, ses.payload->data, ses.payload->len); 538 buf_putstring(ses.kexhashbuf,
539 buf_getptr(ses.payload, ses.payload->len-ses.payload->pos),
540 ses.payload->len-ses.payload->pos);
539 ses.requirenext = SSH_MSG_KEXDH_REPLY; 541 ses.requirenext = SSH_MSG_KEXDH_REPLY;
540 } else { 542 } else {
541 /* SERVER */ 543 /* SERVER */
542 544
543 /* read the peer's choice of algos */ 545 /* read the peer's choice of algos */
547 /* V_S, the server's version string (CR and NL excluded) */ 549 /* V_S, the server's version string (CR and NL excluded) */
548 buf_putstring(ses.kexhashbuf, 550 buf_putstring(ses.kexhashbuf,
549 (unsigned char*)LOCAL_IDENT, local_ident_len); 551 (unsigned char*)LOCAL_IDENT, local_ident_len);
550 552
551 /* I_C, the payload of the client's SSH_MSG_KEXINIT */ 553 /* I_C, the payload of the client's SSH_MSG_KEXINIT */
552 buf_setpos(ses.payload, 0); 554 buf_setpos(ses.payload, ses.payload_beginning);
553 buf_putstring(ses.kexhashbuf, ses.payload->data, ses.payload->len); 555 buf_putstring(ses.kexhashbuf,
556 buf_getptr(ses.payload, ses.payload->len-ses.payload->pos),
557 ses.payload->len-ses.payload->pos);
554 558
555 /* I_S, the payload of the server's SSH_MSG_KEXINIT */ 559 /* I_S, the payload of the server's SSH_MSG_KEXINIT */
556 buf_putstring(ses.kexhashbuf, 560 buf_putstring(ses.kexhashbuf,
557 ses.transkexinit->data, ses.transkexinit->len); 561 ses.transkexinit->data, ses.transkexinit->len);
558 562