9 Commits

Author SHA1 Message Date
Damien Miller
8f73555808 protect sshbuf_from[bs] children by refusing modification of the parent buffers
This adds a reference mechanism to struct sshbuf, making parent buffers to
those created with buffer_froms() and buffer_fromb() read-only until the
child buffer is freed. It also delays freeing of the parent buffer until
all child buffers have freed.
2012-10-09 23:22:54 +02:00
Damien Miller
b305993cea deprecate the buffer_init() sshbuf entrypoint.
Allows making struct sshbuf opaque
2012-10-09 23:22:53 +02:00
Damien Miller
60cb7a627f new functions for read-only buffers with external storage
This adds some new functions: sshbuf_from(), sshbuf_fromb() and sshbuf_froms()
that create new buffers from a read-only blob, the contents of a buffer and
the contents of a string in a buffer respectively. In all cases the memory
contents are not copied - the new buffer, which is read-only, just refers to
the original location in memory.
2012-10-09 23:22:53 +02:00
Damien Miller
54c2c68956 This stated as a conversion of monitor*.[ch] to the new
buffer API, but it got away from me...

Includes a change from u_int -> size_t in the key API that
touches quite a few things
2012-09-20 01:22:35 +10:00
Damien Miller
48e840c69e fix include guard and some whitespace nits 2012-09-19 18:39:46 +10:00
Damien Miller
3f69ecb299 activate leakmalloc support when LEAKMALLOC make variable is set
(mostly by markus@)
2012-03-15 13:27:43 +11:00
Markus Friedl
f7ecade3a0 make sshbuf_get_stringb() a public API 2012-03-04 21:19:24 +01:00
Damien Miller
7861f112ba disable SSHBUF_ABORT and fix compilation with it turned off 2012-01-17 14:37:27 +01:00
Damien Miller
ea5ceecdc2 first cut at merging disentangled buffer and library code. buffer_* continue
to exist as thin wrappers around sshbuf_*

doesn't yet pass regress (breakage in hostkey checking, probably related to
new sshkey_* return values)
2012-01-17 14:32:48 +01:00