Loading openssl-sys/src/openssl/v111.rs +10 −0 Original line number Diff line number Diff line Loading @@ -89,4 +89,14 @@ extern "C" { pub fn SSL_get_max_early_data(ctx: *const ::SSL) -> u32; pub fn SSL_SESSION_set_max_early_data(ctx: *mut ::SSL_SESSION, max_early_data: u32) -> c_int; pub fn SSL_SESSION_get_max_early_data(ctx: *const ::SSL_SESSION) -> u32; pub fn SSL_export_keying_material_early( s: *mut ::SSL, out: *mut c_uchar, olen: size_t, label: *const c_char, llen: size_t, context: *const c_uchar, contextlen: size_t, ) -> c_int; } openssl/src/ssl/mod.rs +27 −0 Original line number Diff line number Diff line Loading @@ -2498,6 +2498,33 @@ impl SslRef { } } /// Derives keying material for application use in accordance to RFC 5705. /// /// Requires OpenSSL 1.1.1 or newer. /// /// This corresponds to [`SSL_export_keying_material_early`]. /// /// [`SSL_export_keying_material_early`]: https://www.openssl.org/docs/manmaster/man3/SSL_export_keying_material_early.html #[cfg(ossl111)] pub fn export_keying_material_early( &self, out: &mut [u8], label: &str, context: &[u8], ) -> Result<(), ErrorStack> { unsafe { cvt(ffi::SSL_export_keying_material_early( self.as_ptr(), out.as_mut_ptr() as *mut c_uchar, out.len(), label.as_ptr() as *const c_char, label.len(), context.as_ptr() as *const c_uchar, context.len(), )).map(|_| ()) } } /// Sets the session to be used. /// /// This should be called before the handshake to attempt to reuse a previously established Loading Loading
openssl-sys/src/openssl/v111.rs +10 −0 Original line number Diff line number Diff line Loading @@ -89,4 +89,14 @@ extern "C" { pub fn SSL_get_max_early_data(ctx: *const ::SSL) -> u32; pub fn SSL_SESSION_set_max_early_data(ctx: *mut ::SSL_SESSION, max_early_data: u32) -> c_int; pub fn SSL_SESSION_get_max_early_data(ctx: *const ::SSL_SESSION) -> u32; pub fn SSL_export_keying_material_early( s: *mut ::SSL, out: *mut c_uchar, olen: size_t, label: *const c_char, llen: size_t, context: *const c_uchar, contextlen: size_t, ) -> c_int; }
openssl/src/ssl/mod.rs +27 −0 Original line number Diff line number Diff line Loading @@ -2498,6 +2498,33 @@ impl SslRef { } } /// Derives keying material for application use in accordance to RFC 5705. /// /// Requires OpenSSL 1.1.1 or newer. /// /// This corresponds to [`SSL_export_keying_material_early`]. /// /// [`SSL_export_keying_material_early`]: https://www.openssl.org/docs/manmaster/man3/SSL_export_keying_material_early.html #[cfg(ossl111)] pub fn export_keying_material_early( &self, out: &mut [u8], label: &str, context: &[u8], ) -> Result<(), ErrorStack> { unsafe { cvt(ffi::SSL_export_keying_material_early( self.as_ptr(), out.as_mut_ptr() as *mut c_uchar, out.len(), label.as_ptr() as *const c_char, label.len(), context.as_ptr() as *const c_uchar, context.len(), )).map(|_| ()) } } /// Sets the session to be used. /// /// This should be called before the handshake to attempt to reuse a previously established Loading