From 3b11656cfc48e808c5fede618b67771eeb61f7e8 Mon Sep 17 00:00:00 2001 From: Mat Date: Tue, 7 May 2024 14:36:47 -0500 Subject: [PATCH] Add boringssl keylog support --- openssl/src/ssl/callbacks.rs | 6 +++--- openssl/src/ssl/mod.rs | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/openssl/src/ssl/callbacks.rs b/openssl/src/ssl/callbacks.rs index c6414fb517..be8909ee4a 100644 --- a/openssl/src/ssl/callbacks.rs +++ b/openssl/src/ssl/callbacks.rs @@ -11,7 +11,7 @@ use std::ffi::CStr; use std::mem; use std::ptr; use std::slice; -#[cfg(ossl111)] +#[cfg(any(ossl111, boringssl))] use std::str; use std::sync::Arc; @@ -28,7 +28,7 @@ use crate::ssl::{ }; #[cfg(ossl111)] use crate::ssl::{ClientHelloResponse, ExtensionContext}; -#[cfg(ossl111)] +#[cfg(any(ossl111, boringssl))] use crate::util::ForeignTypeRefExt; #[cfg(ossl111)] use crate::x509::X509Ref; @@ -429,7 +429,7 @@ where } } -#[cfg(ossl111)] +#[cfg(any(ossl111, boringssl))] pub unsafe extern "C" fn raw_keylog(ssl: *const ffi::SSL, line: *const c_char) where F: Fn(&SslRef, &str) + 'static + Sync + Send, diff --git a/openssl/src/ssl/mod.rs b/openssl/src/ssl/mod.rs index 2ff9dac1fd..8fd50602ab 100644 --- a/openssl/src/ssl/mod.rs +++ b/openssl/src/ssl/mod.rs @@ -1470,7 +1470,7 @@ impl SslContextBuilder { /// /// Requires OpenSSL 1.1.1 or newer. #[corresponds(SSL_CTX_set_keylog_callback)] - #[cfg(ossl111)] + #[cfg(any(ossl111, boringssl))] pub fn set_keylog_callback(&mut self, callback: F) where F: Fn(&SslRef, &str) + 'static + Sync + Send,