diff --git a/modules/build/include/checksums.hpp b/modules/build/include/checksums.hpp index b259ad1..710a4f2 100644 --- a/modules/build/include/checksums.hpp +++ b/modules/build/include/checksums.hpp @@ -32,7 +32,7 @@ * * @return String containing the name of the hash algorithm to use */ -std::string get_configured_hash_algorithm(); +extern "C" std::string get_configured_hash_algorithm(); /** * @brief Gets a list of available digest algorithms from OpenSSL @@ -42,7 +42,7 @@ std::string get_configured_hash_algorithm(); * * @return String containing comma-separated list of available algorithms */ -std::string get_available_algorithms(); +extern "C" std::string get_available_algorithms(); /** * @brief Generates a file checksum using the configured hashing algorithm @@ -54,7 +54,7 @@ std::string get_available_algorithms(); * @param file_path Path to the file to be hashed * @return String containing the hexadecimal representation of the checksum, or empty string on error */ -std::string generate_file_checksum(const std::filesystem::path& file_path); +extern "C" std::string generate_file_checksum(const std::filesystem::path& file_path); /** * @brief Generates a checksum of a string using the configured hashing algorithm @@ -65,4 +65,4 @@ std::string generate_file_checksum(const std::filesystem::path& file_path); * @param input_string The string to be hashed * @return String containing the hexadecimal representation of the checksum, or empty string on error */ -std::string generate_string_checksum(const std::string& input_string); \ No newline at end of file +extern "C" std::string generate_string_checksum(const std::string& input_string); \ No newline at end of file diff --git a/modules/build/src/checksums.cpp b/modules/build/src/checksums.cpp index d869187..c5f76bc 100644 --- a/modules/build/src/checksums.cpp +++ b/modules/build/src/checksums.cpp @@ -13,7 +13,7 @@ #include "checksums.hpp" -std::string get_configured_hash_algorithm() +extern "C" std::string get_configured_hash_algorithm() { const char* algorithm = dpm_get_config("cryptography", "checksum_algorithm"); if (algorithm && strlen(algorithm) > 0) { @@ -24,7 +24,7 @@ std::string get_configured_hash_algorithm() return "sha256"; } -std::string get_available_algorithms() +extern "C" std::string get_available_algorithms() { std::vector algorithms; std::vector working_algorithms; @@ -83,7 +83,7 @@ std::string get_available_algorithms() return result.str(); } -std::string generate_file_checksum(const std::filesystem::path& file_path) +extern "C" std::string generate_file_checksum(const std::filesystem::path& file_path) { // Get configured algorithm std::string algorithm_name = get_configured_hash_algorithm(); @@ -170,7 +170,7 @@ std::string generate_file_checksum(const std::filesystem::path& file_path) return ss.str(); } -std::string generate_string_checksum(const std::string& input_string) +extern "C" std::string generate_string_checksum(const std::string& input_string) { // Get configured algorithm std::string algorithm_name = get_configured_hash_algorithm();