Browse Source

Don't use pnUtils for MD5 checksumming.

On the other hand, have we ever figured out exactly what this code is
supposed to do? Mark added it for something, but it's not really clear
what the purpose is.
Darryl Pogue 13 years ago
parent
commit
f4878166d5
  1. 17
      Sources/Plasma/FeatureLib/pfPython/pyAgeInfoStruct.cpp

17
Sources/Plasma/FeatureLib/pfPython/pyAgeInfoStruct.cpp

@ -42,6 +42,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "pyAgeInfoStruct.h"
#include "hsStlUtils.h"
#include "pnUtils/pnUtCrypt.h"
#include "plEncryption/plChecksum.h"
///////////////////////////////////////////////////////////////////////////
@ -131,7 +132,21 @@ void pyAgeInfoStruct::SetAgeInstanceGuid( const char * guid )
std::string y = curInst + guid;
plUUID instanceGuid;
CryptDigest(kCryptMd5, instanceGuid.fData , y.length(), y.c_str());
plMD5Checksum hash;
hash.Start();
hash.AddTo(y.length(), (uint8_t*)y.c_str());
hash.Finish();
const char* md5sum = hash.GetAsHexString();
plStringStream ss;
for (size_t i = 0; i < 16; i++) {
ss << md5sum[2*i];
ss << md5sum[(2*i)+1];
if (i == 3 || i == 5 || i == 7 || i == 9)
ss << '-';
}
instanceGuid.FromString(ss.GetString());
fAgeInfo.SetAgeInstanceGuid(&instanceGuid);
}
else {

Loading…
Cancel
Save