Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
99 changes: 74 additions & 25 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ memmap2 = "0.9"
p256 = { version = "0.13", features = ["ecdsa", "pkcs8"] }
pem-rfc7468 = { version = "0.7", features = ["std"] }
percent-encoding = "2"
permission-slip-client = { git = "https://github.com/oxidecomputer/permission-slip", rev = "c9d302ef44576e075e35f4f28f8e7ac8345bcd4b" }
permission-slip-common = { git = "https://github.com/oxidecomputer/permission-slip", rev = "c9d302ef44576e075e35f4f28f8e7ac8345bcd4b" }
permission-slip-client = { git = "https://github.com/oxidecomputer/permission-slip", rev = "94b68e717f2da426ca1450d5ebc9fc5000596bdc", features = ["sush-types"] }
permission-slip-common = { git = "https://github.com/oxidecomputer/permission-slip", rev = "94b68e717f2da426ca1450d5ebc9fc5000596bdc" }
pki-playground = { git = "https://github.com/oxidecomputer/pki-playground", rev = "7600756029ce046a02c6234aa84ce230cc5eaa04" }
progenitor = "0.14"
progenitor-client = "0.14"
Expand Down
24 changes: 11 additions & 13 deletions api/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ use sled_hardware_types::BaseboardId;

use sush_common::authn::Identity;
use sush_common::jobs::{
Access, JobId, JobLimits, JobOutputStream, JobStatus, JsonJobStatusMap, Session, SessionId,
SessionSignerNonce, SessionSushNonce, SignedJob,
Access, JobId, JobLimits, JobOutputStream, JobStatus, JsonJobStatusMap, Session,
SessionClientNonce, SessionId, SessionSeq, SessionServerNonce, SessionSignerNonce, SignedJob,
};
use sush_common::keys::{KeyId, SshPublicKey};
use sush_common::targets::SledVersion;
Expand Down Expand Up @@ -74,15 +74,16 @@ pub trait SushApi {
headers: Header<Authorization>,
) -> Result<HttpResponseOk<Session>, HttpError>;

/// Get the sush server nonce needed to start a new session.
/// Get a fresh server nonce for the session ceremony.
///
/// The nonce will need to be sent to the signer server, which will give back its own nonce.
/// Both nonces combined (along with the baseboard ID) will form the session ID.
#[endpoint { method = GET, path = "/session-nonce" }]
async fn session_start_nonce(
/// The client mixes its own nonce with this one to form the sush
/// nonce it submits to the signer. Fetching replaces the previous
/// server nonce, so only the latest ceremony can complete.
#[endpoint { method = GET, path = "/server-nonce" }]
async fn server_nonce(
ctx: RequestContext<Self::Context>,
headers: Header<Authorization>,
) -> Result<HttpResponseOk<SessionStartNonce>, HttpError>;
) -> Result<HttpResponseOk<SessionServerNonce>, HttpError>;

/// Start a new support session.
///
Expand Down Expand Up @@ -287,14 +288,11 @@ pub struct JobTargetParams {
pub target: String,
}

#[derive(Serialize, JsonSchema)]
pub struct SessionStartNonce {
pub nonce: SessionSushNonce,
}

#[derive(Deserialize, JsonSchema)]
pub struct SessionStartBody {
pub client_nonce: SessionClientNonce,
pub signer_nonce: SessionSignerNonce,
pub seq: SessionSeq,
}

/// Job parameters _not_ specified in the signed job request.
Expand Down
Loading