summaryrefslogtreecommitdiff
path: root/core/crypto
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2020-05-14 13:23:58 +0200
committerRémi Verschelde <rverschelde@gmail.com>2020-05-14 16:54:55 +0200
commit0be6d925dc3c6413bce7a3ccb49631b8e4a6e67a (patch)
treea27e497da7104dd0a64f98a04fa3067668735e91 /core/crypto
parent710b34b70227becdc652b4ae027fe0ac47409642 (diff)
Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks
Which means that reduz' beloved style which we all became used to will now be changed automatically to remove the first empty line. This makes us lean closer to 1TBS (the one true brace style) instead of hybridating it with some Allman-inspired spacing. There's still the case of braces around single-statement blocks that needs to be addressed (but clang-format can't help with that, but clang-tidy may if we agree about it). Part of #33027.
Diffstat (limited to 'core/crypto')
-rw-r--r--core/crypto/crypto.cpp8
-rw-r--r--core/crypto/crypto_core.h5
-rw-r--r--core/crypto/hashing_context.cpp1
3 files changed, 0 insertions, 14 deletions
diff --git a/core/crypto/crypto.cpp b/core/crypto/crypto.cpp
index 585731ac9f..60db329e64 100644
--- a/core/crypto/crypto.cpp
+++ b/core/crypto/crypto.cpp
@@ -71,7 +71,6 @@ Crypto *Crypto::create() {
}
void Crypto::load_default_certificates(String p_path) {
-
if (_load_default_certificates)
_load_default_certificates(p_path);
}
@@ -97,7 +96,6 @@ Ref<X509Certificate> Crypto::generate_self_signed_certificate(Ref<CryptoKey> p_k
/// Resource loader/saver
RES ResourceFormatLoaderCrypto::load(const String &p_path, const String &p_original_path, Error *r_error, bool p_use_sub_threads, float *r_progress, bool p_no_cache) {
-
String el = p_path.get_extension().to_lower();
if (el == "crt") {
X509Certificate *cert = X509Certificate::create();
@@ -114,18 +112,15 @@ RES ResourceFormatLoaderCrypto::load(const String &p_path, const String &p_origi
}
void ResourceFormatLoaderCrypto::get_recognized_extensions(List<String> *p_extensions) const {
-
p_extensions->push_back("crt");
p_extensions->push_back("key");
}
bool ResourceFormatLoaderCrypto::handles_type(const String &p_type) const {
-
return p_type == "X509Certificate" || p_type == "CryptoKey";
}
String ResourceFormatLoaderCrypto::get_resource_type(const String &p_path) const {
-
String el = p_path.get_extension().to_lower();
if (el == "crt")
return "X509Certificate";
@@ -135,7 +130,6 @@ String ResourceFormatLoaderCrypto::get_resource_type(const String &p_path) const
}
Error ResourceFormatSaverCrypto::save(const String &p_path, const RES &p_resource, uint32_t p_flags) {
-
Error err;
Ref<X509Certificate> cert = p_resource;
Ref<CryptoKey> key = p_resource;
@@ -151,7 +145,6 @@ Error ResourceFormatSaverCrypto::save(const String &p_path, const RES &p_resourc
}
void ResourceFormatSaverCrypto::get_recognized_extensions(const RES &p_resource, List<String> *p_extensions) const {
-
const X509Certificate *cert = Object::cast_to<X509Certificate>(*p_resource);
const CryptoKey *key = Object::cast_to<CryptoKey>(*p_resource);
if (cert) {
@@ -162,6 +155,5 @@ void ResourceFormatSaverCrypto::get_recognized_extensions(const RES &p_resource,
}
}
bool ResourceFormatSaverCrypto::recognize(const RES &p_resource) const {
-
return Object::cast_to<X509Certificate>(*p_resource) || Object::cast_to<CryptoKey>(*p_resource);
}
diff --git a/core/crypto/crypto_core.h b/core/crypto/crypto_core.h
index b3be58e8ee..36d8ace723 100644
--- a/core/crypto/crypto_core.h
+++ b/core/crypto/crypto_core.h
@@ -34,10 +34,8 @@
#include "core/reference.h"
class CryptoCore {
-
public:
class MD5Context {
-
private:
void *ctx; // To include, or not to include...
@@ -51,7 +49,6 @@ public:
};
class SHA1Context {
-
private:
void *ctx; // To include, or not to include...
@@ -65,7 +62,6 @@ public:
};
class SHA256Context {
-
private:
void *ctx; // To include, or not to include...
@@ -79,7 +75,6 @@ public:
};
class AESContext {
-
private:
void *ctx; // To include, or not to include...
diff --git a/core/crypto/hashing_context.cpp b/core/crypto/hashing_context.cpp
index 0b21dead74..726dc615df 100644
--- a/core/crypto/hashing_context.cpp
+++ b/core/crypto/hashing_context.cpp
@@ -104,7 +104,6 @@ void HashingContext::_create_ctx(HashType p_type) {
}
void HashingContext::_delete_ctx() {
-
switch (type) {
case HASH_MD5:
memdelete((CryptoCore::MD5Context *)ctx);