]> git.ipfire.org Git - thirdparty/openssl.git/commit
Improved import and export
authorViktor Dukhovni <openssl-users@dukhovni.org>
Fri, 17 Jan 2025 16:28:51 +0000 (03:28 +1100)
committerTomas Mraz <tomas@openssl.org>
Fri, 14 Feb 2025 09:50:58 +0000 (10:50 +0100)
commit869903c07c56c8c44d4b7362fd56244e4de77d6b
tree931b9c5c5e8fcb912b5ef34663e4f43bba539817
parent9a79d4088fe8dae05ffe55714c554b55b69f2da9
Improved import and export

- On import, if a seed is provided, the keys are regenerated.

- The seed is exported as a separate "seed" parameter, when available.
  The "ml-kem.retain_seed" parameter is also exported, when false.

- The seed is optionally dropped after key generation.
    * When the "ml-kem.retain_seed" keygen parameter is set to zero.
    * When the "ml-kem.retain_seed" keygen parameter is not set to 1,
      and the "ml-kem.retain_seed" provider config property is set
      explictly false.

- The exported private key parameter "priv" is always the FIPS 203 |dk|.

- Private key decoding from PKCS#8 produces a transient "seed-only" form
  of the key, in which "retain_seed" is set to false when the
  "ml-kem.retain_seed" provider config property is set explictly false.
  The full key is generated during "load" and the seed is retained
  or not as specified.

- Import honours the "ml-kem.retain_seed" parameter when specified, or
  otherwise honours the provider's "ml-kem.retain_seed" property.

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26512)
12 files changed:
crypto/ml_kem/ml_kem.c
doc/man7/EVP_PKEY-ML-KEM.pod
include/crypto/ml_kem.h
providers/fips/self_test_kats.c
providers/implementations/encode_decode/decode_der2key.c
providers/implementations/encode_decode/encode_key2any.c
providers/implementations/encode_decode/encode_key2text.c
providers/implementations/keymgmt/ml_kem_kmgmt.c
test/evp_extra_test.c
test/evp_test.c
test/ml_kem_internal_test.c
util/perl/OpenSSL/paramnames.pm