Skip to main content

weirdnet_update/
lib.rs

1//! Weirdnet update metadata and client-side verification.
2//!
3//! This crate holds the parts of an over-the-air update system that are not tied to an app
4//! or a UI toolkit (Salty Gull builds on it):
5//!
6//! - [`root`]: an org root of k-of-n Ed25519 keys, pinned into the app by its
7//!   [`RootPin`], that delegates release keys and names 0 or more timestamp keys.
8//!   Org roots are independent keys, not Weirdnet user keys.
9//! - [`manifest`]: the signed [`UpdateManifest`] and its
10//!   [`UpdateKind`] (assets, Wasm, full signed package, Dart patch placeholder,
11//!   store notice).
12//! - [`freshness`]: optional short-lived timestamp records that block freeze attacks and carry
13//!   revocations.
14//! - [`envelope`]: domain-separated signing over the exact CBOR bytes.
15//! - [`verify`]: the client acceptance rule and [`ClientState`] anti-rollback.
16//! - [`target`] and [`rollout`]: targeting rules and staged rollouts, evaluated on the device.
17//! - [`policy`]: the opt-in consent policy. Updates are never forced.
18//! - [`health`]: boot counting and automatic local rollback.
19//! - [`announce`]: signed update announcements, carried by relays to devices behind NAT.
20#![forbid(unsafe_code)]
21#![warn(missing_docs)]
22
23pub mod announce;
24pub mod bytes;
25pub mod envelope;
26pub mod error;
27pub mod freshness;
28pub mod health;
29pub mod keys;
30pub mod manifest;
31pub mod policy;
32pub mod rollout;
33pub mod root;
34pub mod state;
35pub mod target;
36pub mod time;
37pub mod verify;
38
39mod cbor;
40mod ids;
41
42pub use announce::Announcement;
43pub use bytes::Hash32;
44pub use envelope::{Domain, Signed};
45pub use error::{Error, Result};
46pub use freshness::Freshness;
47pub use keys::{PublicKey, Signature, SigningKey};
48pub use manifest::{FileEntry, UpdateKind, UpdateManifest};
49pub use policy::{ConsentMode, Decision, Flavor, Policy};
50pub use root::{Delegation, Root, RootPin};
51pub use state::ClientState;
52pub use time::Timestamp;
53pub use verify::{Client, UpdateBundle, VerifiedUpdate, VerifyOptions};
54
55#[cfg(test)]
56mod tests;