Home | History | Annotate | Download | only in dropbear

Lines Matching full:clearwritebuf

39 static void writemac(buffer * outputbuffer, buffer * clearwritebuf);
415 buffer * clearwritebuf; /* unencrypted, possibly compressed */
425 clearwritebuf = buf_new((ses.writepayload->len+4+1) + MIN_PACKET_LEN + 3
430 buf_setlen(clearwritebuf, PACKET_PAYLOAD_OFF);
431 buf_setpos(clearwritebuf, PACKET_PAYLOAD_OFF);
438 buf_compress(clearwritebuf, ses.writepayload, ses.writepayload->len);
442 memcpy(buf_getwriteptr(clearwritebuf, ses.writepayload->len),
445 buf_incrwritepos(clearwritebuf, ses.writepayload->len);
454 padlen = blocksize - (clearwritebuf->len) % blocksize;
459 if (clearwritebuf->len + padlen < MIN_PACKET_LEN) {
463 buf_setpos(clearwritebuf, 0);
465 buf_putint(clearwritebuf, clearwritebuf->len + padlen - 4);
468 buf_putbyte(clearwritebuf, padlen);
470 buf_setpos(clearwritebuf, clearwritebuf->len);
471 buf_incrlen(clearwritebuf, padlen);
472 genrandom(buf_getptr(clearwritebuf, padlen), padlen);
475 buf_setpos(clearwritebuf, 0);
478 writebuf = buf_new(clearwritebuf->len + macsize);
482 memcpy(buf_getwriteptr(writebuf, clearwritebuf->len),
483 buf_getptr(clearwritebuf, clearwritebuf->len),
484 clearwritebuf->len);
485 buf_incrwritepos(writebuf, clearwritebuf->len);
488 while (clearwritebuf->pos < clearwritebuf->len) {
489 if (cbc_encrypt(buf_getptr(clearwritebuf, blocksize),
495 buf_incrpos(clearwritebuf, blocksize);
501 writemac(writebuf, clearwritebuf);
503 /* clearwritebuf is finished with */
504 buf_free(clearwritebuf);
505 clearwritebuf = NULL;
520 static void writemac(buffer * outputbuffer, buffer * clearwritebuf) {
547 buf_setpos(clearwritebuf, 0);
549 buf_getptr(clearwritebuf,
550 clearwritebuf->len),
551 clearwritebuf->len) != CRYPT_OK) {