File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -30,10 +30,6 @@ bool CryptoService::initialize()
3030 return false ;
3131 }
3232
33- // Initialize OpenSSL
34- OpenSSL_add_all_algorithms ();
35- ERR_load_crypto_strings ();
36-
3733 return true ;
3834}
3935
@@ -46,9 +42,6 @@ void CryptoService::cleanup()
4642 EVP_PKEY_free (static_cast <EVP_PKEY *>(signingPrivateKey));
4743 signingPrivateKey = nullptr ;
4844 }
49-
50- EVP_cleanup ();
51- ERR_free_strings ();
5245}
5346
5447bool CryptoService::generateOrLoadKeyPair (const std::string &keyFile)
Original file line number Diff line number Diff line change @@ -31,9 +31,15 @@ void NoiseService::cleanup()
3131 sessions.clear ();
3232
3333 // Clear OpenSSL
34- ERR_clear_error ();
35- EVP_cleanup ();
34+ CRYPTO_set_locking_callback (nullptr );
35+ CRYPTO_set_id_callback (nullptr );
36+
37+ ERR_remove_state (0 );
38+
3639 ERR_free_strings ();
40+ EVP_cleanup ();
41+
42+ CRYPTO_cleanup_all_ex_data ();
3743}
3844
3945std::shared_ptr<NoiseSession> NoiseService::createSession (const std::string &peerID, NoiseRole role)
You can’t perform that action at this time.
0 commit comments