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

Allow access to a Connection's boring::ssl::SslRef #1666

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions quiche/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7438,6 +7438,13 @@ impl Connection {
}
}

#[cfg(feature = "boringssl-boring-crate")]
impl AsMut<boring::ssl::SslRef> for Connection {
fn as_mut(&mut self) -> &mut boring::ssl::SslRef {
self.handshake.ssl_mut()
}
}

/// Maps an `Error` to `Error::Done`, or itself.
///
/// When a received packet that hasn't yet been authenticated triggers a failure
Expand Down
7 changes: 7 additions & 0 deletions quiche/src/tls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -898,6 +898,13 @@ impl Handshake {
}
}
}

#[cfg(feature = "boringssl-boring-crate")]
pub(crate) fn ssl_mut(&mut self) -> &mut boring::ssl::SslRef {
use foreign_types_shared::ForeignTypeRef;

unsafe { boring::ssl::SslRef::from_ptr_mut(self.as_mut_ptr() as _) }
}
}

// NOTE: These traits are not automatically implemented for Handshake due to the
Expand Down
Loading