[openssl/openssl] cd920f: ensure that ossl_obj_nid_lock is allocated before use

Neil Horman noreply at github.com
Wed Oct 18 14:55:18 UTC 2023


  Branch: refs/heads/master
  Home:   https://github.com/openssl/openssl
  Commit: cd920f8fa1bb603a620bea697027f5573fadc12e
      https://github.com/openssl/openssl/commit/cd920f8fa1bb603a620bea697027f5573fadc12e
  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)




More information about the openssl-commits mailing list