summaryrefslogtreecommitdiffstats
path: root/modules/mbedtls
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2023-06-13 16:56:21 +0200
committerRémi Verschelde <rverschelde@gmail.com>2023-06-15 14:35:45 +0200
commit25b2f1780a9c7d7ae5579cc87c89b0c7e2baa14d (patch)
tree40d2d50d34c175da3b7c5123e8918cc5816bd32b /modules/mbedtls
parent773414606079fa745d1c37fce49324ab6a09e972 (diff)
downloadredot-engine-25b2f1780a9c7d7ae5579cc87c89b0c7e2baa14d.tar.gz
Style: Harmonize header includes in modules
This applies our existing style guide, and adds a new rule to that style guide for modular components such as platform ports and modules: Includes from the platform port or module ("local" includes) should be listed first in their own block using relative paths, before Godot's "core" includes which use "absolute" (project folder relative) paths, and finally thirdparty includes. Includes in `#ifdef`s come after their relevant section, i.e. the overall structure is: - Local includes * Conditional local includes - Core includes * Conditional core includes - Thirdparty includes * Conditional thirdparty includes
Diffstat (limited to 'modules/mbedtls')
-rw-r--r--modules/mbedtls/crypto_mbedtls.cpp10
-rw-r--r--modules/mbedtls/dtls_server_mbedtls.cpp1
-rw-r--r--modules/mbedtls/dtls_server_mbedtls.h3
-rw-r--r--modules/mbedtls/packet_peer_mbed_dtls.h3
-rw-r--r--modules/mbedtls/stream_peer_mbedtls.h3
-rw-r--r--modules/mbedtls/tests/test_crypto_mbedtls.cpp3
-rw-r--r--modules/mbedtls/tls_context_mbedtls.h1
7 files changed, 14 insertions, 10 deletions
diff --git a/modules/mbedtls/crypto_mbedtls.cpp b/modules/mbedtls/crypto_mbedtls.cpp
index 68b213d79e..50a6909d1a 100644
--- a/modules/mbedtls/crypto_mbedtls.cpp
+++ b/modules/mbedtls/crypto_mbedtls.cpp
@@ -30,25 +30,25 @@
#include "crypto_mbedtls.h"
-#include "core/io/file_access.h"
-
#include "core/config/engine.h"
#include "core/config/project_settings.h"
#include "core/io/certs_compressed.gen.h"
#include "core/io/compression.h"
+#include "core/io/file_access.h"
#include "core/os/os.h"
#ifdef TOOLS_ENABLED
#include "editor/editor_settings.h"
#endif
-#define PEM_BEGIN_CRT "-----BEGIN CERTIFICATE-----\n"
-#define PEM_END_CRT "-----END CERTIFICATE-----\n"
-#define PEM_MIN_SIZE 54
#include <mbedtls/debug.h>
#include <mbedtls/md.h>
#include <mbedtls/pem.h>
+#define PEM_BEGIN_CRT "-----BEGIN CERTIFICATE-----\n"
+#define PEM_END_CRT "-----END CERTIFICATE-----\n"
+#define PEM_MIN_SIZE 54
+
CryptoKey *CryptoKeyMbedTLS::create() {
return memnew(CryptoKeyMbedTLS);
}
diff --git a/modules/mbedtls/dtls_server_mbedtls.cpp b/modules/mbedtls/dtls_server_mbedtls.cpp
index 62513929ea..e466fe15d6 100644
--- a/modules/mbedtls/dtls_server_mbedtls.cpp
+++ b/modules/mbedtls/dtls_server_mbedtls.cpp
@@ -29,6 +29,7 @@
/**************************************************************************/
#include "dtls_server_mbedtls.h"
+
#include "packet_peer_mbed_dtls.h"
Error DTLSServerMbedTLS::setup(Ref<TLSOptions> p_options) {
diff --git a/modules/mbedtls/dtls_server_mbedtls.h b/modules/mbedtls/dtls_server_mbedtls.h
index d5841a45fa..59befecf43 100644
--- a/modules/mbedtls/dtls_server_mbedtls.h
+++ b/modules/mbedtls/dtls_server_mbedtls.h
@@ -31,9 +31,10 @@
#ifndef DTLS_SERVER_MBEDTLS_H
#define DTLS_SERVER_MBEDTLS_H
-#include "core/io/dtls_server.h"
#include "tls_context_mbedtls.h"
+#include "core/io/dtls_server.h"
+
class DTLSServerMbedTLS : public DTLSServer {
private:
static DTLSServer *_create_func();
diff --git a/modules/mbedtls/packet_peer_mbed_dtls.h b/modules/mbedtls/packet_peer_mbed_dtls.h
index 05decec783..2cff7a3589 100644
--- a/modules/mbedtls/packet_peer_mbed_dtls.h
+++ b/modules/mbedtls/packet_peer_mbed_dtls.h
@@ -31,9 +31,10 @@
#ifndef PACKET_PEER_MBED_DTLS_H
#define PACKET_PEER_MBED_DTLS_H
-#include "core/io/packet_peer_dtls.h"
#include "tls_context_mbedtls.h"
+#include "core/io/packet_peer_dtls.h"
+
#include <mbedtls/timing.h>
class PacketPeerMbedDTLS : public PacketPeerDTLS {
diff --git a/modules/mbedtls/stream_peer_mbedtls.h b/modules/mbedtls/stream_peer_mbedtls.h
index ec0446c380..a8080f0960 100644
--- a/modules/mbedtls/stream_peer_mbedtls.h
+++ b/modules/mbedtls/stream_peer_mbedtls.h
@@ -31,9 +31,10 @@
#ifndef STREAM_PEER_MBEDTLS_H
#define STREAM_PEER_MBEDTLS_H
-#include "core/io/stream_peer_tls.h"
#include "tls_context_mbedtls.h"
+#include "core/io/stream_peer_tls.h"
+
class StreamPeerMbedTLS : public StreamPeerTLS {
private:
Status status = STATUS_DISCONNECTED;
diff --git a/modules/mbedtls/tests/test_crypto_mbedtls.cpp b/modules/mbedtls/tests/test_crypto_mbedtls.cpp
index 598e1d972e..22d79b79f9 100644
--- a/modules/mbedtls/tests/test_crypto_mbedtls.cpp
+++ b/modules/mbedtls/tests/test_crypto_mbedtls.cpp
@@ -30,7 +30,8 @@
#include "test_crypto_mbedtls.h"
-#include "modules/mbedtls/crypto_mbedtls.h"
+#include "../crypto_mbedtls.h"
+
#include "tests/test_macros.h"
namespace TestCryptoMbedTLS {
diff --git a/modules/mbedtls/tls_context_mbedtls.h b/modules/mbedtls/tls_context_mbedtls.h
index f1bad6a40c..29323688fb 100644
--- a/modules/mbedtls/tls_context_mbedtls.h
+++ b/modules/mbedtls/tls_context_mbedtls.h
@@ -34,7 +34,6 @@
#include "crypto_mbedtls.h"
#include "core/io/file_access.h"
-
#include "core/object/ref_counted.h"
#include <mbedtls/config.h>