Skip to content

Commit

Permalink
Merge pull request #522 from 7flying/ssh-key-test
Browse files Browse the repository at this point in the history
chore: update ssh-key format in tests to match real-world usage
  • Loading branch information
mergify[bot] authored Jun 28, 2023
2 parents a2a334e + a45b63b commit 0735bba
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion client-linuxapp/src/serviceinfo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -718,7 +718,7 @@ async fn process_serviceinfo_in(si_in: &ServiceInfo, si_out: &mut ServiceInfo) -
))?;
let sshkey_keys_v: Vec<String> = sshkey_keys
.unwrap()
.split(' ')
.split(';')
.map(|s| s.to_string())
.collect();
for key in sshkey_keys_v {
Expand Down
4 changes: 2 additions & 2 deletions integration-tests/tests/common/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -807,15 +807,15 @@ impl<'a> TestServerConfigurator<'a> {
"user",
users::get_current_username().unwrap().to_str().unwrap(),
);
cfg.insert("sshkey", "sshkey_default");
cfg.insert("sshkey", "ssh-ed25519 sshkey_default [email protected]");
cfg.insert("password", "testpassword");
} else {
L.l("per_device_serviceinfo is set, using device specific values");
cfg.insert(
"user",
users::get_current_username().unwrap().to_str().unwrap(),
);
cfg.insert("sshkey", "sshkey_per_device");
cfg.insert("sshkey", "ssh-ed25519 sshkey_per_device [email protected]");
cfg.insert("password", "testpassword");
}

Expand Down
4 changes: 2 additions & 2 deletions integration-tests/tests/e2e.rs
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ where
.context("Error reading authorized SSH keys")?,
"
# These keys are installed by FIDO Device Onboarding
sshkey_default
ssh-ed25519 sshkey_default [email protected]
# End of FIDO Device Onboarding keys
"
);
Expand Down Expand Up @@ -650,7 +650,7 @@ where
.context("Error reading authorized per device SSH keys")?,
"
# These keys are installed by FIDO Device Onboarding
sshkey_per_device
ssh-ed25519 sshkey_per_device [email protected]
# End of FIDO Device Onboarding keys
"
);
Expand Down
2 changes: 1 addition & 1 deletion integration-tests/tests/service_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ where
.context("Error reading authorized SSH keys")?,
"
# These keys are installed by FIDO Device Onboarding
sshkey_default
ssh-ed25519 sshkey_default [email protected]
# End of FIDO Device Onboarding keys
"
);
Expand Down
2 changes: 1 addition & 1 deletion integration-tests/tests/to.rs
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ async fn test_to_impl(
.context("Error reading authorized SSH keys")?,
"
# These keys are installed by FIDO Device Onboarding
sshkey_default
ssh-ed25519 sshkey_default [email protected]
# End of FIDO Device Onboarding keys
"
);
Expand Down
2 changes: 1 addition & 1 deletion owner-onboarding-server/src/handlers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,7 @@ async fn perform_service_info(
out_si.add(
FedoraIotServiceInfoModule::SSHKey,
"sshkeys",
&(initial_user.ssh_keys.unwrap().join(" ")),
&(initial_user.ssh_keys.unwrap().join(";")),
)?;
}
}
Expand Down

0 comments on commit 0735bba

Please sign in to comment.