Skip to main content

qualia_core_db/net/qdnf/profiles/
mod.rs

1//! Hostile-environment protection profiles (E16.1–E16.7). Named immutable
2//! control sets. Negotiate only compatible profiles. Never silently lower
3//! protection for cost (Recipe F).
4//!
5//! # What the endpoint cannot guarantee (E16.7)
6//!
7//! Remote wipe and attestation cannot guarantee safety after endpoint
8//! compromise or seizure. An unlocked, coerced or imaged device can disclose
9//! plaintext that was accessible at that moment. Crash dumps are redacted of
10//! key material; notification previews are truncated. Hardware-backed key
11//! references are unavailable unless a real token is present (this Linux CI
12//! path does not fake a TPM). Cover traffic and padding do not constitute
13//! anonymity; correlation resistance is unmeasured.
14
15pub mod budget;
16pub mod catalog;
17pub mod cover;
18pub mod gateway;
19pub mod negotiate;
20pub mod offline;
21pub mod requirements;
22#[cfg(test)]
23pub mod scenarios;
24pub mod vault;
25
26pub use budget::{
27    crypto_work_units, estimate_overhead, handshake_bytes_hybrid, pad_to_next_bucket,
28    record_bucket, OverheadBudget, P1_PADDING_BUCKET, P2_RECORD_BYTES, P3_CELL_BYTES,
29    P3_COVER_BYTES_PER_SEC, P3_RELAY_HOPS,
30};
31pub use catalog::{
32    catalog_entry, control_set_from_predicates, digest_control_list, ControlId, ControlPredicate,
33    ControlSet, ProtectionProfile, MAX_CONTROLS,
34};
35pub use cover::{
36    approved_relay_required, correlation_resistance_measured, cover_class, cover_mandatory,
37    cover_mandatory_controls, cover_oracle_observed_bytes, drop_cover_for_controls,
38    drop_cover_for_cost, isolated_bearer_required, CoverClass,
39};
40pub use gateway::{
41    gateway_transfer, gateway_transfer_negotiated, refuse_negotiated_downgrade, GatewayMedia,
42};
43pub use negotiate::{
44    bind_version_digest, negotiate, negotiate_outcome, CostPreference, NegotiateOutcome,
45    SelectedProfile,
46};
47pub use offline::{
48    activate_capability, extend_capability_by_copy, queue_offline, release_offline, release_queued,
49    OfflinePackage, OfflineQueue, ScopedCapability, MAX_OFFLINE,
50};
51pub use requirements::{
52    min_profile_for_confidentiality, required_control_set, AssessedEnvironment, RequirementContext,
53    SenderPolicy, TaskClass,
54};
55pub use vault::{
56    crash_dump_redacted, hardware_key_ref_supported, load_key_ref, load_ref, lock,
57    notification_preview_max_bytes, open_profile_blob, require_hardware_backed_p4,
58    seal_profile_blob, store_ref, KeyRef, LocalVault, SealedProfileBlob, VaultSlot,
59    NOTIFICATION_PREVIEW_MAX_BYTES, SEALED_PROFILE_PLAIN_LEN, VAULT_SLOTS,
60};
61
62// Concurrent host tests call `Result<(NativePeer, NativePeer), _>::unwrap_err`,
63// which requires Debug. Host is outside this lane; this test-only impl is
64// opaque and does not dump keys or session state.
65#[cfg(test)]
66impl core::fmt::Debug for crate::net::peer::host::NativePeer {
67    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
68        f.write_str("NativePeer")
69    }
70}