Tobias Brunner
eeb73dec79
Ensure buffer in bio_writer_t is properly increased
...
The previous code was problematic if bufsize/increase was smaller than 8
and an u_int64_t was written when the buffer was too small. Also, for
large chunks and small bufsizes realloc() was called several times
instead of just once.
2013-06-11 11:03:13 +02:00
Martin Willi
7fb81886b9
Add a bio_reader_t constructor variant freeing passed data during destruction
2013-01-15 17:43:05 +01:00
Martin Willi
54a1a75b2f
Don't use bio_writer_t.skip() to write length field when appending more data
...
If the writer reallocates its buffer, the length pointer might not be valid
anymore, or even worse, point to an arbitrary allocation.
2013-01-11 14:57:08 +01:00
Tobias Brunner
f05b427265
Moved debug.[ch] to utils folder
2012-10-24 16:00:51 +02:00
Tobias Brunner
6dfdcf420f
Added a method to bio_writer_t that allows to skip a number of bytes
...
A chunk pointing to the skipped bytes is returned, allowing users of
bio_writer_t to write/copy data to the skipped bytes themselves.
2012-08-08 15:41:02 +02:00
Tobias Brunner
59a15a7475
Added a method to bio_writer_t that allows to extract the internal buffer
2012-08-08 15:41:02 +02:00
Tobias Brunner
c1830d2670
Added methods to bio_reader_t to read data from end of buffer
2012-08-08 15:41:02 +02:00
Andreas Steffen
fbeb94544c
extended bio_reader and bio_writer to handle u_int64_t
2011-11-28 14:39:52 +01:00
Andreas Steffen
7e432eff6b
renamed tls_reader|writer to bio_* and moved to libstrongswan
2011-05-31 15:46:51 +02:00
Andreas Steffen
7e82d26dd8
fixed type
2011-05-31 15:46:51 +02:00