diff options
author | Brad King <brad.king@kitware.com> | 2016-11-03 17:21:41 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2016-11-10 13:29:38 (GMT) |
commit | 5420278dc884c0382f271872b67c33978f3fe6b8 (patch) | |
tree | bbc69e42b2785521157da63324473b0f0d36fb64 /Source/cmLocalGenerator.cxx | |
parent | 9a596b33bbfdb274ccf7f678c78cb8826c7c363b (diff) | |
download | CMake-5420278dc884c0382f271872b67c33978f3fe6b8.zip CMake-5420278dc884c0382f271872b67c33978f3fe6b8.tar.gz CMake-5420278dc884c0382f271872b67c33978f3fe6b8.tar.bz2 |
Port hash computation to cmCryptoHash
Avoid using KWSys MD5 or `cm_sha2` and use the `cmCryptoHash`
abstraction instead.
Diffstat (limited to 'Source/cmLocalGenerator.cxx')
-rw-r--r-- | Source/cmLocalGenerator.cxx | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index 4aecb1d..434cb10 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -26,7 +26,7 @@ #if defined(CMAKE_BUILD_WITH_CMAKE) #define CM_LG_ENCODE_OBJECT_NAMES -#include <cmsys/MD5.h> +#include "cmCryptoHash.h" #endif #include <algorithm> @@ -2001,17 +2001,6 @@ void cmLocalGenerator::GenerateTargetInstallRules( } #if defined(CM_LG_ENCODE_OBJECT_NAMES) -static std::string cmLocalGeneratorMD5(const char* input) -{ - char md5out[32]; - cmsysMD5* md5 = cmsysMD5_New(); - cmsysMD5_Initialize(md5); - cmsysMD5_Append(md5, reinterpret_cast<unsigned char const*>(input), -1); - cmsysMD5_FinalizeHex(md5, md5out); - cmsysMD5_Delete(md5); - return std::string(md5out, 32); -} - static bool cmLocalGeneratorShortenObjectName(std::string& objName, std::string::size_type max_len) { @@ -2020,7 +2009,8 @@ static bool cmLocalGeneratorShortenObjectName(std::string& objName, std::string::size_type pos = objName.find('/', objName.size() - max_len + 32); if (pos != objName.npos) { - std::string md5name = cmLocalGeneratorMD5(objName.substr(0, pos).c_str()); + cmCryptoHash md5(cmCryptoHash::AlgoMD5); + std::string md5name = md5.HashString(objName.substr(0, pos)); md5name += objName.substr(pos); objName = md5name; |