[openssl/openssl] 24d208: test-rng: handle nonce length query in generate mode

"'Jakub Zelenka' via openssl-commits" <[email protected]> Fri, 10 Jul 2026 08:48:33 -0700
Newsgroups gmane.comp.encryption.openssl.cvs
Message-ID <openssl/openssl/push/refs/heads/master/[email protected]>
  Branch: refs/heads/master
  Home:   https://github.com/openssl/openssl
  Commit: 24d208262acba826724860c568160cb04367068f
      https://github.com/openssl/openssl/commit/24d208262acba826724860c568160cb04367068f
  Author: Jakub Zelenka <[email protected]>
  Date:   2026-07-10 (Fri, 10 Jul 2026)

  Changed paths:
    M providers/implementations/rands/test_rng.c

  Log Message:
  -----------
  test-rng: handle nonce length query in generate mode

The DRBG instantiation probes the parent nonce callback with a NULL
output buffer to obtain the nonce length before requesting the actual
nonce.  The generate mode branch of test_rng_nonce() wrote the bytes
without checking the output pointer, crashing when TEST-RAND with
generate=1 is used as a DRBG parent.  The entropy-buffer branch already
handles a NULL output correctly.

Assisted-by: Claude:claude-fable-5

Reviewed-by: Paul Dale <[email protected]>
Reviewed-by: Nikola Pajkovsky <[email protected]>
MergeDate: Fri Jul 10 15:47:15 2026
(Merged from https://github.com/openssl/openssl/pull/31885)


  Commit: 171e4e7eb64f243f78a1040f725ed80a31df7702
      https://github.com/openssl/openssl/commit/171e4e7eb64f243f78a1040f725ed80a31df7702
  Author: Jakub Zelenka <[email protected]>
  Date:   2026-07-10 (Fri, 10 Jul 2026)

  Changed paths:
    M test/rand_test.c

  Log Message:
  -----------
  rand: add mfail tests for generation and seeding

Add memory-failure injection coverage to rand_test for the full
RAND_bytes_ex/RAND_priv_bytes_ex stack on a fresh library context, the
SEED-SRC entropy acquisition and the CTR-DRBG operations with a
TEST-RAND parent.  The cipher fetches used by the DRBG setup are warmed
up outside the injection window so that the injection targets the RAND
machinery itself.

Assisted-by: Claude:claude-fable-5

Reviewed-by: Paul Dale <[email protected]>
Reviewed-by: Nikola Pajkovsky <[email protected]>
MergeDate: Fri Jul 10 15:47:16 2026
(Merged from https://github.com/openssl/openssl/pull/31885)


Compare: https://github.com/openssl/openssl/compare/3bf2aba5f5e2...171e4e7eb64f

To unsubscribe from these emails, change your notification settings at https://github.com/openssl/openssl/settings/notifications

-- 
You received this message because you are subscribed to the Google Groups "openssl-commits" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion visit https://groups.google.com/a/openssl.org/d/msgid/openssl-commits/openssl/openssl/push/refs/heads/master/3bf2ab-171e4e%40github.com.