[openssl/openssl] 339bbc: ensure that ossl_obj_nid_lock is allocated before use
Neil Horman
noreply at github.com
Wed Oct 18 14:55:19 UTC 2023
Branch: refs/heads/openssl-3.1
Home: https://github.com/openssl/openssl
Commit: 339bbcd70c1d135b7cc064e2ce001bdb22fe702b
https://github.com/openssl/openssl/commit/339bbcd70c1d135b7cc064e2ce001bdb22fe702b
Author: Neil Horman <nhorman at openssl.org>
Date: 2023-10-18 (Wed, 18 Oct 2023)
Changed paths:
M crypto/objects/obj_dat.c
Log Message:
-----------
ensure that ossl_obj_nid_lock is allocated before use
external calls to OBJ_new_nid will fail on an attempt to lock the
ossl_obj_nid_lock as it won't have been initalized yet.
Bifurcate OBJ_new_nid into an external and internal variant, in which
the former calls ossl_obj_write_lock (ensuring that the nid_lock is
initalized), while OBJ_create (the sole internal caller) uses the latter
to avoid having to drop and re-acquire the lock
Fixes #22337
Reviewed-by: Matt Caswell <matt at openssl.org>
Reviewed-by: Tomas Mraz <tomas at openssl.org>
(Merged from https://github.com/openssl/openssl/pull/22350)
(cherry picked from commit cd920f8fa1bb603a620bea697027f5573fadc12e)
More information about the openssl-commits
mailing list