[openssl/openssl] 12fe0d: validate requested key length in kdf_pbkdf1_do_derive

Neil Horman noreply at github.com
Wed Jan 3 15:22:53 UTC 2024


  Branch: refs/heads/openssl-3.2
  Home:   https://github.com/openssl/openssl
  Commit: 12fe0d59581b1760723531b064ab1b66b9bc50a7
      https://github.com/openssl/openssl/commit/12fe0d59581b1760723531b064ab1b66b9bc50a7
  Author: Neil Horman <nhorman at openssl.org>
  Date:   2024-01-03 (Wed, 03 Jan 2024)

  Changed paths:
    M providers/implementations/kdfs/pbkdf1.c
    M test/evp_kdf_test.c

  Log Message:
  -----------
  validate requested key length in kdf_pbkdf1_do_derive

When using pbkdf1 key deriviation, it is possible to request a key
length larger than the maximum digest size a given digest can produce,
leading to a read of random stack memory.

fix it by returning an error if the requested key size n is larger than
the EVP_MD_size of the digest

Reviewed-by: Tomas Mraz <tomas at openssl.org>
Reviewed-by: Matt Caswell <matt at openssl.org>
(Merged from https://github.com/openssl/openssl/pull/23174)

(cherry picked from commit 8d89050f0f676b429043fd5445e5a570d54ad225)




More information about the openssl-commits mailing list