[openssl/openssl] 9b9c38: Fix EVP_PKEY_dup() for ML-KEM keys (3.5)

"'openssl-machine' via openssl-commits" <[email protected]>
Newsgroups gmane.comp.encryption.openssl.cvs
Message-ID <openssl/openssl/push/refs/heads/openssl-3.5/[email protected]>
  Branch: refs/heads/openssl-3.5
  Home:   https://github.com/openssl/openssl
  Commit: 9b9c3886b22d57d428a481ae22cafeca525ca67f
      https://github.com/openssl/openssl/commit/9b9c3886b22d57d428a481ae22cafeca525ca67f
  Author: Viktor Dukhovni <[email protected]>
  Date:   2026-06-25 (Thu, 25 Jun 2026)

  Changed paths:
    M crypto/ml_kem/ml_kem.c
    M test/endecode_test.c

  Log Message:
  -----------
  Fix EVP_PKEY_dup() for ML-KEM keys (3.5)

ossl_ml_kem_key_dup() left the (PUB|PRIV) selection case
unhandled, so EVP_PKEY_dup() silently returned NULL for
ML-KEM-512/768/1024.  add_storage() also zeroed the duplicated
rho_pkhash, leaving the dup unequal to the original.

Add a parameterised dup sweep to test/endecode_test.c covering
every supported public-key algorithm in three shapes: full
keypair, public-only, and embryonic (parameters-only).

While here, stop endecode_test from silently passing when key
generation fails: setup_tests() now returns its accumulated
status, MAKE_*KEYS no longer short-circuits, and each
ADD_TEST_SUITE is now conditional on keygen success.  Guard the
explicit-EC-curve tests with OPENSSL_NO_EC_EXPLICIT_CURVES.

Reviewed-by: Nikola Pajkovsky <[email protected]>
Reviewed-by: Bob Beck <[email protected]>
MergeDate: Thu Jun 25 02:09:47 2026
(Merged from https://github.com/openssl/openssl/pull/31253)


  Commit: f9ba3e7cc508cd506b152b3addde72090a9c8b54
      https://github.com/openssl/openssl/commit/f9ba3e7cc508cd506b152b3addde72090a9c8b54
  Author: Viktor Dukhovni <[email protected]>
  Date:   2026-06-25 (Thu, 25 Jun 2026)

  Changed paths:
    M crypto/dh/dh_check.c
    M test/endecode_test.c

  Log Message:
  -----------
  DH: harden empty fromdata

EVP_PKEY_fromdata for DH/DHX accepts an empty array and yields a
DH with NULL params.p / params.g.  Several DH check entry points
(DH_check, DH_check_params, DH_check_pub_key) then read
dh->params.p / .g via BN_num_bits or BN_is_odd before any NULL
check.  Add defensive guards at the top of each that report
failure via *ret without dereferencing NULL; the existing
return-1-with-flags contract is preserved.

A new test_fromdata in endecode_test drives every supported
keymgmt with an empty OSSL_PARAM[] for both EVP_PKEY_PUBLIC_KEY
and EVP_PKEY_KEYPAIR selections, and tests that any returned key
is sufficiently well behaved.

Reviewed-by: Nikola Pajkovsky <[email protected]>
Reviewed-by: Bob Beck <[email protected]>
MergeDate: Thu Jun 25 02:09:51 2026
(Merged from https://github.com/openssl/openssl/pull/31253)


Compare: https://github.com/openssl/openssl/compare/948b17002e14...f9ba3e7cc508

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/openssl-3.5/948b17-f9ba3e%40github.com.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.