mirror of
https://github.com/Kitware/CMake.git
synced 2025-10-19 11:18:40 +08:00
cmCryptoHash: Avoid using subclasses at client sites
Use only the main `cmCryptoHash` interface.
This commit is contained in:
@@ -847,8 +847,8 @@ bool cmSystemTools::RenameFile(const char* oldname, const char* newname)
|
|||||||
bool cmSystemTools::ComputeFileMD5(const std::string& source, char* md5out)
|
bool cmSystemTools::ComputeFileMD5(const std::string& source, char* md5out)
|
||||||
{
|
{
|
||||||
#if defined(CMAKE_BUILD_WITH_CMAKE)
|
#if defined(CMAKE_BUILD_WITH_CMAKE)
|
||||||
cmCryptoHashMD5 md5;
|
CM_AUTO_PTR<cmCryptoHash> md5 = cmCryptoHash::New("MD5");
|
||||||
std::string str = md5.HashFile(source);
|
std::string str = md5->HashFile(source);
|
||||||
strncpy(md5out, str.c_str(), 32);
|
strncpy(md5out, str.c_str(), 32);
|
||||||
return !str.empty();
|
return !str.empty();
|
||||||
#else
|
#else
|
||||||
@@ -863,8 +863,8 @@ bool cmSystemTools::ComputeFileMD5(const std::string& source, char* md5out)
|
|||||||
std::string cmSystemTools::ComputeStringMD5(const std::string& input)
|
std::string cmSystemTools::ComputeStringMD5(const std::string& input)
|
||||||
{
|
{
|
||||||
#if defined(CMAKE_BUILD_WITH_CMAKE)
|
#if defined(CMAKE_BUILD_WITH_CMAKE)
|
||||||
cmCryptoHashMD5 md5;
|
CM_AUTO_PTR<cmCryptoHash> md5 = cmCryptoHash::New("MD5");
|
||||||
return md5.HashString(input);
|
return md5->HashString(input);
|
||||||
#else
|
#else
|
||||||
(void)input;
|
(void)input;
|
||||||
cmSystemTools::Message("md5sum not supported in bootstrapping mode",
|
cmSystemTools::Message("md5sum not supported in bootstrapping mode",
|
||||||
|
Reference in New Issue
Block a user