-
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix parsing
RestrictDestination
constraint
Signed-off-by: Wiktor Kwapisiewicz <[email protected]>
- Loading branch information
Showing
4 changed files
with
24 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,7 @@ use sha1::Sha1; | |
#[cfg(windows)] | ||
use ssh_agent_lib::agent::NamedPipeListener as Listener; | ||
use ssh_agent_lib::agent::{Agent, Session}; | ||
use ssh_agent_lib::proto::extension::SessionBind; | ||
use ssh_agent_lib::proto::extension::{RestrictDestination, SessionBind}; | ||
use ssh_agent_lib::proto::message::{self, Credential, Message, SignRequest}; | ||
use ssh_agent_lib::proto::{signature, AddIdentityConstrained, KeyConstraint}; | ||
use ssh_key::{ | ||
|
@@ -144,9 +144,10 @@ impl KeyStorage { | |
for constraint in constraints { | ||
if let KeyConstraint::Extension(name, mut details) = constraint { | ||
if name == "[email protected]" { | ||
if let Ok(destination_constraint) = details.parse::<SessionBind>() { | ||
eprintln!("Destination constraint: {destination_constraint:?}"); | ||
} | ||
let destination_constraint = details | ||
.parse::<RestrictDestination>() | ||
.expect("to parse destination constraint"); | ||
eprintln!("Destination constraint: {destination_constraint:?}"); | ||
} | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
github.com ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOMqqnkVzrm0SdG6UOoqKLsabgH5C9okWi0dh2l9GKJl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters