summaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorFabio Alessandrelli <fabio.alessandrelli@gmail.com>2023-04-11 15:39:07 +0200
committerFabio Alessandrelli <fabio.alessandrelli@gmail.com>2023-05-10 11:13:19 +0200
commit024a4b1f2adef73b081d7bf845501241e4693e6a (patch)
treefcef815ddd697260941845346865e89d149fcbf5 /modules
parentbee96aa5cb2e353cbbfc1cb346cf2c27e9748746 (diff)
downloadredot-engine-024a4b1f2adef73b081d7bf845501241e4693e6a.tar.gz
mbedTLS: disable weak crypto and TLS versions.
This commit adds a new mbedTLS configuration header to customize the built-in library (and can be optionally replaced by a platform-specific one). Currently, it disables most weak cryptographic functions (with the notable exceptions of MD5 and SHA-1), along with removing support for TLS versions 1.0 and 1.1 (making TLSv1.2 the only supported one).
Diffstat (limited to 'modules')
-rw-r--r--modules/mbedtls/SCsub4
-rw-r--r--modules/mbedtls/packet_peer_mbed_dtls.cpp1
2 files changed, 4 insertions, 1 deletions
diff --git a/modules/mbedtls/SCsub b/modules/mbedtls/SCsub
index 9133fdef35..7c1204d2b7 100644
--- a/modules/mbedtls/SCsub
+++ b/modules/mbedtls/SCsub
@@ -100,10 +100,14 @@ if env["builtin_mbedtls"]:
thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources]
env_mbed_tls.Prepend(CPPPATH=["#thirdparty/mbedtls/include/"])
+ env_mbed_tls.Append(
+ CPPDEFINES=[("MBEDTLS_CONFIG_FILE", '\\"thirdparty/mbedtls/include/godot_module_mbedtls_config.h\\"')]
+ )
env_thirdparty = env_mbed_tls.Clone()
env_thirdparty.disable_warnings()
env_thirdparty.add_source_files(thirdparty_obj, thirdparty_sources)
+ env_thirdparty.Depends(thirdparty_obj, "#thirdparty/mbedtls/include/godot_module_mbedtls_config.h")
env.modules_sources += thirdparty_obj
diff --git a/modules/mbedtls/packet_peer_mbed_dtls.cpp b/modules/mbedtls/packet_peer_mbed_dtls.cpp
index e8eb32f88d..ed1a97cc2c 100644
--- a/modules/mbedtls/packet_peer_mbed_dtls.cpp
+++ b/modules/mbedtls/packet_peer_mbed_dtls.cpp
@@ -29,7 +29,6 @@
/**************************************************************************/
#include "packet_peer_mbed_dtls.h"
-#include "mbedtls/platform_util.h"
#include "core/io/file_access.h"
#include "core/io/stream_peer_tls.h"