提交 2f881d2d 编写于 作者: R Richard Levitte

Fix rand_lib.c for no-engine configuration

When configured no-engine, we still refered to rand_engine_lock.
Rework the lock init code to avoid that.
Reviewed-by: NMatt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/3145)
上级 a273157a
......@@ -26,11 +26,14 @@ static CRYPTO_ONCE rand_lock_init = CRYPTO_ONCE_STATIC_INIT;
DEFINE_RUN_ONCE_STATIC(do_rand_lock_init)
{
int ret = 1;
#ifndef OPENSSL_NO_ENGINE
rand_engine_lock = CRYPTO_THREAD_lock_new();
ret &= rand_engine_lock != NULL;
#endif
rand_meth_lock = CRYPTO_THREAD_lock_new();
return rand_engine_lock != NULL && rand_meth_lock != NULL;
ret &= rand_meth_lock != NULL;
return ret;
}
int RAND_set_rand_method(const RAND_METHOD *meth)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册