Skip to content

Commit eda7430

Browse files
committed
Simulate tech port unlock
Depends on management-gateway-service commit c80fb4f23108691dea43239b55a14f5e47f161b7.
1 parent 032c556 commit eda7430

File tree

8 files changed

+927
-660
lines changed

8 files changed

+927
-660
lines changed

Cargo.lock

Lines changed: 524 additions & 504 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -435,6 +435,7 @@ dns-service-client = { path = "clients/dns-service-client" }
435435
dpd-client = { git = "https://github.com/oxidecomputer/dendrite", rev = "8314881e372d7bbb4a4ee2da051ecdc34f66c534" }
436436
dropshot = { version = "0.16.3", features = [ "usdt-probes" ] }
437437
dyn-clone = "1.0.20"
438+
ecdsa = { version = "0.16.9", features = ["pem", "signing", "std", "verifying"] }
438439
either = "1.15.0"
439440
ereport-types = { path = "ereport/types" }
440441
expectorate = "1.2.0"
@@ -457,9 +458,9 @@ gateway-client = { path = "clients/gateway-client" }
457458
# compatibility, but will mean that faux-mgs might be missing new
458459
# functionality.)
459460
#
460-
gateway-ereport-messages = { git = "https://github.com/oxidecomputer/management-gateway-service", rev = "77e316c812aa057b9714d0d99c4a7bdd36d45be2", default-features = false, features = ["debug-impls"] }
461-
gateway-messages = { git = "https://github.com/oxidecomputer/management-gateway-service", rev = "77e316c812aa057b9714d0d99c4a7bdd36d45be2", default-features = false, features = ["std"] }
462-
gateway-sp-comms = { git = "https://github.com/oxidecomputer/management-gateway-service", rev = "77e316c812aa057b9714d0d99c4a7bdd36d45be2" }
461+
gateway-ereport-messages = { git = "https://github.com/oxidecomputer/management-gateway-service", rev = "c80fb4f23108691dea43239b55a14f5e47f161b7", default-features = false, features = ["debug-impls"] }
462+
gateway-messages = { git = "https://github.com/oxidecomputer/management-gateway-service", rev = "c80fb4f23108691dea43239b55a14f5e47f161b7", default-features = false, features = ["std"] }
463+
gateway-sp-comms = { git = "https://github.com/oxidecomputer/management-gateway-service", rev = "c80fb4f23108691dea43239b55a14f5e47f161b7" }
463464
gateway-test-utils = { path = "gateway-test-utils" }
464465
gateway-types = { path = "gateway-types" }
465466
gethostname = "0.5.0"
@@ -678,7 +679,7 @@ semver = { version = "1.0.26", features = ["std", "serde"] }
678679
serde = { version = "1.0", default-features = false, features = [ "derive", "rc" ] }
679680
serde_cbor = "0.11.2"
680681
serde_human_bytes = { git = "https://github.com/oxidecomputer/serde_human_bytes", branch = "main" }
681-
serde_json = "1.0.142"
682+
serde_json = "1.0.143"
682683
serde_tokenstream = "0.2"
683684
serde_urlencoded = "0.7.1"
684685
serde_with = { version = "3.14.0", default-features = false, features = ["alloc", "macros"] }
@@ -719,6 +720,7 @@ sp-sim = { path = "sp-sim" }
719720
sprockets-tls = { git = "https://github.com/oxidecomputer/sprockets.git", rev = "6d31fa63217c6a51061dc4afa1ebe175a0021981" }
720721
sqlformat = "0.3.5"
721722
sqlparser = { version = "0.45.0", features = [ "visitor" ] }
723+
ssh-key = "0.6.7"
722724
static_assertions = "1.1.0"
723725
# Please do not change the Steno version to a Git dependency. It makes it
724726
# harder than expected to make breaking changes (even if you specify a specific

sp-sim/Cargo.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ anyhow.workspace = true
1212
async-trait.workspace = true
1313
clap.workspace = true
1414
dropshot.workspace = true
15+
ecdsa.workspace = true
1516
futures.workspace = true
1617
gateway-ereport-messages.workspace = true
1718
gateway-messages.workspace = true
@@ -21,6 +22,9 @@ hubtools.workspace = true
2122
nexus-types.workspace = true
2223
omicron-common.workspace = true
2324
oxide-tokio-rt.workspace = true
25+
p256.workspace = true
26+
rand.workspace = true
27+
ssh-key.workspace = true
2428
serde.workspace = true
2529
serde_cbor.workspace = true
2630
sha2.workspace = true

sp-sim/examples/config.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
serial_number = "SimSidecar0"
77
manufacturing_root_cert_seed = "01de01de01de01de01de01de01de01de01de01de01de01de01de01de01de01de"
88
device_id_cert_seed = "01de000000000000000000000000000000000000000000000000000000000000"
9+
authorized_keys = "../smf/switch_zone_setup/support_authorized_keys"
910

1011
[[simulated_sps.sidecar.network_config]]
1112
[simulated_sps.sidecar.network_config.simulated]

sp-sim/src/config.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ pub struct SpComponentConfig {
143143
pub struct SidecarConfig {
144144
#[serde(flatten)]
145145
pub common: SpCommonConfig,
146+
pub authorized_keys: Option<PathBuf>,
146147
}
147148

148149
/// Configuration of a simulated gimlet SP

sp-sim/src/gimlet.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ use gateway_messages::DumpTask;
3131
use gateway_messages::Header;
3232
use gateway_messages::MgsRequest;
3333
use gateway_messages::MgsResponse;
34+
use gateway_messages::MonorailError;
3435
use gateway_messages::PowerStateTransition;
3536
use gateway_messages::RotBootInfo;
3637
use gateway_messages::RotRequest;
@@ -40,6 +41,8 @@ use gateway_messages::SpError;
4041
use gateway_messages::SpPort;
4142
use gateway_messages::SpRequest;
4243
use gateway_messages::SpStateV2;
44+
use gateway_messages::UnlockChallenge;
45+
use gateway_messages::UnlockResponse;
4346
use gateway_messages::ignition::{self, LinkEvents};
4447
use gateway_messages::sp_impl::Sender;
4548
use gateway_messages::sp_impl::SpHandler;
@@ -1722,6 +1725,16 @@ impl SpHandler for Handler {
17221725
fn get_host_flash_hash(&mut self, slot: u16) -> Result<[u8; 32], SpError> {
17231726
self.update_state.get_host_flash_hash(slot)
17241727
}
1728+
1729+
fn unlock(
1730+
&mut self,
1731+
_vid: Self::VLanId,
1732+
_challenge: UnlockChallenge,
1733+
_response: UnlockResponse,
1734+
_time_sec: u32,
1735+
) -> Result<(), MonorailError> {
1736+
Err(MonorailError::UnlockFailed)
1737+
}
17251738
}
17261739

17271740
impl SimSpHandler for Handler {

0 commit comments

Comments
 (0)