Commit Graph

18 Commits

Author SHA1 Message Date
Markus Friedl
f72f4b214f replace sshbuf_new/sshbuf_put with sshbuf_from. 2012-10-10 23:49:31 +02:00
Markus Friedl
c0624b12c7 check sshbuf_mutable_ptr return value, or convert to sshbuf_ptr 2012-10-10 01:25:20 +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
5020b06a6b remove the last traces of the old buffer API
yay :)
2012-09-21 05:35:30 +10:00
Markus Friedl
b8e9499508 ssh_api.h: u_int -> size_t 2012-03-04 21:19:24 +01:00
Markus Friedl
1ba4f6ae7d ssh-proxy: use sshbuf_dump() and print hex-dump of forwarded packet 2012-03-04 21:19:24 +01:00
Markus Friedl
980b0a0f16 ssh-proxy: delay session close until the output is flushed 2012-03-04 21:19:24 +01:00
Markus Friedl
c0941f9d24 de-fatal ssh-proxy.c 2012-03-04 21:19:23 +01:00
Markus Friedl
54fc03566d use sshkey_load_private in ssh-proxy 2012-03-04 21:19:22 +01:00
Markus Friedl
dd6d702278 pass a struct sshkey to ssh_add_hostkey() (instead of a string) 2012-03-04 21:19:20 +01:00
Markus Friedl
91fa188bfb ssh_packet_next(): after a kex callback has been called we need to
get the next packet, too. otherwise we end up waiting for input
even if there is a packet ready. the same applies to the proxy
2012-03-04 21:19:20 +01:00
Markus Friedl
f046133614 de-fatal ssh_api.c and change API to return ssh-error codes (err.h) 2012-03-04 21:19:18 +01:00
Markus Friedl
4f48a68397 rename ssh_packet_get() to ssh_packet_next() and document resulting API 2012-01-17 14:37:26 +01:00
Markus Friedl
97a2b75862 dump packet content to stderr if ssh-proxy is started with -D 2012-01-17 14:32:49 +01:00
Markus Friedl
7c423254e3 add ssh_free() to API and use it in the proxy 2012-01-17 14:32:48 +01:00
Markus Friedl
81e3938108 add a libevent based ssh proxy
example usage:
% test -f /tmp/hk2 || ssh-keygen -N '' -t ecdsa -f  /tmp/hk2
% ssh-keyscan -t ecdsa 127.0.0.1 | sed 's/^[^ ]* //'  > /tmp/hk.pub
% ./ssh-proxy/obj/ssh-proxy -f -S /tmp/hk2 -C /tmp/hk.pub -L 127.0.0.1:12345:127.0.0.1:22 -d
% ssh -o hostkeyalgorithms'='ecdsa-sha2-nistp256 -o hostkeyalias'='egal2 -v 127.0.0.1 -p 12345
2012-01-17 14:32:48 +01:00
Markus Friedl
9cc85e2464 move packet state internals back from packet.h to packet.c 2012-01-17 14:32:46 +01:00
Markus Friedl
530367aafa Move the key exchange state and other global variables into
a per connection state struct, add a initial API that could
be used for a proxy (see ssh-proxy.c)

Joint work with Matthias Pitzl, Stefan Rinkes, Bernhard Zaun and
Arne Becker.
2012-01-17 14:32:46 +01:00