darkbio-wire 0.8.0

Encrypted protocol between Ark and host
Documentation
// This file is @generated by prost-build.
/// HostToArk represents a message sent from the host to the Ark via the USB
/// connection. It embeds all possible message types to keep the protocol simple.
///
/// Every message carries an id and is either a request, its id chosen by the
/// host, or the host's response to a request of the Ark, echoing the Ark's id.
/// To avoid id collisions, hosts allocate odd ids and Arks even ones, so a
/// receiver can tell a response from a request by the parity of the id alone.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct HostToArk {
    /// Enveloping fields, reserved range 0x001-0x0ff
    ///
    /// Request identifier, the host's own or responded to
    #[prost(uint64, tag = "1")]
    pub id: u64,
    /// Error encountered while serving the Ark's request (if any)
    #[prost(bytes = "bytes", optional, tag = "2")]
    pub err: ::core::option::Option<::prost::bytes::Bytes>,
    /// Body of the message, a request of the host or its response to a request of
    /// the Ark. The tags are grouped by area, each area with its own range.
    #[prost(
        oneof = "host_to_ark::Content",
        tags = "256, 257, 258, 259, 260, 513, 514, 515, 516, 517, 769, 770, 771, 772, 773, 774, 775, 1025, 1026, 1027, 1281, 1282, 1283, 1284, 1285, 1286, 1537, 1538, 1539, 1540, 1541, 1542, 1543, 1544, 4096"
    )]
    pub content: ::core::option::Option<host_to_ark::Content>,
}
/// Nested message and enum types in `HostToArk`.
pub mod host_to_ark {
    /// Body of the message, a request of the host or its response to a request of
    /// the Ark. The tags are grouped by area, each area with its own range.
    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
    pub enum Content {
        /// Installs the signed device attestation at manufacturing
        #[prost(bytes, tag = "256")]
        Onboard(::prost::bytes::Bytes),
        /// Fetches the hardware and firmware versions
        #[prost(bytes, tag = "257")]
        DeviceInfo(::prost::bytes::Bytes),
        /// Starts a cloud sync with the attested cloud keys
        #[prost(bytes, tag = "258")]
        CloudSyncStart(::prost::bytes::Bytes),
        /// Finishes a cloud sync with the signed server time
        #[prost(bytes, tag = "259")]
        CloudSyncFinish(::prost::bytes::Bytes),
        /// Requests a proof of the device's genuinity
        #[prost(bytes, tag = "260")]
        GenuinityProof(::prost::bytes::Bytes),
        /// Prepares an update, aborting any in progress
        #[prost(bytes, tag = "513")]
        FirmwareUpdatePrep(::prost::bytes::Bytes),
        /// Initiates a prepared update with the sealed firmware key
        #[prost(bytes, tag = "514")]
        FirmwareUpdateInit(::prost::bytes::Bytes),
        /// Appends a chunk of the firmware archive
        #[prost(bytes, tag = "515")]
        FirmwareUpdateUpload(::prost::bytes::Bytes),
        /// Decrypts and verifies the uploaded firmware
        #[prost(bytes, tag = "516")]
        FirmwareUpdateVerify(::prost::bytes::Bytes),
        /// Installs the verified firmware and reboots
        #[prost(bytes, tag = "517")]
        FirmwareUpdateInstall(::prost::bytes::Bytes),
        /// Queries whether the Ark is paired and opened
        #[prost(bytes, tag = "769")]
        PairingStatus(::prost::bytes::Bytes),
        /// Asks the Ark to authorize a pairing rendezvous
        #[prost(bytes, tag = "770")]
        PairingAuth(::prost::bytes::Bytes),
        /// Injects the companion app's identity, relayed by the cloud
        #[prost(bytes, tag = "771")]
        PairingSetAppId(::prost::bytes::Bytes),
        /// Injects the companion app's storage key material
        #[prost(bytes, tag = "772")]
        PairingSetAppStorage(::prost::bytes::Bytes),
        /// Confirms the app received the Ark's key material
        #[prost(bytes, tag = "773")]
        PairingAckArkStorage(::prost::bytes::Bytes),
        /// Waits for the user to accept the pairing
        #[prost(bytes, tag = "774")]
        PairingAccept(::prost::bytes::Bytes),
        /// Waits for the Ark to finish pairing maintenance
        #[prost(bytes, tag = "775")]
        PairingComplete(::prost::bytes::Bytes),
        /// Asks the Ark to authorize joining the app relay
        #[prost(bytes, tag = "1025")]
        RelayJoin(::prost::bytes::Bytes),
        /// Opaque request from the companion app to the Ark
        #[prost(bytes, tag = "1026")]
        RelayReq(::prost::bytes::Bytes),
        /// Opaque response from the companion app to an Ark request
        #[prost(bytes, tag = "1027")]
        RelayRes(::prost::bytes::Bytes),
        /// Starts the unlock, confirmed through the app
        #[prost(bytes, tag = "1281")]
        Unlock(::prost::bytes::Bytes),
        /// Begins a chunked upload of an app to execute
        #[prost(bytes, tag = "1282")]
        ExecUploadStart(::prost::bytes::Bytes),
        /// Appends a chunk to a pending app upload
        #[prost(bytes, tag = "1283")]
        ExecUploadChunk(::prost::bytes::Bytes),
        /// Runs an uploaded app, confirmed through the app
        #[prost(bytes, tag = "1284")]
        ExecSched(::prost::bytes::Bytes),
        /// Checks on a running app
        #[prost(bytes, tag = "1285")]
        ExecStatus(::prost::bytes::Bytes),
        /// Cancels an app run or a pending upload
        #[prost(bytes, tag = "1286")]
        ExecCancel(::prost::bytes::Bytes),
        /// Lists the state of every data slot
        #[prost(bytes, tag = "1537")]
        SlotList(::prost::bytes::Bytes),
        /// Resets a slot to empty whatever its state
        #[prost(bytes, tag = "1538")]
        SlotRepair(::prost::bytes::Bytes),
        /// Removes the contents of a filled slot
        #[prost(bytes, tag = "1539")]
        SlotDelete(::prost::bytes::Bytes),
        /// Asks the Ark to identify a file from its first chunk
        #[prost(bytes, tag = "1540")]
        SlotUploadPeek(::prost::bytes::Bytes),
        /// Starts uploading a file into a slot
        #[prost(bytes, tag = "1541")]
        SlotUploadStart(::prost::bytes::Bytes),
        /// Appends a chunk to a pending slot upload
        #[prost(bytes, tag = "1542")]
        SlotUploadChunk(::prost::bytes::Bytes),
        /// Aborts a pending slot upload
        #[prost(bytes, tag = "1543")]
        SlotUploadCancel(::prost::bytes::Bytes),
        /// Marks an upload complete and polls its processing
        #[prost(bytes, tag = "1544")]
        SlotUploadProcess(::prost::bytes::Bytes),
        /// Unreleased messages served by development firmware only, carried opaquely
        /// so the public protocol is untouched while they are still under development.
        /// Their schema is private and production Arks refuse the envelope.
        #[prost(bytes, tag = "4096")]
        Develop(::prost::bytes::Bytes),
    }
}
/// ArkToHost represents a message sent from the Ark to the host via the USB
/// connection. It embeds all possible message types to keep the protocol simple.
///
/// Every message carries an id and is either a request, its id chosen by the
/// Ark, or the Ark's response to a request of the host, echoing the host's id.
/// To avoid id collisions, hosts allocate odd ids and Arks even ones, so a
/// receiver can tell a response from a request by the parity of the id alone.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ArkToHost {
    /// Enveloping fields, reserved range 0x001-0x0ff
    ///
    /// Request identifier, responded to or the Ark's own
    #[prost(uint64, tag = "1")]
    pub id: u64,
    /// Error encountered while serving the host's request (if any)
    #[prost(bytes = "bytes", optional, tag = "2")]
    pub err: ::core::option::Option<::prost::bytes::Bytes>,
    /// Body of the message, a response of the Ark to a request of the host or a
    /// request of its own. The tags are grouped by area, each area with its own range.
    #[prost(
        oneof = "ark_to_host::Content",
        tags = "256, 257, 258, 259, 260, 513, 514, 515, 516, 517, 769, 770, 771, 772, 773, 774, 775, 1025, 1026, 1027, 1028, 1281, 1282, 1283, 1284, 1285, 1286, 1537, 1538, 1539, 1540, 1541, 1542, 1543, 1544, 4096"
    )]
    pub content: ::core::option::Option<ark_to_host::Content>,
}
/// Nested message and enum types in `ArkToHost`.
pub mod ark_to_host {
    /// Body of the message, a response of the Ark to a request of the host or a
    /// request of its own. The tags are grouped by area, each area with its own range.
    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
    pub enum Content {
        /// Acknowledges the onboarding
        #[prost(bytes, tag = "256")]
        Onboard(::prost::bytes::Bytes),
        /// Hardware and firmware versions of the Ark
        #[prost(bytes, tag = "257")]
        DeviceInfo(::prost::bytes::Bytes),
        /// Challenge for the cloud to sign along its time
        #[prost(bytes, tag = "258")]
        CloudSyncStart(::prost::bytes::Bytes),
        /// Timestamp the Ark accepted from the cloud
        #[prost(bytes, tag = "259")]
        CloudSyncFinish(::prost::bytes::Bytes),
        /// Encrypted proof of the Ark's genuinity for the cloud
        #[prost(bytes, tag = "260")]
        GenuinityProof(::prost::bytes::Bytes),
        /// Ephemeral key to receive the firmware key with, sealed for the cloud
        #[prost(bytes, tag = "513")]
        FirmwareUpdatePrep(::prost::bytes::Bytes),
        /// Acknowledges the initiated update
        #[prost(bytes, tag = "514")]
        FirmwareUpdateInit(::prost::bytes::Bytes),
        /// Acknowledges the appended firmware chunk
        #[prost(bytes, tag = "515")]
        FirmwareUpdateUpload(::prost::bytes::Bytes),
        /// Acknowledges the verified firmware
        #[prost(bytes, tag = "516")]
        FirmwareUpdateVerify(::prost::bytes::Bytes),
        /// Acknowledges the installed firmware
        #[prost(bytes, tag = "517")]
        FirmwareUpdateInstall(::prost::bytes::Bytes),
        /// Whether the Ark is paired and opened
        #[prost(bytes, tag = "769")]
        PairingStatus(::prost::bytes::Bytes),
        /// Signed authorization for the cloud to open a rendezvous
        #[prost(bytes, tag = "770")]
        PairingAuth(::prost::bytes::Bytes),
        /// Acknowledges the accepted app identity
        #[prost(bytes, tag = "771")]
        PairingSetAppId(::prost::bytes::Bytes),
        /// Ark device infos and key material, sealed for the app
        #[prost(bytes, tag = "772")]
        PairingSetAppStorage(::prost::bytes::Bytes),
        /// Acknowledges the app's receipt of the Ark's keys
        #[prost(bytes, tag = "773")]
        PairingAckArkStorage(::prost::bytes::Bytes),
        /// Signed confirmation that the user accepted the pairing
        #[prost(bytes, tag = "774")]
        PairingAccept(::prost::bytes::Bytes),
        /// Signed confirmation that the Ark finished pairing
        #[prost(bytes, tag = "775")]
        PairingComplete(::prost::bytes::Bytes),
        /// Signed authorization for the cloud to join the relay
        #[prost(bytes, tag = "1025")]
        RelayJoin(::prost::bytes::Bytes),
        /// Opaque request from the Ark to the companion app
        #[prost(bytes, tag = "1026")]
        RelayReq(::prost::bytes::Bytes),
        /// Opaque response from the Ark to an app request
        #[prost(bytes, tag = "1027")]
        RelayRes(::prost::bytes::Bytes),
        /// Protocol violation found in an app response, for debugging
        #[prost(bytes, tag = "1028")]
        RelayFail(::prost::bytes::Bytes),
        /// Acknowledges the completed unlock
        #[prost(bytes, tag = "1281")]
        Unlock(::prost::bytes::Bytes),
        /// Task id for the chunk, schedule and cancel messages
        #[prost(bytes, tag = "1282")]
        ExecUploadStart(::prost::bytes::Bytes),
        /// Acknowledges the appended app chunk
        #[prost(bytes, tag = "1283")]
        ExecUploadChunk(::prost::bytes::Bytes),
        /// Acknowledges the authorized and started execution
        #[prost(bytes, tag = "1284")]
        ExecSched(::prost::bytes::Bytes),
        /// Whether the app still runs, with its result once done
        #[prost(bytes, tag = "1285")]
        ExecStatus(::prost::bytes::Bytes),
        /// Acknowledges the cancelled run or upload
        #[prost(bytes, tag = "1286")]
        ExecCancel(::prost::bytes::Bytes),
        /// Current state of every data slot
        #[prost(bytes, tag = "1537")]
        SlotList(::prost::bytes::Bytes),
        /// Acknowledges the reset slot
        #[prost(bytes, tag = "1538")]
        SlotRepair(::prost::bytes::Bytes),
        /// Acknowledges the deleted slot
        #[prost(bytes, tag = "1539")]
        SlotDelete(::prost::bytes::Bytes),
        /// Identification of the peeked file
        #[prost(bytes, tag = "1540")]
        SlotUploadPeek(::prost::bytes::Bytes),
        /// Session id of the approved upload
        #[prost(bytes, tag = "1541")]
        SlotUploadStart(::prost::bytes::Bytes),
        /// Acknowledges the appended slot chunk
        #[prost(bytes, tag = "1542")]
        SlotUploadChunk(::prost::bytes::Bytes),
        /// Acknowledges the aborted upload
        #[prost(bytes, tag = "1543")]
        SlotUploadCancel(::prost::bytes::Bytes),
        /// Processing progress of the completed upload
        #[prost(bytes, tag = "1544")]
        SlotUploadProcess(::prost::bytes::Bytes),
        /// Unreleased messages emitted by development firmware only, in response to
        /// a develop request, carried opaquely so the public protocol is untouched
        /// while they are still under development. Their schema is private.
        #[prost(bytes, tag = "4096")]
        Develop(::prost::bytes::Bytes),
    }
}