diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2019-07-02 14:52:43 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-07-02 14:52:43 +0200 |
commit | e9d624d7ce1d56cf134599a62deea1f5a0848019 (patch) | |
tree | 8d4b7e398f6d52c1d1d24daeb6542a07e0675de3 /platform | |
parent | 4cb0887660861402fe6857662e622488adb86514 (diff) | |
parent | 564d93ff10b19dd15df6ea049bd7c9a9c99680c6 (diff) |
Merge pull request #30239 from Faless/crypto/crypto_core
CryptoCore class to access to base crypto utils.
Diffstat (limited to 'platform')
-rw-r--r-- | platform/uwp/export/export.cpp | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/platform/uwp/export/export.cpp b/platform/uwp/export/export.cpp index ec43a4c26f..abb7b391d3 100644 --- a/platform/uwp/export/export.cpp +++ b/platform/uwp/export/export.cpp @@ -32,6 +32,7 @@ #include "core/bind/core_bind.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/file_access.h" #include "core/project_settings.h" @@ -42,8 +43,6 @@ #include "thirdparty/minizip/unzip.h" #include "thirdparty/minizip/zip.h" -#include "thirdparty/misc/base64.h" -#include "thirdparty/misc/sha256.h" #include <zlib.h> @@ -198,15 +197,12 @@ public: String AppxPackager::hash_block(const uint8_t *p_block_data, size_t p_block_len) { - char hash[32]; + unsigned char hash[32]; char base64[45]; - sha256_context ctx; - sha256_init(&ctx); - sha256_hash(&ctx, (uint8_t *)p_block_data, p_block_len); - sha256_done(&ctx, (uint8_t *)hash); - - base64_encode(base64, hash, 32); + CryptoCore::sha256(p_block_data, p_block_len, hash); + size_t len = 0; + CryptoCore::b64_encode((unsigned char *)base64, 45, &len, (unsigned char *)hash, 32); base64[44] = '\0'; return String(base64); |