mirror of
https://github.com/OpenNebula/one.git
synced 2026-12-03 21:52:31 +09:00
Co-authored-by: Ruben S. Montero <rsmontero@opennebula.org>
(cherry picked from commit 5966e8d60d)
This commit is contained in:
1 parent
1802eaf99e
commit
78ac891f7b
1 file changed
+6
@@ -255,6 +255,9 @@ namespace ssl_util
|
||||
int rsa_public_encrypt(const std::string& in, std::string& out)
|
||||
{
|
||||
static RSA * rsa = nullptr;
|
||||
static std::mutex m;
|
||||
|
||||
std::lock_guard lock(m);
|
||||
|
||||
if ( rsa == nullptr) //initialize RSA structure
|
||||
{
|
||||
@@ -297,6 +300,9 @@ namespace ssl_util
|
||||
int rsa_private_decrypt(const std::string& in, std::string& out)
|
||||
{
|
||||
static RSA * rsa = nullptr;
|
||||
static std::mutex m;
|
||||
|
||||
std::lock_guard lock(m);
|
||||
|
||||
if ( rsa == nullptr) //initialize RSA structure
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user