diff options
author | Rémi Verschelde <remi@verschelde.fr> | 2022-02-14 12:15:10 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-14 12:15:10 +0100 |
commit | 6e73aa0497b9cfc1c28863e655991106e677e69c (patch) | |
tree | 15191afb3e9dcfe51a7d271e0120c03797293874 /platform/osx/export/codesign.cpp | |
parent | 8317753c24f6a05d4fdc8541fecf1cd2ec189b41 (diff) | |
parent | f4a80f9ca7dd7241d418db341aa97613bebd6b8d (diff) |
Merge pull request #57887 from Faless/crypto/4.x_os_get_entropy
Diffstat (limited to 'platform/osx/export/codesign.cpp')
-rw-r--r-- | platform/osx/export/codesign.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/platform/osx/export/codesign.cpp b/platform/osx/export/codesign.cpp index 8ea6ff519d..8d1d147196 100644 --- a/platform/osx/export/codesign.cpp +++ b/platform/osx/export/codesign.cpp @@ -1359,9 +1359,12 @@ Error CodeSign::_codesign_file(bool p_use_hardened_runtime, bool p_force, const // Generate common signature structures. if (id.is_empty()) { - Ref<Crypto> crypto = Ref<Crypto>(Crypto::create()); - PackedByteArray uuid = crypto->generate_random_bytes(16); - id = (String("a-55554944") /*a-UUID*/ + String::hex_encode_buffer(uuid.ptr(), 16)); + CryptoCore::RandomGenerator rng; + ERR_FAIL_COND_V_MSG(rng.init(), FAILED, "Failed to initialize random number generator."); + uint8_t uuid[16]; + Error err = rng.get_random_bytes(uuid, 16); + ERR_FAIL_COND_V_MSG(err, err, "Failed to generate UUID."); + id = (String("a-55554944") /*a-UUID*/ + String::hex_encode_buffer(uuid, 16)); } CharString uuid_str = id.utf8(); print_verbose(vformat("CodeSign: Used bundle ID: %s", id)); |