Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add more Secure Session tests #376

Merged
merged 9 commits into from
Feb 12, 2019
12 changes: 6 additions & 6 deletions src/wrappers/themis/rust/src/secure_session.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,11 @@ struct SecureSessionContext {
/// [`get_public_key_for_id`]: trait.SecureSessionTransport.html#tymethod.get_public_key_for_id
#[allow(unused_variables)]
pub trait SecureSessionTransport {
/// Get a public key corresponding to a peer ID.
///
/// Return `None` if you are unable to find a corresponding public key.
fn get_public_key_for_id(&mut self, id: &[u8]) -> Option<EcdsaPublicKey>;

/// Send the provided data to the peer, return the number of bytes transferred.
///
/// This callback will be called when Secure Session needs to send some data to its peer.
Expand Down Expand Up @@ -97,11 +102,6 @@ pub trait SecureSessionTransport {
///
/// This method is truly optional and has no effect on Secure Session operation.
fn state_changed(&mut self, state: SecureSessionState) {}

/// Get a public key corresponding to a peer ID.
///
/// Return `None` if you are unable to find a corresponding public key.
fn get_public_key_for_id(&mut self, id: &[u8]) -> Option<EcdsaPublicKey>;
}

/// Transport layer error.
Expand Down Expand Up @@ -220,7 +220,7 @@ impl TransportError {
}

/// State of Secure Session connection.
#[derive(PartialEq, Eq)]
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum SecureSessionState {
/// Newly created sessions start in this state.
Idle,
Expand Down
Loading