From 89d69a5d5a61865edeb53a6cb3691b0dce67d327 Mon Sep 17 00:00:00 2001 From: orignal Date: Thu, 10 Nov 2016 18:38:29 -0500 Subject: [PATCH] rollback due the race condition --- Crypto.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Crypto.cpp b/Crypto.cpp index 42514857..c70b62ef 100644 --- a/Crypto.cpp +++ b/Crypto.cpp @@ -270,10 +270,9 @@ namespace crypto { if (m_IsUpdated) { - const BIGNUM * priv_key, * pub_key; - DH_get0_key (m_DH, &pub_key, &priv_key); - bn2buf (pub_key, m_PublicKey, 256); - DH_set0_key (m_DH, NULL, NULL); + // TODO: seems race condition here + bn2buf (m_DH->pub_key, m_PublicKey, 256); + BN_free (m_DH->pub_key); m_DH->pub_key = NULL; m_IsUpdated= false; } return m_PublicKey;