Commit Graph
18 Commits
Author SHA1 Message Date
eric a3df017b4d feat(plugin)!: replace the in-process plugin API with a C ABI host
The old API handed dynamic libraries Rust trait objects, tying every plugin to
leaf's exact compiler and crate versions and ruling out other languages. It is
removed, along with its shadowsocks sample, which returns on the new ABI in a
later commit.

The host loads plugins over leaf-plugin-abi instead. It validates the
descriptor, dials the endpoint, and drives the engines as sans-io codecs over
its own transport, exposing them as ordinary outbound handlers. Datagram
engines are either unreliable, with a UDP socket of their own, or reliable,
framed over the stream transport. Plugin failures carry the plugin's last error
string, and plugin logs join the session's tracing span.

Everything crossing the boundary is treated as untrusted: counts are checked
against the buffers they describe, reported strings are bounded and escaped,
engines get an opaque id rather than a pointer for host_ctx, and an engine that
takes no input is backpressure rather than failure. A poll does a bounded
amount of work, and a datagram the receiver cannot take is dropped instead of
the session.

An outbound names its path, host and port, and may pin the sha256 of the
library it loads -- the only check on this path that still holds against
someone who can write the file.

`leaf --verify-plugin <path>` runs the same checks without a config file and
prints what the plugin declares: its ABI version, its engines, whether the
outbound must carry host and port, and the digest to pin it to. A build can
then be vetted before it is in the path of any traffic.
2026-12-03 19:31:53 +08:00
eric 822889c78a Support ECH 2026-03-13 16:58:55 +08:00
eric 4cb248086c v0.14.2 2026-02-25 17:33:53 +08:00
eric 7474076902 v0.14.1 2026-02-25 16:22:46 +08:00
eric 3f6819e806 v0.14.0 2026-02-22 16:30:29 +08:00
eric ca7e81ceb3 v0.13.0 2026-02-05 18:52:11 +08:00
eric 016a7fa9bc Enable QUIC by default 2026-02-05 16:11:04 +08:00
eric 3918d1c04c v0.12.0 2025-11-05 15:09:13 +08:00
eric e9646b94ab Free nf on shutdown 2025-10-14 14:24:06 +08:00
eric 93000df6aa Support NetFilter inbound 2025-10-01 17:27:23 +08:00
lanthora 9ec9046abd support windows 2025-02-17 21:18:13 +08:00
eric 69bb4a827a v0.11.0 2024-06-01 23:16:39 +08:00
eric f60e243a89 v0.10.13 2024-05-06 19:46:21 +08:00
eric 42c9d74676 Use ring as default crypto backend 2024-05-06 19:45:50 +08:00
eric effac11504 Support aws-lc-rs crypto backend 2024-05-02 02:24:26 +08:00
eric 06503e16c0 v0.10.12 2024-04-18 16:47:38 +08:00
eric 3c57300520 v0.10.11 2024-04-18 16:41:59 +08:00
eric 7757552bdc refactor: rename leaf-bin -> leaf-cli 2024-04-18 16:39:58 +08:00