Commit Graph

22 Commits

Author SHA1 Message Date
djm@openbsd.org 3cec155430
upstream: make struct sshbuf private
and remove an unused field; ok dtucker

OpenBSD-Commit-ID: c7a3d77c0b8c153d463398606a8d57569186a0c3
2022-12-04 22:39:42 +11:00
djm@openbsd.org 9d8c80f8a3 upstream: revert previous; it was broken (spotted by Theo)
OpenBSD-Commit-ID: 457c79afaca2f89ec2606405c1059b98b30d8b0d
2022-05-25 16:06:03 +10:00
djm@openbsd.org 9e0d02ef7c upstream: make SSHBUF_DBG/SSHBUF_TELL (off by default and only enabled
via #define) dump to stderr rather than stdout

OpenBSD-Commit-ID: 10298513ee32db8390aecb0397d782d68cb14318
2022-05-25 10:33:16 +10:00
djm@openbsd.org 4673fa8f2b upstream: two defensive changes from Tobias Stoeckmann via GHPR287
enforce stricter invarient for sshbuf_set_parent() - never allow
a buffer to have a previously-set parent changed.

In sshbuf_reset(), if the reallocation fails, then zero the entire
buffer and not the (potentially smaller) default initial alloc size.

OpenBSD-Commit-ID: 14583203aa5d50ad38d2e209ae10abaf8955e6a9
2022-04-12 09:35:31 +10:00
jsg@openbsd.org d5ba1c0327 upstream: change explicit_bzero();free() to freezero()
While freezero() returns early if the pointer is NULL the tests for
NULL in callers are left to avoid warnings about passing an
uninitialised size argument across a function boundry.

ok deraadt@ djm@

OpenBSD-Commit-ID: 2660fa334fcc7cd05ec74dd99cb036f9ade6384a
2020-02-28 12:26:28 +11:00
dtucker@openbsd.org 3bf2a6ac79 upstream: Replace all calls to signal(2) with a wrapper around
sigaction(2). This wrapper blocks all other signals during the handler
preventing races between handlers, and sets SA_RESTART which should reduce
the potential for short read/write operations.

OpenBSD-Commit-ID: 5e047663fd77a40d7b07bdabe68529df51fd2519
2020-01-23 18:51:25 +11:00
djm@openbsd.org 15182fd968 upstream: make grandparent-parent-child sshbuf chains robust to
use-after-free faults if the ancestors are freed before the descendents.
Nothing in OpenSSH uses this deallocation pattern. Reported by Jann Horn

OpenBSD-Commit-ID: d93501d1d2734245aac802a252b9bb2eccdba0f2
2018-11-16 17:18:29 +11:00
markus@openbsd.org cb30cd4704 upstream: remove legacy buffer API emulation layer; ok djm@
OpenBSD-Commit-ID: 2dd5dc17cbc23195be4299fa93be2707a0e08ad9
2018-07-10 16:44:17 +10:00
djm@openbsd.org cc812baf39 upstream commit
unconditionally zero init size of buffer; ok markus@
deraadt@

Upstream-ID: 218963e846d8f26763ba25afe79294547b99da29
2017-06-07 11:31:15 +10:00
deraadt@openbsd.org 9e509d4ec9 upstream commit
Switch to recallocarray() for a few operations.  Both
growth and shrinkage are handled safely, and there also is no need for
preallocation dances. Future changes in this area will be less error prone.
Review and one bug found by markus

Upstream-ID: 822d664d6a5a1d10eccb23acdd53578a679d5065
2017-06-01 14:55:22 +10:00
markus@openbsd.org 813f55336a upstream commit
sshbuf_consume: reset empty buffer; ok djm@

Upstream-ID: 0d4583ba57f69e369d38bbd7843d85cac37fa821
2017-05-27 15:35:52 +10:00
djm@openbsd.org a9c7460887 upstream commit
split allocation out of sshbuf_reserve() into a separate
sshbuf_allocate() function; ok markus@

Upstream-ID: 11b8a2795afeeb1418d508a2c8095b3355577ec2
2016-11-29 16:48:02 +11:00
deraadt@openbsd.org 9136ec134c upstream commit
Add MAXIMUM(), MINIMUM(), and ROUNDUP() to misc.h, then
use those definitions rather than pulling <sys/param.h> and unknown namespace
pollution. ok djm markus dtucker

Upstream-ID: 712cafa816c9f012a61628b66b9fbd5687223fb8
2016-09-12 13:46:29 +10:00
djm@openbsd.org 9a728cc918 upstream commit
use explicit_bzero() more liberally in the buffer code; ok
 deraadt

Upstream-ID: 0ece37069fd66bc6e4f55eb1321f93df372b65bf
2016-01-13 10:48:11 +11:00
mmcc@openbsd.org 52d7078421 upstream commit
Remove NULL-checks before sshbuf_free().

ok djm@

Upstream-ID: 5ebed00ed5f9f03b119a345085e8774565466917
2015-12-18 14:50:48 +11:00
djm@openbsd.org 905b054ed2 upstream commit
some more bzero->explicit_bzero, from Michael McConville

Upstream-ID: 17f19545685c33327db2efdc357c1c9225ff00d0
2015-10-06 12:26:41 +11:00
deraadt@openbsd.org 087266ec33 upstream commit
Reduce use of <sys/param.h> and transition to <limits.h>
 throughout. ok djm markus
2015-01-26 23:58:53 +11:00
Damien Miller 23f269562b - (djm) [defines.h sshbuf.c] Move __predict_true|false to defines.h and
conditionalise to avoid duplicate definition.
2014-09-03 05:33:25 +10:00
Damien Miller 9e01ff2866 - deraadt@cvs.openbsd.org 2014/06/25 14:16:09
[sshbuf.c]
     unblock SIGSEGV before raising it
     ok djm
2014-07-02 15:29:21 +10:00
Damien Miller 7f1c264d30 - (djm) [sshbuf.c] need __predict_false 2014-05-15 18:01:52 +10:00
Damien Miller e5b9f0f2ee - (djm) [Makefile.in configure.ac sshbuf-getput-basic.c]
[sshbuf-getput-crypto.c sshbuf.c] compilation and portability fixes
2014-05-15 14:58:07 +10:00
Damien Miller 05e82c3b96 - djm@cvs.openbsd.org 2014/04/30 05:29:56
[bufaux.c bufbn.c bufec.c buffer.c buffer.h sshbuf-getput-basic.c]
     [sshbuf-getput-crypto.c sshbuf-misc.c sshbuf.c sshbuf.h ssherr.c]
     [ssherr.h]
     New buffer API; the first installment of the conversion/replacement
     of OpenSSH's internals to make them usable as a standalone library.

     This includes a set of wrappers to make it compatible with the
     existing buffer API so replacement can occur incrementally.

     With and ok markus@

     Thanks also to Ben Hawkes, David Tomaschik, Ivan Fratric, Matthew
     Dempsky and Ron Bowes for a detailed review.
2014-05-15 14:33:43 +10:00