]> The Tcpdump Group git mirrors - libpcap/commit
Add SSL option for data socket of rpcap
authorCedric Cellier <[email protected]>
Thu, 24 May 2018 17:55:19 +0000 (19:55 +0200)
committerCedric Cellier <[email protected]>
Thu, 13 Sep 2018 06:25:06 +0000 (08:25 +0200)
commitb70207e3d95765e2e49af4af1e79b43c4a77d02f
tree4936d8f55f1ce3e81af99ef8a58a407d6283c83a
parent463753d8ef5c73b4263b8d9aee07bad9fde8d37b
Add SSL option for data socket of rpcap

When using rpcapd one may want the forwarded traffic to be encrypted.
When running rpcapd via initd it is relatively easy to add stunnel but
the client still have to implement TLS. Or one could also use an ssh
tunnel but it's a lot of setup. Ultimately, it is simpler than rpcap
protocol could run on SSL natively. So this patch adds a -S option to
rpcapd that will wrap the data socket into a TLS tunnel (in both passive
anbd active mode, as long as it's TCP not UDP).

The start capture message has an additional flag: ssl, asking the client
to initiate a TLS handshake once he is connected to the data socket.

This patch is not polished as I'm more interested in early opinions at
this stage. Please let me know what you think of the idea and its
implementation so far.

Proof of concept:

generate a private key, a self signed root cert:

$ openssl req -newkey rsa:2048 -nodes -keyout key.pem -x509 -days 36500 -out cert.pem

then run rpcapd with option -S (ssl) and -K and -C:

$ rpcapd -n -S -K key.pem -C cert.pem

Once recompiled, tcpdump can attach to this rpcap:// service and the
traffic will be encrypted.
Makefile.in
configure
configure.ac
pcap-rpcap.c
rpcap-protocol.h
rpcapd/Makefile.in
rpcapd/daemon.c
rpcapd/rpcapd.c
sslutils.c [new file with mode: 0644]
sslutils.h [new file with mode: 0644]