Commit aa990652 authored by Andrew Huang's avatar Andrew Huang Committed by Facebook GitHub Bot

Migrate to new SSLSession API in NetworkObserverSessionInfoCallback

Summary: See title

Reviewed By: yfeldblum

Differential Revision: D22046592

fbshipit-source-id: 289828fbecb83e086d75156a8696541dd3f7f194
parent 97498b1a
......@@ -24,6 +24,7 @@
#include <folly/portability/Sockets.h>
#include <folly/portability/Unistd.h>
#include <folly/ssl/Init.h>
#include <folly/ssl/detail/OpenSSLSession.h>
namespace {
#ifdef OPENSSL_IS_BORINGSSL
......@@ -52,6 +53,21 @@ bool OpenSSLUtils::getTLSMasterKey(
return false;
}
bool OpenSSLUtils::getTLSMasterKey(
const std::shared_ptr<SSLSession> session,
MutableByteRange keyOut) {
auto openSSLSession =
std::dynamic_pointer_cast<folly::ssl::detail::OpenSSLSession>(session);
if (openSSLSession) {
auto rawSessionPtr = openSSLSession->getActiveSession();
SSL_SESSION* rawSession = rawSessionPtr.get();
if (rawSession) {
return OpenSSLUtils::getTLSMasterKey(rawSession, keyOut);
}
}
return false;
}
bool OpenSSLUtils::getTLSClientRandom(
const SSL* ssl,
MutableByteRange randomOut) {
......
......@@ -21,6 +21,7 @@
#include <folly/portability/OpenSSL.h>
#include <folly/portability/Sockets.h>
#include <folly/ssl/OpenSSLPtrTypes.h>
#include <folly/ssl/SSLSession.h>
namespace folly {
namespace ssl {
......@@ -39,6 +40,9 @@ class OpenSSLUtils {
static bool getTLSMasterKey(
const SSL_SESSION* session,
MutableByteRange keyOut);
static bool getTLSMasterKey(
const std::shared_ptr<SSLSession> session,
MutableByteRange keyOut);
/*
* Get the TLS Client Random used to generate the TLS key material
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment