Skip to content
This repository has been archived by the owner on Aug 30, 2024. It is now read-only.

Latest commit

 

History

History
78 lines (53 loc) · 3.21 KB

README.md

File metadata and controls

78 lines (53 loc) · 3.21 KB

libconvert Build Status

Libraries to work with 0-RTT TCP Convert Protocol (RFC 8803).

  • libconvert_util: A library to parse and write Convert messages.
  • libconvert_client: An LD_PRELOAD library that turns an existing client, using TCP sockets, into a Convert client.

This is work in progress. The libconvert_util library currently only supports the Connect TLV and the Error TLV. This repository does not yet include a server-side Transport Converter.

Future work:

  • Sample server-side Transport Converter
  • Support Extended TCP Header TLV and Converter bypass.
  • Support Info TLV and the Supported TCP Extensions TLV.
  • Support Cookie TLV.

Requirements

  • Requires Linux >= 4.5 (leverages the TCP Fast Open infrastructure).
  • Configure $ sysctl -w net.ipv4.tcp_fastopen=5 to enable sending data in the opening SYN, regardless of cookie availability.

Build

Fetch the Git submodules:

$ git submodule init && git submodule update

The easiest way to build both libraries and run the tests is with the provided Dockerfile (which contains all deps):

$ docker build -t tessares.net/libconvert .
$ docker run --cap-add=NET_ADMIN --sysctl net.ipv4.tcp_fastopen=5 -v $PWD:/lc -t tessares.net/libconvert /bin/bash -c "mkdir -p /lc/build && cd /lc/build && cmake .. && make && make test"

Otherwise, assuming all deps are installed, build and run the tests with CMake as follows:

$ mkdir -p build && cd build && cmake .. && make && make test

Usage & dependencies of libconvert_client

Runtime dependencies

  • libcapstone -- the disassembly engine used by used under the hood by lib_syscall_intercept.

Usage

To use the libconvert_client lib (assuming a Transport Converter listening at 192.0.2.1:1234):

$ CONVERT_LOG=/tmp/converter.log CONVERT_ADDR=192.0.2.1 CONVERT_PORT=1234 LD_LIBRARY_PATH=$PWD/build LD_PRELOAD=libconvert_client.so curl https://www.tessares.net

The library supports IPv6 as well.

Currently tested with curl & wget on both Centos 7 and Ubuntu {16,18,19}.

The library is known to not work on Ubuntu 20 due to incompatibilities between lib_syscall_intercept and libc 20.30-1. This issue is tracked here.

Contributing

Code contributions are more than welcome.

Upon change, please run uncrustify (0.68) and validate that cppcheck is still happy:

$ uncrustify -c uncrustify.cfg -l C --replace --no-backup convert*.{h,c}
$ cppcheck -I/usr/include -q --language=c --std=c99 --enable=warning,style,performance,portability -j "$(nproc)" --suppress=unusedStructMember ./convert*.{h,c}

To ease troubleshooting, download the 0-RTT TCP Convert Wireshark dissector plugin.

Contact

License

This project is licensed under the 3-Clause BSD License - see the LICENSE file for details.