Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
| a0b704cd09 | |||
| b5f3829c23 | |||
| 7c1da42e7b | |||
|
|
9d93fb5cfa |
||
| fb45143695 | |||
|
|
6216475b13 |
3 changed files with 57 additions and 23 deletions
20
README.md
20
README.md
|
|
@ -3,7 +3,7 @@
|
||||||
Lean Tor messenger: one Rust process (ratatui + Noise IK + sqlite + in-process Arti).
|
Lean Tor messenger: one Rust process (ratatui + Noise IK + sqlite + in-process Arti).
|
||||||
No hosted server. Identity is an ed25519 public key; the onion is only a locator.
|
No hosted server. Identity is an ed25519 public key; the onion is only a locator.
|
||||||
|
|
||||||
Current tagged release: **v0.5.0**. Linux TUI + Android SDK/APK. Two people add
|
Current tagged release: **v0.7.0**. Linux TUI + Android SDK/APK. Two people add
|
||||||
each other with an `onionwire:v2:…` invite string (`F2` share / `F3` paste;
|
each other with an `onionwire:v2:…` invite string (`F2` share / `F3` paste;
|
||||||
~1.9 KB because it carries an ML-KEM-768 key). There is no invite QR graphic.
|
~1.9 KB because it carries an ML-KEM-768 key). There is no invite QR graphic.
|
||||||
Chat is Noise IK over your own v3 onion; when the friend was added from a v2
|
Chat is Noise IK over your own v3 onion; when the friend was added from a v2
|
||||||
|
|
@ -61,8 +61,8 @@ resulting hash) next to its `.sha256`.
|
||||||
**x86_64:**
|
**x86_64:**
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
curl -fL -O https://forgejo.siriusdevops.com/sirius/onionwire/releases/download/v0.5.0/onionwire-x86_64-unknown-linux-gnu
|
curl -fL -O https://forgejo.siriusdevops.com/sirius/onionwire/releases/download/v0.7.0/onionwire-x86_64-unknown-linux-gnu
|
||||||
curl -fL -O https://forgejo.siriusdevops.com/sirius/onionwire/releases/download/v0.5.0/onionwire-x86_64-unknown-linux-gnu.sha256
|
curl -fL -O https://forgejo.siriusdevops.com/sirius/onionwire/releases/download/v0.7.0/onionwire-x86_64-unknown-linux-gnu.sha256
|
||||||
sha256sum -c onionwire-x86_64-unknown-linux-gnu.sha256
|
sha256sum -c onionwire-x86_64-unknown-linux-gnu.sha256
|
||||||
chmod +x onionwire-x86_64-unknown-linux-gnu
|
chmod +x onionwire-x86_64-unknown-linux-gnu
|
||||||
./onionwire-x86_64-unknown-linux-gnu --version
|
./onionwire-x86_64-unknown-linux-gnu --version
|
||||||
|
|
@ -71,8 +71,8 @@ chmod +x onionwire-x86_64-unknown-linux-gnu
|
||||||
**aarch64:**
|
**aarch64:**
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
curl -fL -O https://forgejo.siriusdevops.com/sirius/onionwire/releases/download/v0.5.0/onionwire-aarch64-unknown-linux-gnu
|
curl -fL -O https://forgejo.siriusdevops.com/sirius/onionwire/releases/download/v0.7.0/onionwire-aarch64-unknown-linux-gnu
|
||||||
curl -fL -O https://forgejo.siriusdevops.com/sirius/onionwire/releases/download/v0.5.0/onionwire-aarch64-unknown-linux-gnu.sha256
|
curl -fL -O https://forgejo.siriusdevops.com/sirius/onionwire/releases/download/v0.7.0/onionwire-aarch64-unknown-linux-gnu.sha256
|
||||||
sha256sum -c onionwire-aarch64-unknown-linux-gnu.sha256
|
sha256sum -c onionwire-aarch64-unknown-linux-gnu.sha256
|
||||||
chmod +x onionwire-aarch64-unknown-linux-gnu
|
chmod +x onionwire-aarch64-unknown-linux-gnu
|
||||||
./onionwire-aarch64-unknown-linux-gnu --version
|
./onionwire-aarch64-unknown-linux-gnu --version
|
||||||
|
|
@ -134,7 +134,7 @@ system OpenSSL headers or `pkg-config` are required — Arti's TLS backend is
|
||||||
`rustls`.
|
`rustls`.
|
||||||
|
|
||||||
The crate version in `Cargo.toml` is **not** bumped by the release workflow. The
|
The crate version in `Cargo.toml` is **not** bumped by the release workflow. The
|
||||||
tag (`v0.5.0`) is the version users download; `onionwire --version` prints
|
tag (`v0.7.0`) is the version users download; `onionwire --version` prints
|
||||||
`CARGO_PKG_VERSION` from the tree that was built.
|
`CARGO_PKG_VERSION` from the tree that was built.
|
||||||
|
|
||||||
### Two instances on one machine
|
### Two instances on one machine
|
||||||
|
|
@ -433,7 +433,9 @@ invites interoperate.
|
||||||
- **SDK** — `onionwire-sdk-<version>.aar`. UniFFI Kotlin over the same Rust crate
|
- **SDK** — `onionwire-sdk-<version>.aar`. UniFFI Kotlin over the same Rust crate
|
||||||
the TUI runs. See [crates/onionwire-sdk/README.md](crates/onionwire-sdk/README.md).
|
the TUI runs. See [crates/onionwire-sdk/README.md](crates/onionwire-sdk/README.md).
|
||||||
- **APK** — `onionwire-<version>-android-arm64-v8a.apk`. Kotlin + Jetpack Compose.
|
- **APK** — `onionwire-<version>-android-arm64-v8a.apk`. Kotlin + Jetpack Compose.
|
||||||
Build notes: [android/README.md](android/README.md).
|
Build notes: [android/README.md](android/README.md). The UI is a design-token
|
||||||
|
system (one accent, 16px cards, three-tab shell: Chats / Wallet / Node &
|
||||||
|
Settings) rather than per-screen styling; see *App shell* in that README.
|
||||||
|
|
||||||
The APK build is amd64-only. After the Linux `release` workflow finishes,
|
The APK build is amd64-only. After the Linux `release` workflow finishes,
|
||||||
dispatch `android-release` with that tag so the APK/AAR attach to the same
|
dispatch `android-release` with that tag so the APK/AAR attach to the same
|
||||||
|
|
@ -441,7 +443,7 @@ Forgejo release.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
scripts/build-android-local.sh # -> dist/, with .sha256
|
scripts/build-android-local.sh # -> dist/, with .sha256
|
||||||
PUBLISH_TAG=v0.5.0 scripts/build-android-local.sh # + upload to that release
|
PUBLISH_TAG=v0.7.0 scripts/build-android-local.sh # + upload to that release
|
||||||
```
|
```
|
||||||
|
|
||||||
## Releases (maintainers)
|
## Releases (maintainers)
|
||||||
|
|
@ -461,7 +463,7 @@ Actions → **release** → Run workflow:
|
||||||
Then dispatch **android-release** with `tag=<that tag>` to attach the APK + AAR.
|
Then dispatch **android-release** with `tag=<that tag>` to attach the APK + AAR.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
FORGEJO_TOKEN=<pat> scripts/build-release-local.sh v0.5.0
|
FORGEJO_TOKEN=<pat> scripts/build-release-local.sh v0.7.0
|
||||||
```
|
```
|
||||||
|
|
||||||
Do not run `cargo publish`; `publish = false`.
|
Do not run `cargo publish`; `publish = false`.
|
||||||
|
|
|
||||||
|
|
@ -67,7 +67,7 @@ missing:
|
||||||
|
|
||||||
- **`/releases/latest/download/…` is not served by this Forgejo — it is a 404.**
|
- **`/releases/latest/download/…` is not served by this Forgejo — it is a 404.**
|
||||||
The GitHub habit fails here. Always pin the tag:
|
The GitHub habit fails here. Always pin the tag:
|
||||||
`…/releases/download/v0.5.0/onionwire-x86_64-unknown-linux-gnu`.
|
`…/releases/download/v0.7.0/onionwire-x86_64-unknown-linux-gnu`.
|
||||||
- **Cloudflare in front of the Forgejo rejects non-browser User-Agents.** A
|
- **Cloudflare in front of the Forgejo rejects non-browser User-Agents.** A
|
||||||
script that sends a default library UA gets `HTTP 403` with the body
|
script that sends a default library UA gets `HTTP 403` with the body
|
||||||
`error code: 1010` — even with a correct tag and URL. Measured against a real
|
`error code: 1010` — even with a correct tag and URL. Measured against a real
|
||||||
|
|
@ -157,10 +157,10 @@ is public": *the binary I downloaded might not be that source.*
|
||||||
git clone https://forgejo.siriusdevops.com/sirius/onionwire
|
git clone https://forgejo.siriusdevops.com/sirius/onionwire
|
||||||
cd onionwire
|
cd onionwire
|
||||||
git fetch --tags
|
git fetch --tags
|
||||||
scripts/verify-reproducible.sh v0.5.0
|
scripts/verify-reproducible.sh v0.7.0
|
||||||
```
|
```
|
||||||
|
|
||||||
Replace `v0.5.0` with the tag you are checking. You need docker; you do not
|
Replace `v0.7.0` with the tag you are checking. You need docker; you do not
|
||||||
need Rust, or the right glibc, or the right distro. The rebuild happens inside
|
need Rust, or the right glibc, or the right distro. The rebuild happens inside
|
||||||
the same builder image, pinned **by digest**, that CI uses, with the source
|
the same builder image, pinned **by digest**, that CI uses, with the source
|
||||||
paths, the target path, and `SOURCE_DATE_EPOCH` all fixed by
|
paths, the target path, and `SOURCE_DATE_EPOCH` all fixed by
|
||||||
|
|
|
||||||
|
|
@ -10,26 +10,45 @@
|
||||||
//! Neither call may panic, and neither may leave the state mutated on a frame
|
//! Neither call may panic, and neither may leave the state mutated on a frame
|
||||||
//! it rejects (asserted in `tests/ratchet.rs`, re-checked cheaply here by
|
//! it rejects (asserted in `tests/ratchet.rs`, re-checked cheaply here by
|
||||||
//! re-serializing after every decrypt).
|
//! re-serializing after every decrypt).
|
||||||
|
//!
|
||||||
|
//! Both bootstrap shapes are exercised: a classical friend (`remote_kem_pub =
|
||||||
|
//! None`) and a hybrid friend, whose peer ML-KEM ratchet key is a real
|
||||||
|
//! encapsulation key of `kem::PK_LEN` bytes derived from a fixed seed. A
|
||||||
|
//! garbage key would only ever hit the "invalid encapsulation key" error path.
|
||||||
#![no_main]
|
#![no_main]
|
||||||
|
|
||||||
use libfuzzer_sys::fuzz_target;
|
use libfuzzer_sys::fuzz_target;
|
||||||
|
use onionwire::kem::{self, PK_LEN, SEED_LEN};
|
||||||
use onionwire::ratchet::{RatchetKeyPair, RatchetState};
|
use onionwire::ratchet::{RatchetKeyPair, RatchetState};
|
||||||
|
use std::sync::OnceLock;
|
||||||
|
|
||||||
fuzz_target!(|data: &[u8]| {
|
/// A canonical ML-KEM-768 encapsulation key, built once: key generation is
|
||||||
// Restore path: arbitrary bytes as a persisted ratchet state.
|
/// deterministic for a fixed seed, so this only pays for itself on iteration 1.
|
||||||
if let Ok(state) = RatchetState::from_bytes(data) {
|
fn peer_kem_pub() -> &'static [u8] {
|
||||||
// A state that parsed must re-serialize without panicking.
|
static PK: OnceLock<Vec<u8>> = OnceLock::new();
|
||||||
let _ = state.to_bytes();
|
PK.get_or_init(|| {
|
||||||
}
|
let pk = kem::pk_from_seed(&[0x44u8; SEED_LEN]).expect("64 bytes is a valid ML-KEM seed");
|
||||||
|
assert_eq!(pk.len(), PK_LEN, "crate ML-KEM public key length changed");
|
||||||
|
pk
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
// Wire path: a fresh bootstrap epoch for every input, so one iteration can
|
fn bootstrap(remote_kem_pub: Option<&[u8]>) -> RatchetState {
|
||||||
// never influence the next. The keys are fixed (not fuzzed) on purpose:
|
// The keys are fixed (not fuzzed) on purpose: the interesting surface is
|
||||||
// the interesting surface is `data` as the frame.
|
// `data` as the frame.
|
||||||
let mut state = RatchetState::bootstrap(
|
RatchetState::bootstrap(
|
||||||
[0x42u8; 32],
|
[0x42u8; 32],
|
||||||
RatchetKeyPair::from_secret([0x11u8; 32]),
|
RatchetKeyPair::from_secret([0x11u8; 32]),
|
||||||
[0x33u8; 32],
|
[0x33u8; 32],
|
||||||
);
|
remote_kem_pub,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Feed `data` to a fresh state and hold the existing invariants: a reject must
|
||||||
|
/// roll back, an accept must have advanced the receiving chain, and re-sending
|
||||||
|
/// from the resulting state must not panic.
|
||||||
|
fn exercise(remote_kem_pub: Option<&[u8]>, data: &[u8]) {
|
||||||
|
let mut state = bootstrap(remote_kem_pub);
|
||||||
let before = state.to_bytes();
|
let before = state.to_bytes();
|
||||||
|
|
||||||
match state.decrypt(data) {
|
match state.decrypt(data) {
|
||||||
|
|
@ -45,4 +64,17 @@ fuzz_target!(|data: &[u8]| {
|
||||||
|
|
||||||
// Re-encrypting a byte-identical state must stay a pure function.
|
// Re-encrypting a byte-identical state must stay a pure function.
|
||||||
let _ = state.encrypt(b"fuzz");
|
let _ = state.encrypt(b"fuzz");
|
||||||
|
}
|
||||||
|
|
||||||
|
fuzz_target!(|data: &[u8]| {
|
||||||
|
// Restore path: arbitrary bytes as a persisted ratchet state.
|
||||||
|
if let Ok(state) = RatchetState::from_bytes(data) {
|
||||||
|
// A state that parsed must re-serialize without panicking.
|
||||||
|
let _ = state.to_bytes();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Wire path: a fresh bootstrap epoch for every input, so one iteration can
|
||||||
|
// never influence the next. Classical and hybrid, both.
|
||||||
|
exercise(None, data);
|
||||||
|
exercise(Some(peer_kem_pub()), data);
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue