summaryrefslogtreecommitdiffstats
path: root/Source/cmSystemTools.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2016-11-03 17:21:41 (GMT)
committerBrad King <brad.king@kitware.com>2016-11-10 13:29:38 (GMT)
commit5420278dc884c0382f271872b67c33978f3fe6b8 (patch)
treebbc69e42b2785521157da63324473b0f0d36fb64 /Source/cmSystemTools.cxx
parent9a596b33bbfdb274ccf7f678c78cb8826c7c363b (diff)
downloadCMake-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/cmSystemTools.cxx')
-rw-r--r--Source/cmSystemTools.cxx8
1 files changed, 4 insertions, 4 deletions
diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx
index 27fecdf..7738ab6 100644
--- a/Source/cmSystemTools.cxx
+++ b/Source/cmSystemTools.cxx
@@ -847,8 +847,8 @@ bool cmSystemTools::RenameFile(const char* oldname, const char* newname)
bool cmSystemTools::ComputeFileMD5(const std::string& source, char* md5out)
{
#if defined(CMAKE_BUILD_WITH_CMAKE)
- CM_AUTO_PTR<cmCryptoHash> md5 = cmCryptoHash::New("MD5");
- std::string str = md5->HashFile(source);
+ cmCryptoHash md5(cmCryptoHash::AlgoMD5);
+ std::string const str = md5.HashFile(source);
strncpy(md5out, str.c_str(), 32);
return !str.empty();
#else
@@ -863,8 +863,8 @@ bool cmSystemTools::ComputeFileMD5(const std::string& source, char* md5out)
std::string cmSystemTools::ComputeStringMD5(const std::string& input)
{
#if defined(CMAKE_BUILD_WITH_CMAKE)
- CM_AUTO_PTR<cmCryptoHash> md5 = cmCryptoHash::New("MD5");
- return md5->HashString(input);
+ cmCryptoHash md5(cmCryptoHash::AlgoMD5);
+ return md5.HashString(input);
#else
(void)input;
cmSystemTools::Message("md5sum not supported in bootstrapping mode",