Move KDFs to the provider.
authorPauli <paul.dale@oracle.com>
Tue, 20 Aug 2019 22:00:12 +0000 (08:00 +1000)
committerPauli <paul.dale@oracle.com>
Fri, 6 Sep 2019 09:27:57 +0000 (19:27 +1000)
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/9662)

providers/common/kdfs/build.info [new file with mode: 0644]
providers/common/kdfs/hkdf.c [moved from crypto/kdf/hkdf.c with 100% similarity]
providers/common/kdfs/pbkdf2.c [moved from crypto/kdf/pbkdf2.c with 100% similarity]
providers/common/kdfs/scrypt.c [moved from crypto/kdf/scrypt.c with 100% similarity]
providers/common/kdfs/sshkdf.c [moved from crypto/kdf/sshkdf.c with 100% similarity]
providers/common/kdfs/sskdf.c [moved from crypto/kdf/sskdf.c with 100% similarity]
providers/common/kdfs/tls1_prf.c [moved from crypto/kdf/tls1_prf.c with 98% similarity]
providers/common/kdfs/x942kdf.c [moved from crypto/kdf/x942kdf.c with 100% similarity]

diff --git a/providers/common/kdfs/build.info b/providers/common/kdfs/build.info
new file mode 100644 (file)
index 0000000..422cf74
--- /dev/null
@@ -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
+
+        
similarity index 98%
rename from crypto/kdf/tls1_prf.c
rename to providers/common/kdfs/tls1_prf.c
index edd7f05..3c553e8 100644 (file)
@@ -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;