Commit 5bcc6534 authored by Awdhesh Mathpal's avatar Awdhesh Mathpal
Browse files

extms_support: Handle case when handshake is in progress

parent 38664185
Loading
Loading
Loading
Loading
+9 −2
Original line number Diff line number Diff line
@@ -3112,12 +3112,19 @@ impl SslRef {

    /// Determines if current session used Extended Master Secret
    ///
    /// Returns `None` if the handshake is still in-progress.
    ///
    /// This corresponds to [`SSL_get_extms_support`].
    ///
    /// [`SSL_get_extms_support`]: https://www.openssl.org/docs/man1.1.1/man3/SSL_get_extms_support.html
    #[cfg(ossl110)]
    pub fn extms_support(&self) -> bool {
        unsafe { ffi::SSL_get_extms_support(self.as_ptr()) != 0 }
    pub fn extms_support(&self) -> Option<bool> {
        unsafe {
            match ffi::SSL_get_extms_support(self.as_ptr()) {
                -1 => None,
                ret => Some(ret != 0),
            }
        }
    }

    /// Returns the server's OCSP response, if present.