[openssl/openssl] 8d8905: validate requested key length in kdf_pbkdf1_do_derive

Neil Horman noreply at github.com
Wed Jan 3 15:21:48 UTC 2024


  Branch: refs/heads/master
  Home:   https://github.com/openssl/openssl
  Commit: 8d89050f0f676b429043fd5445e5a570d54ad225
      https://github.com/openssl/openssl/commit/8d89050f0f676b429043fd5445e5a570d54ad225
  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)




More information about the openssl-commits mailing list