From 5eb43d382b3eb3fb6950cc8e0dce82886e23e984 Mon Sep 17 00:00:00 2001 From: Pauli Date: Wed, 21 Aug 2019 08:00:12 +1000 Subject: [PATCH] Move KDFs to the provider. Reviewed-by: Richard Levitte (Merged from https://github.com/openssl/openssl/pull/9662) --- providers/common/kdfs/build.info | 13 +++++++++++++ {crypto/kdf => providers/common/kdfs}/hkdf.c | 0 {crypto/kdf => providers/common/kdfs}/pbkdf2.c | 0 {crypto/kdf => providers/common/kdfs}/scrypt.c | 0 {crypto/kdf => providers/common/kdfs}/sshkdf.c | 0 {crypto/kdf => providers/common/kdfs}/sskdf.c | 0 {crypto/kdf => providers/common/kdfs}/tls1_prf.c | 2 ++ {crypto/kdf => providers/common/kdfs}/x942kdf.c | 0 8 files changed, 15 insertions(+) create mode 100644 providers/common/kdfs/build.info rename {crypto/kdf => providers/common/kdfs}/hkdf.c (100%) rename {crypto/kdf => providers/common/kdfs}/pbkdf2.c (100%) rename {crypto/kdf => providers/common/kdfs}/scrypt.c (100%) rename {crypto/kdf => providers/common/kdfs}/sshkdf.c (100%) rename {crypto/kdf => providers/common/kdfs}/sskdf.c (100%) rename {crypto/kdf => providers/common/kdfs}/tls1_prf.c (98%) rename {crypto/kdf => providers/common/kdfs}/x942kdf.c (100%) diff --git a/providers/common/kdfs/build.info b/providers/common/kdfs/build.info new file mode 100644 index 0000000000..422cf7471e --- /dev/null +++ b/providers/common/kdfs/build.info @@ -0,0 +1,13 @@ +$COMMON=tls1_prf.c hkdf.c scrypt.c pbkdf2.c sskdf.c + +LIBS=../../../libcrypto +SOURCE[../../../libcrypto]=$COMMON sshkdf.c x942kdf.c +INCLUDE[../../../libcrypto]=. ../../../crypto + +IF[{- !$disabled{fips} -}] + MODULES=../../fips + SOURCE[../../fips]=$COMMON + INCLUDE[../../fips]=. ../../../crypto +ENDIF + + diff --git a/crypto/kdf/hkdf.c b/providers/common/kdfs/hkdf.c similarity index 100% rename from crypto/kdf/hkdf.c rename to providers/common/kdfs/hkdf.c diff --git a/crypto/kdf/pbkdf2.c b/providers/common/kdfs/pbkdf2.c similarity index 100% rename from crypto/kdf/pbkdf2.c rename to providers/common/kdfs/pbkdf2.c diff --git a/crypto/kdf/scrypt.c b/providers/common/kdfs/scrypt.c similarity index 100% rename from crypto/kdf/scrypt.c rename to providers/common/kdfs/scrypt.c diff --git a/crypto/kdf/sshkdf.c b/providers/common/kdfs/sshkdf.c similarity index 100% rename from crypto/kdf/sshkdf.c rename to providers/common/kdfs/sshkdf.c diff --git a/crypto/kdf/sskdf.c b/providers/common/kdfs/sskdf.c similarity index 100% rename from crypto/kdf/sskdf.c rename to providers/common/kdfs/sskdf.c diff --git a/crypto/kdf/tls1_prf.c b/providers/common/kdfs/tls1_prf.c similarity index 98% rename from crypto/kdf/tls1_prf.c rename to providers/common/kdfs/tls1_prf.c index edd7f05ce0..3c553e8900 100644 --- a/crypto/kdf/tls1_prf.c +++ b/providers/common/kdfs/tls1_prf.c @@ -125,6 +125,8 @@ static int kdf_tls1_prf_ctrl(EVP_KDF_IMPL *impl, int cmd, va_list args) impl->seclen = len; return 1; + /* TODO: This is only ever called from pkey_kdf and only as part of setting the TLS secret + consider merging the twe two?? */ case EVP_KDF_CTRL_RESET_TLS_SEED: OPENSSL_cleanse(impl->seed, impl->seedlen); impl->seedlen = 0; diff --git a/crypto/kdf/x942kdf.c b/providers/common/kdfs/x942kdf.c similarity index 100% rename from crypto/kdf/x942kdf.c rename to providers/common/kdfs/x942kdf.c -- 2.40.0