Add OpenSSH KRL spec export
This commit is contained in:
parent
02444a7cfd
commit
b102e07204
9 changed files with 235 additions and 25 deletions
|
|
@ -863,6 +863,7 @@ fn ssh_cert_request_approval_and_revocation_export_use_local_state() {
|
|||
&node,
|
||||
geth_control::ControlRequest::SshRevocationExport {
|
||||
out: export_path.clone(),
|
||||
format: "jsonl".to_owned(),
|
||||
},
|
||||
)
|
||||
.expect("export revocations");
|
||||
|
|
@ -871,4 +872,32 @@ fn ssh_cert_request_approval_and_revocation_export_use_local_state() {
|
|||
.expect("read revocations")
|
||||
.contains("lost key")
|
||||
);
|
||||
|
||||
let krl_spec_path = home.path().join("revocations.krl-spec");
|
||||
let response = geth_node::handle_request(
|
||||
&node,
|
||||
geth_control::ControlRequest::SshRevocationExport {
|
||||
out: krl_spec_path.clone(),
|
||||
format: "openssh-krl-spec".to_owned(),
|
||||
},
|
||||
)
|
||||
.expect("export revocation krl spec");
|
||||
match response {
|
||||
geth_control::ControlResponse::SshRevocationExported {
|
||||
format,
|
||||
count,
|
||||
note,
|
||||
..
|
||||
} => {
|
||||
assert_eq!(format, "openssh-krl-spec");
|
||||
assert_eq!(count, 1);
|
||||
assert!(note.contains("ssh-keygen -k"));
|
||||
}
|
||||
other => panic!("unexpected response: {other:?}"),
|
||||
}
|
||||
assert!(
|
||||
std::fs::read_to_string(krl_spec_path)
|
||||
.expect("read krl spec")
|
||||
.contains("key: ssh:blake3:test")
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue