[openssl/openssl] b2c6a2: Erase temporary buffer in EVP_PKEY_get_bn_param()

Anatolii Lishchynskyi noreply at github.com
Tue Apr 4 10:08:37 UTC 2023


  Branch: refs/heads/openssl-3.0
  Home:   https://github.com/openssl/openssl
  Commit: b2c6a24aefb8d3fd5f71f3e0c09528341088b1d2
      https://github.com/openssl/openssl/commit/b2c6a24aefb8d3fd5f71f3e0c09528341088b1d2
  Author: Anatolii Lishchynskyi <iamnotacake at protonmail.com>
  Date:   2023-04-04 (Tue, 04 Apr 2023)

  Changed paths:
    M crypto/evp/p_lib.c

  Log Message:
  -----------
  Erase temporary buffer in EVP_PKEY_get_bn_param()

Function EVP_PKEY_get_bn_param() uses temporary buffer (on stack or
heap allocated) to store serialized bignum, but after deserializing it
into BIGNUM*, the buffer is not erased and may contain sensitive data.

This change makes sure the buffer is erased if it was successfully
filled before. Unfortunately, it does not distinguish between public and
private key components, and will always erase the buffer.

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

(cherry picked from commit 34e4a962bca998cc2d6eb4be721153fbde2f4c35)




More information about the openssl-commits mailing list