Clear OpenSSL errors after init.

GitOrigin-RevId: 0e74ffdada6d568645aef6496df3498e0638bbc0
This commit is contained in:
levlam 2020-06-06 21:35:09 +03:00
parent ed615430e1
commit 3788cd28f9

View File

@ -134,11 +134,13 @@ uint64 pq_factorize(uint64 pq) {
void init_crypto() { void init_crypto() {
static bool is_inited = [] { static bool is_inited = [] {
#if OPENSSL_VERSION_NUMBER >= 0x10100000L #if OPENSSL_VERSION_NUMBER >= 0x10100000L
return OPENSSL_init_crypto(0, nullptr) != 0; bool result = OPENSSL_init_crypto(0, nullptr) != 0;
#else #else
OpenSSL_add_all_algorithms(); OpenSSL_add_all_algorithms();
return true; bool result = true;
#endif #endif
clear_openssl_errors("Init crypto");
return result;
}(); }();
CHECK(is_inited); CHECK(is_inited);
} }