[openssl/openssl] c48cff: Fix EVP_PKEY_dup() for ML-KEM keys (3.6)

"'openssl-machine' via openssl-commits" <[email protected]>
Newsgroups gmane.comp.encryption.openssl.cvs
Message-ID <openssl/openssl/push/refs/heads/openssl-3.6/[email protected]>
  Branch: refs/heads/openssl-3.6
  Home:   https://github.com/openssl/openssl
  Commit: c48cffc84e30ba22a58e69de13cf6a39388a7177
      https://github.com/openssl/openssl/commit/c48cffc84e30ba22a58e69de13cf6a39388a7177
  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.6)

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:06:14 2026
(Merged from https://github.com/openssl/openssl/pull/31256)


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

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

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

EVP_PKEY_fromdata for the LMS keymgmt accepted an OSSL_PARAM[] that
omits OSSL_PKEY_PARAM_PUB_KEY, returning success with an LMS_KEY
whose lms_params and ots_params remain NULL.  Without even basic
algorithm parameters (derived from the key content) the key is
malformed.

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:06:18 2026
(Merged from https://github.com/openssl/openssl/pull/31256)


  Commit: ac5a468e20eee0f230c131e180851c21107d523b
      https://github.com/openssl/openssl/commit/ac5a468e20eee0f230c131e180851c21107d523b
  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:
  -----------
  Clear unused seed when expanded key is chosen

The transient "seedbuf" value should not persist in keys that that are
loaded from the "expanded" form when "prefer_seed = no".

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


Compare: https://github.com/openssl/openssl/compare/9531b6f1c338...ac5a468e20ee

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.6/9531b6-ac5a46%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.