diff --git a/common/sodcrypto.cc b/common/sodcrypto.cc index 685be5b2..573e499a 100644 --- a/common/sodcrypto.cc +++ b/common/sodcrypto.cc @@ -84,7 +84,7 @@ std::string sodEncryptSym(const std::string& msg, const std::string& key, Sodium int len; int ciphertext_len; // Each thread gets its own cipher context - thread_local auto ctx = std::unique_ptr(nullptr, EVP_CIPHER_CTX_free);; + static thread_local auto ctx = std::unique_ptr(nullptr, EVP_CIPHER_CTX_free); if (key.length() != CHACHA20_POLY1305_KEY_SIZE) { ostringstream err; @@ -126,7 +126,7 @@ std::string sodDecryptSym(const std::string& msg, const std::string& key, Sodium int len; int plaintext_len; // Each thread gets its own cipher context - thread_local auto ctx = std::unique_ptr(nullptr, EVP_CIPHER_CTX_free);; + static thread_local auto ctx = std::unique_ptr(nullptr, EVP_CIPHER_CTX_free); if (key.length() != CHACHA20_POLY1305_KEY_SIZE) { ostringstream err;