6 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
67ce107972 sshbuf_free(NULL) should be a no-op 2012-03-26 17:04:40 +11:00
Damien Miller
4364319ce2 oops, sshbuf was never freeing its buffer memory 2012-03-07 00:26:52 +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