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#![forbid(unsafe_code)]
20#![warn(missing_docs)]
21
22pub mod bytes;
23pub mod envelope;
24pub mod error;
25pub mod freshness;
26pub mod health;
27pub mod keys;
28pub mod manifest;
29pub mod policy;
30pub mod rollout;
31pub mod root;
32pub mod state;
33pub mod target;
34pub mod time;
35pub mod verify;
36
37mod cbor;
38mod ids;
39
40pub use bytes::Hash32;
41pub use envelope::{Domain, Signed};
42pub use error::{Error, Result};
43pub use freshness::Freshness;
44pub use keys::{PublicKey, Signature, SigningKey};
45pub use manifest::{FileEntry, UpdateKind, UpdateManifest};
46pub use policy::{ConsentMode, Decision, Flavor, Policy};
47pub use root::{Delegation, Root, RootPin};
48pub use state::ClientState;
49pub use time::Timestamp;
50pub use verify::{Client, UpdateBundle, VerifiedUpdate, VerifyOptions};
51
52#[cfg(test)]
53mod tests;