Browse Source

Move CryptoCore to it's own folder.

Crypto classes will be placed in core/crypto.
Fabio Alessandrelli 6 years ago
parent
commit
c19871af6d

+ 1 - 0
core/SCsub

@@ -159,6 +159,7 @@ env.CommandNoCache('#core/license.gen.h', ["../COPYRIGHT.txt", "../LICENSE.txt"]
 # Chain load SCsubs
 SConscript('os/SCsub')
 SConscript('math/SCsub')
+SConscript('crypto/SCsub')
 SConscript('io/SCsub')
 SConscript('bind/SCsub')
 

+ 1 - 1
core/bind/core_bind.cpp

@@ -30,11 +30,11 @@
 
 #include "core_bind.h"
 
+#include "core/crypto/crypto_core.h"
 #include "core/io/file_access_compressed.h"
 #include "core/io/file_access_encrypted.h"
 #include "core/io/json.h"
 #include "core/io/marshalls.h"
-#include "core/math/crypto_core.h"
 #include "core/math/geometry.h"
 #include "core/os/keyboard.h"
 #include "core/os/os.h"

+ 0 - 0
core/math/crypto_core.cpp → core/crypto/crypto_core.cpp


+ 0 - 0
core/math/crypto_core.h → core/crypto/crypto_core.h


+ 1 - 1
core/io/file_access_encrypted.cpp

@@ -30,7 +30,7 @@
 
 #include "file_access_encrypted.h"
 
-#include "core/math/crypto_core.h"
+#include "core/crypto/crypto_core.h"
 #include "core/os/copymem.h"
 #include "core/print_string.h"
 #include "core/variant.h"

+ 1 - 32
core/math/SCsub

@@ -2,37 +2,6 @@
 
 Import('env')
 
-env_math = env.Clone() # Maybe make one specific for crypto?
-
-is_builtin = env["builtin_mbedtls"]
-has_module = env["module_mbedtls_enabled"]
-
-if is_builtin or not has_module:
-    # Use our headers for builtin or if the module is not going to be compiled.
-    # We decided not to depend on system mbedtls just for these few files that can
-    # be easily extracted.
-    env_math.Prepend(CPPPATH=["#thirdparty/mbedtls/include"])
-
-# MbedTLS core functions (for CryptoCore).
-# If the mbedtls module is compiled we don't need to add the .c files with our
-# custom config since they will be built by the module itself.
-# Only if the module is not enabled, we must compile here the required sources
-# to make a "light" build with only the necessary mbedtls files.
-if not has_module:
-    env_thirdparty = env_math.Clone()
-    env_thirdparty.disable_warnings()
-    # Custom config file
-    env_thirdparty.Append(CPPDEFINES=[('MBEDTLS_CONFIG_FILE', '\\"thirdparty/mbedtls/include/godot_core_mbedtls_config.h\\"')])
-    thirdparty_mbedtls_dir = "#thirdparty/mbedtls/library/"
-    thirdparty_mbedtls_sources = [
-        "aes.c",
-        "base64.c",
-        "md5.c",
-        "sha1.c",
-        "sha256.c",
-        "godot_core_mbedtls_platform.c"
-    ]
-    thirdparty_mbedtls_sources = [thirdparty_mbedtls_dir + file for file in thirdparty_mbedtls_sources]
-    env_thirdparty.add_source_files(env.core_sources, thirdparty_mbedtls_sources)
+env_math = env.Clone()
 
 env_math.add_source_files(env.core_sources, "*.cpp")

+ 1 - 1
core/os/file_access.cpp

@@ -30,9 +30,9 @@
 
 #include "file_access.h"
 
+#include "core/crypto/crypto_core.h"
 #include "core/io/file_access_pack.h"
 #include "core/io/marshalls.h"
-#include "core/math/crypto_core.h"
 #include "core/os/os.h"
 #include "core/project_settings.h"
 

+ 1 - 1
core/ustring.cpp

@@ -31,7 +31,7 @@
 #include "ustring.h"
 
 #include "core/color.h"
-#include "core/math/crypto_core.h"
+#include "core/crypto/crypto_core.h"
 #include "core/math/math_funcs.h"
 #include "core/os/memory.h"
 #include "core/print_string.h"

+ 1 - 1
core/variant_call.cpp

@@ -32,8 +32,8 @@
 
 #include "core/color_names.inc"
 #include "core/core_string_names.h"
+#include "core/crypto/crypto_core.h"
 #include "core/io/compression.h"
-#include "core/math/crypto_core.h"
 #include "core/object.h"
 #include "core/os/os.h"
 #include "core/script_language.h"

+ 1 - 1
editor/editor_export.cpp

@@ -30,11 +30,11 @@
 
 #include "editor_export.h"
 
+#include "core/crypto/crypto_core.h"
 #include "core/io/config_file.h"
 #include "core/io/resource_loader.h"
 #include "core/io/resource_saver.h"
 #include "core/io/zip_io.h"
-#include "core/math/crypto_core.h"
 #include "core/os/dir_access.h"
 #include "core/os/file_access.h"
 #include "core/project_settings.h"

+ 1 - 1
editor/import/editor_scene_importer_gltf.cpp

@@ -29,8 +29,8 @@
 /*************************************************************************/
 
 #include "editor_scene_importer_gltf.h"
+#include "core/crypto/crypto_core.h"
 #include "core/io/json.h"
-#include "core/math/crypto_core.h"
 #include "core/math/math_defs.h"
 #include "core/os/file_access.h"
 #include "core/os/os.h"

+ 1 - 1
modules/websocket/wsl_peer.cpp

@@ -35,7 +35,7 @@
 #include "wsl_client.h"
 #include "wsl_server.h"
 
-#include "core/math/crypto_core.h"
+#include "core/crypto/crypto_core.h"
 #include "core/math/random_number_generator.h"
 #include "core/os/os.h"
 

+ 1 - 1
platform/uwp/export/export.cpp

@@ -30,9 +30,9 @@
 
 #include "export.h"
 #include "core/bind/core_bind.h"
+#include "core/crypto/crypto_core.h"
 #include "core/io/marshalls.h"
 #include "core/io/zip_io.h"
-#include "core/math/crypto_core.h"
 #include "core/object.h"
 #include "core/os/dir_access.h"
 #include "core/os/file_access.h"