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/CTest | |
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/CTest')
-rw-r--r-- | Source/CTest/cmCTestLaunch.cxx | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/Source/CTest/cmCTestLaunch.cxx b/Source/CTest/cmCTestLaunch.cxx index 224681a..f7a6e0b 100644 --- a/Source/CTest/cmCTestLaunch.cxx +++ b/Source/CTest/cmCTestLaunch.cxx @@ -4,6 +4,7 @@ #include <cmConfigure.h> +#include "cmCryptoHash.h" #include "cmGeneratedFileStream.h" #include "cmGlobalGenerator.h" #include "cmMakefile.h" @@ -14,7 +15,6 @@ #include <cm_auto_ptr.hxx> #include <cmsys/FStream.hxx> -#include <cmsys/MD5.h> #include <cmsys/Process.h> #include <cmsys/RegularExpression.hxx> #include <iostream> @@ -167,17 +167,14 @@ void cmCTestLaunch::ComputeFileNames() // We hash the input command working dir and command line to obtain // a repeatable and (probably) unique name for log files. - char hash[32]; - cmsysMD5* md5 = cmsysMD5_New(); - cmsysMD5_Initialize(md5); - cmsysMD5_Append(md5, (unsigned char const*)(this->CWD.c_str()), -1); + cmCryptoHash md5(cmCryptoHash::AlgoMD5); + md5.Initialize(); + md5.Append(this->CWD); for (std::vector<std::string>::const_iterator ai = this->RealArgs.begin(); ai != this->RealArgs.end(); ++ai) { - cmsysMD5_Append(md5, (unsigned char const*)ai->c_str(), -1); + md5.Append(*ai); } - cmsysMD5_FinalizeHex(md5, hash); - cmsysMD5_Delete(md5); - this->LogHash.assign(hash, 32); + this->LogHash = md5.FinalizeHex(); // We store stdout and stderr in temporary log files. this->LogOut = this->LogDir; |