[openssl/openssl] f53479: Optimise locking in rsa_get_blinding()

Matt Caswell noreply at github.com
Tue May 30 16:48:02 UTC 2023


  Branch: refs/heads/master
  Home:   https://github.com/openssl/openssl
  Commit: f53479f98a2f2a6149192c5e3ef4ddf0926dceba
      https://github.com/openssl/openssl/commit/f53479f98a2f2a6149192c5e3ef4ddf0926dceba
  Author: Matt Caswell <matt at openssl.org>
  Date:   2023-05-30 (Tue, 30 May 2023)

  Changed paths:
    M crypto/rsa/rsa_ossl.c

  Log Message:
  -----------
  Optimise locking in rsa_get_blinding()

We optimise locking in rsa_get_blinding() so that we normally take a
read lock, and only fallback to a write lock if we need to. This will
be very slightly slower in the case of single use RSA objects, but should
be significantly better when an RSA object is reused in a multi-threaded
environment. It's probably worth the trade off.

Partially fixes #20286

Reviewed-by: Tomas Mraz <tomas at openssl.org>
Reviewed-by: Paul Dale <pauli at openssl.org>
(Merged from https://github.com/openssl/openssl/pull/20953)




More information about the openssl-commits mailing list