[openssl/openssl] 0b3638: 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.1
  Home:   https://github.com/openssl/openssl
  Commit: 0b36386633b8b875de74313abe91ac1c48a06a8e
      https://github.com/openssl/openssl/commit/0b36386633b8b875de74313abe91ac1c48a06a8e
  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