Don't call OPENSSL_init_crypto from inside a RUN_ONCE
authorMatt Caswell <matt@openssl.org>
Fri, 31 Mar 2023 09:35:32 +0000 (10:35 +0100)
committerTomas Mraz <tomas@openssl.org>
Tue, 4 Apr 2023 07:36:07 +0000 (09:36 +0200)
commita9745427cd5d44a76b31690b4a2c6bef2ee677c4
tree6313e4963b8d2fe5a540be9a8f57a656bb3f3328
parent6f8002014dda3f45aa864b38b92c2df7611af52e
Don't call OPENSSL_init_crypto from inside a RUN_ONCE

Calling OPENSSL_init_crypto from inside a RUN_ONCE seems like a bad idea.
This is especially bad if OPENSSL_init_crypto can recursively end up
attempting to call the RUN_ONCE that we're already inside.

The initialisation in OPENSSL_init_crypto is already "run once" protected.
There is no need to protect it "twice".

Fixes #20653

Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/20662)
crypto/objects/obj_dat.c