\0- terminated string from a sshbuf. Intended to be used to improve parsing
of SOCKS headers for dynamic forwarding.
ok deraadt; feedback Tim van der Molen
OpenBSD-Commit-ID: cf93d6db4730f7518d5269c279e16b172b484b36
Create replacement header files inside openbsd-compat for common headers
that are missing on a given platform. Usually these are just empty,
but in some cases they'll include the equivalent file. This avoids
having to wrap those includes in '#ifdef HAVE_FOO_H' and reduces the
diff vs OpenBSD.
If we create any such headers, add the path to includes.
Initially just stdint.h, more to follow.
ok djm@
operations inside buffers with bounds checking. Intended to replace manual
pointer arithmetic wherever possible.
feedback and ok markus@
OpenBSD-Commit-ID: 91771fde7732738f1ffed078aa5d3bee6d198409
Some AIX compilers unconditionally undefine va_copy but don't set it back
to an internal function, causing link errors. In some compat code we
already use VA_COPY instead so move the two existing instances into the
shared header and use for sshbuf-getput-basic.c too. Should fix building
with at lease some versions of AIX's compiler. bz#2589, ok djm@
apparently memcpy(x, NULL, 0) is undefined behaviour
according to C99 (cf. sections 7.21.1 and 7.1.4), so check skip memcpy calls
when length==0; ok markus@
[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.