Skip to content

Commit

Permalink
Merge 35c4d73 into a1119e2
Browse files Browse the repository at this point in the history
  • Loading branch information
stepancheg committed Jun 4, 2017
2 parents a1119e2 + 35c4d73 commit fd341ce
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/anchors.rs
Expand Up @@ -10,6 +10,7 @@ use std::io;
/// This is like a `webpki::TrustAnchor`, except it owns
/// rather than borrows its memory. That prevents lifetimes
/// leaking up the object tree.
#[derive(Debug)]
pub struct OwnedTrustAnchor {
subject: Vec<u8>,
spki: Vec<u8>,
Expand All @@ -36,6 +37,7 @@ impl OwnedTrustAnchor {

/// A container for root certificates able to provide a root-of-trust
/// for connection authentication.
#[derive(Debug)]
pub struct RootCertStore {
pub roots: Vec<OwnedTrustAnchor>,
}
Expand Down
8 changes: 8 additions & 0 deletions src/client.rs
Expand Up @@ -19,6 +19,7 @@ use key;
use std::collections;
use std::sync::{Arc, Mutex};
use std::io;
use std::fmt;

/// A trait for the ability to store client session data.
/// The keys and values are opaque.
Expand Down Expand Up @@ -345,6 +346,12 @@ pub struct ClientSessionImpl {
pub state: &'static client_hs::State,
}

impl fmt::Debug for ClientSessionImpl {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.debug_struct("ClientSessionImpl").finish()
}
}

impl ClientSessionImpl {
pub fn new(config: &Arc<ClientConfig>, hostname: &str) -> ClientSessionImpl {
let mut cs = ClientSessionImpl {
Expand Down Expand Up @@ -536,6 +543,7 @@ impl ClientSessionImpl {
}

/// This represents a single TLS client session.
#[derive(Debug)]
pub struct ClientSession {
// We use the pimpl idiom to hide unimportant details.
imp: ClientSessionImpl,
Expand Down
8 changes: 8 additions & 0 deletions src/server.rs
Expand Up @@ -17,6 +17,7 @@ use key;
use std::collections;
use std::sync::{Arc, Mutex};
use std::io;
use std::fmt;

/// A trait for the ability to generate Session IDs, and store
/// server session data. The keys and values are opaque.
Expand Down Expand Up @@ -391,6 +392,12 @@ pub struct ServerSessionImpl {
pub state: &'static server_hs::State,
}

impl fmt::Debug for ServerSessionImpl {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.debug_struct("ServerSessionImpl").finish()
}
}

impl ServerSessionImpl {
pub fn new(server_config: &Arc<ServerConfig>) -> ServerSessionImpl {
let mut sess = ServerSessionImpl {
Expand Down Expand Up @@ -541,6 +548,7 @@ impl ServerSessionImpl {
///
/// Send TLS-protected data to the peer using the `io::Write` trait implementation.
/// Read data from the peer using the `io::Read` trait implementation.
#[derive(Debug)]
pub struct ServerSession {
// We use the pimpl idiom to hide unimportant details.
imp: ServerSessionImpl,
Expand Down

0 comments on commit fd341ce

Please sign in to comment.