Merge remote-tracking branch 'purple/openssl' into fix-ntcp-threading-race

This commit is contained in:
Jeff Becker 2018-03-24 07:56:49 -04:00
commit ff5c26adf2
No known key found for this signature in database
GPG key ID: F357B3B42F6F9B05
25 changed files with 501 additions and 85 deletions

View file

@ -184,7 +184,7 @@ namespace transport
}
// TODO: check for number of pending keys
auto work = new NTCPWork{shared_from_this()};
m_Server.Work(work->session, [work]() -> std::function<void(void)> {
m_Server.Work(work->session, [work, this]() -> std::function<void(void)> {
if (!work->session->m_DHKeysPair)
work->session->m_DHKeysPair = transports.GetNextDHKeysPair ();
work->session->CreateAESKey (work->session->m_Establisher->phase1.pubKey);
@ -250,7 +250,7 @@ namespace transport
else
{
auto work = new NTCPWork{shared_from_this()};
m_Server.Work(work->session, [work]() -> std::function<void(void)> {
m_Server.Work(work->session, [work, this]() -> std::function<void(void)> {
work->session->CreateAESKey (work->session->m_Establisher->phase2.pubKey);
return std::bind(&NTCPSession::HandlePhase2, work->session, work);
});