summaryrefslogtreecommitdiffstats
path: root/Source/CTest
diff options
context:
space:
mode:
authorAndré Klitzing <aklitzing@gmail.com>2017-07-08 16:42:02 (GMT)
committerAndré Klitzing <aklitzing@gmail.com>2017-07-14 06:57:17 (GMT)
commitc4647d84321f4a7b52301237394087065f5df33c (patch)
tree7fb689a0052667a611020e9d9169afa2160b1ba5 /Source/CTest
parent501a4feea8d0d007ce292defec1c97d6eb702409 (diff)
downloadCMake-c4647d84321f4a7b52301237394087065f5df33c.zip
CMake-c4647d84321f4a7b52301237394087065f5df33c.tar.gz
CMake-c4647d84321f4a7b52301237394087065f5df33c.tar.bz2
Change ComputeFileMD5 to ComputeFileHash
* Use a parameter to select hash algorithm * Return a std::string as result or an empty string if it fails * Avoids unnecessary copy of hash value
Diffstat (limited to 'Source/CTest')
-rw-r--r--Source/CTest/cmCTestSubmitHandler.cxx12
1 files changed, 5 insertions, 7 deletions
diff --git a/Source/CTest/cmCTestSubmitHandler.cxx b/Source/CTest/cmCTestSubmitHandler.cxx
index 8d62fa1..689668d 100644
--- a/Source/CTest/cmCTestSubmitHandler.cxx
+++ b/Source/CTest/cmCTestSubmitHandler.cxx
@@ -13,6 +13,7 @@
#include "cmCTest.h"
#include "cmCTestCurl.h"
#include "cmCTestScriptHandler.h"
+#include "cmCryptoHash.h"
#include "cmCurl.h"
#include "cmGeneratedFileStream.h"
#include "cmProcessOutput.h"
@@ -428,10 +429,8 @@ bool cmCTestSubmitHandler::SubmitUsingHTTP(const std::string& localprefix,
if (cmSystemTools::IsOn(this->GetOption("InternalTest"))) {
upload_as += "bad_md5sum";
} else {
- char md5[33];
- cmSystemTools::ComputeFileMD5(local_file, md5);
- md5[32] = 0;
- upload_as += md5;
+ upload_as +=
+ cmSystemTools::ComputeFileHash(local_file, cmCryptoHash::AlgoMD5);
}
if (!cmSystemTools::FileExists(local_file.c_str())) {
@@ -1058,9 +1057,8 @@ int cmCTestSubmitHandler::HandleCDashUploadFile(std::string const& file,
}
}
- char md5sum[33];
- md5sum[32] = 0;
- cmSystemTools::ComputeFileMD5(file, md5sum);
+ std::string md5sum =
+ cmSystemTools::ComputeFileHash(file, cmCryptoHash::AlgoMD5);
// 1. request the buildid and check to see if the file
// has already been uploaded
// TODO I added support for subproject. You would need to add