mirror of
https://github.com/OpenNebula/one.git
synced 2025-03-23 22:50:09 +03:00
Co-authored-by: Ruben S. Montero <rsmontero@opennebula.org> (cherry picked from commit 5966e8d60def2d8a20f6e0ad5669f78800115104)
This commit is contained in:
parent
edcf221e64
commit
92a6150105
@ -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
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user