Remove old KDF initialisation
authorPauli <paul.dale@oracle.com>
Tue, 20 Aug 2019 22:04:27 +0000 (08:04 +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)

crypto/evp/c_allkdf.c [deleted file]
crypto/init.c
include/openssl/crypto.h

diff --git a/crypto/evp/c_allkdf.c b/crypto/evp/c_allkdf.c
deleted file mode 100644 (file)
index 860c11c..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Copyright 2019 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-#include <openssl/evp.h>
-#include "internal/evp_int.h"
-
-void openssl_add_all_kdfs_int(void)
-{
-    EVP_add_kdf(&pbkdf2_kdf_meth);
-#ifndef OPENSSL_NO_SCRYPT
-    EVP_add_kdf(&scrypt_kdf_meth);
-#endif
-    EVP_add_kdf(&tls1_prf_kdf_meth);
-    EVP_add_kdf(&hkdf_kdf_meth);
-    EVP_add_kdf(&sshkdf_kdf_meth);
-    EVP_add_kdf(&ss_kdf_meth);
-    EVP_add_kdf(&x963_kdf_meth);
-#ifndef OPENSSL_NO_CMS
-    EVP_add_kdf(&x942_kdf_meth);
-#endif
-}
index d4da7b27e34bb989d6e0767166b541fcc8e6be34..36c63338777501d416ba7c38171270978ff3273b 100644 (file)
@@ -225,26 +225,6 @@ DEFINE_RUN_ONCE_STATIC_ALT(ossl_init_no_add_all_digests,
     return 1;
 }
 
-static CRYPTO_ONCE add_all_kdfs = CRYPTO_ONCE_STATIC_INIT;
-DEFINE_RUN_ONCE_STATIC(ossl_init_add_all_kdfs)
-{
-    /*
-     * OPENSSL_NO_AUTOALGINIT is provided here to prevent at compile time
-     * pulling in all the macs during static linking
-     */
-#ifndef OPENSSL_NO_AUTOALGINIT
-    OSSL_TRACE(INIT, "openssl_add_all_kdfs_int()\n");
-    openssl_add_all_kdfs_int();
-#endif
-    return 1;
-}
-
-DEFINE_RUN_ONCE_STATIC_ALT(ossl_init_no_add_all_kdfs, ossl_init_add_all_kdfs)
-{
-    /* Do nothing */
-    return 1;
-}
-
 static CRYPTO_ONCE config = CRYPTO_ONCE_STATIC_INIT;
 static int config_inited = 0;
 static const OPENSSL_INIT_SETTINGS *conf_settings = NULL;
@@ -537,15 +517,6 @@ int OPENSSL_init_crypto(uint64_t opts, const OPENSSL_INIT_SETTINGS *settings)
             && !RUN_ONCE(&add_all_digests, ossl_init_add_all_digests))
         return 0;
 
-    if ((opts & OPENSSL_INIT_NO_ADD_ALL_KDFS)
-            && !RUN_ONCE_ALT(&add_all_kdfs, ossl_init_no_add_all_kdfs,
-                             ossl_init_add_all_kdfs))
-        return 0;
-
-    if ((opts & OPENSSL_INIT_ADD_ALL_KDFS)
-            && !RUN_ONCE(&add_all_kdfs, ossl_init_add_all_kdfs))
-        return 0;
-
     if ((opts & OPENSSL_INIT_ATFORK)
             && !openssl_init_fork_handlers())
         return 0;
index da62eef1b142ad3c1cf79469a4abd90eb6cb9ea4..60aca02849bde0da1529b11cff6ebbf64e57e7e9 100644 (file)
@@ -408,8 +408,8 @@ int CRYPTO_memcmp(const void * in_a, const void * in_b, size_t len);
 /* OPENSSL_INIT flag range 0x03f00000 reserved for OPENSSL_init_ssl() */
 /* FREE: 0x04000000L */
 /* FREE: 0x08000000L */
-# define OPENSSL_INIT_NO_ADD_ALL_KDFS        0x10000000L
-# define OPENSSL_INIT_ADD_ALL_KDFS           0x20000000L
+/* FREE: 0x10000000L */
+/* FREE: 0x20000000L */
 /* FREE: 0x40000000L */
 /* FREE: 0x80000000L */
 /* Max OPENSSL_INIT flag value is 0x80000000 */