-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds an SSH parser, datatype, and sample application to Retina
- Loading branch information
1 parent
9e20c0b
commit 01a149c
Showing
16 changed files
with
689 additions
and
7 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
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
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
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,49 @@ | ||
//! SSH handshake components. | ||
//! | ||
use crate::utils::base64; | ||
|
||
use serde::Serialize; | ||
|
||
/// A parsed SSH Protocol Version Exchange message. | ||
#[derive(Clone, Debug, Default, PartialEq, Serialize)] | ||
pub struct SshVersionExchange { | ||
pub protoversion: Option<String>, | ||
pub softwareversion: Option<String>, | ||
pub comments: Option<String>, | ||
} | ||
|
||
/// A parsed SSH Key Exchange message. | ||
#[derive(Debug, PartialEq, Serialize)] | ||
pub struct SshKeyExchange { | ||
#[serde(with = "base64")] | ||
pub cookie: Vec<u8>, | ||
pub kex_algs: Vec<String>, | ||
pub server_host_key_algs: Vec<String>, | ||
pub encryption_algs_client_to_server: Vec<String>, | ||
pub encryption_algs_server_to_client: Vec<String>, | ||
pub mac_algs_client_to_server: Vec<String>, | ||
pub mac_algs_server_to_client: Vec<String>, | ||
pub compression_algs_client_to_server: Vec<String>, | ||
pub compression_algs_server_to_client: Vec<String>, | ||
pub languages_client_to_server: Vec<String>, | ||
pub languages_server_to_client: Vec<String>, | ||
pub first_kex_packet_follows: bool, | ||
} | ||
|
||
/// A parsed Diffie-Hellman Key Exchange message sent by the client. | ||
#[derive(Debug, Default, Serialize)] | ||
pub struct SshDhInit { | ||
pub e: Vec<u8>, | ||
} | ||
|
||
/// A parsed Diffie-Hellman Key Exchange message sent by the server. | ||
#[derive(Debug, Default, Serialize)] | ||
pub struct SshDhResponse { | ||
pub pubkey_and_certs: Vec<u8>, | ||
pub f: Vec<u8>, | ||
pub signature: Vec<u8>, | ||
} | ||
|
||
#[derive(Debug, Default, Serialize)] | ||
pub struct SshNewKeys; |
Oops, something went wrong.