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

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


  Branch: refs/heads/openssl-3.1
  Home:   https://github.com/openssl/openssl
  Commit: 5fc987234060dccaf411c66cfe7aa25d0ad4d244
      https://github.com/openssl/openssl/commit/5fc987234060dccaf411c66cfe7aa25d0ad4d244
  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