set buffer size for reading config signatures to the size of the computed signature. This fixes the load of the configuration for locations created after 8e6c7cd.

This commit is contained in:
electron128 2015-11-06 19:50:59 +01:00
parent c41f98cb4c
commit 413cee375c

View File

@ -304,7 +304,11 @@ bool p3Config::loadAttempt(const std::string& cfgFname,const std::string& signFn
/* set hash */
setHash(bio->gethash());
BinMemInterface *signbio = new BinMemInterface(1000, BIN_FLAGS_READABLE);
std::string signatureRead;
RsFileHash strHash(Hash());
AuthSSL::getAuthSSL()->SignData(strHash.toByteArray(), RsFileHash::SIZE_IN_BYTES, signatureRead);
BinMemInterface *signbio = new BinMemInterface(signatureRead.size(), BIN_FLAGS_READABLE);
if(!signbio->readfromfile(signFname.c_str()))
{
@ -314,10 +318,6 @@ bool p3Config::loadAttempt(const std::string& cfgFname,const std::string& signFn
std::string signatureStored((char *) signbio->memptr(), signbio->memsize());
std::string signatureRead;
RsFileHash strHash(Hash());
AuthSSL::getAuthSSL()->SignData(strHash.toByteArray(), RsFileHash::SIZE_IN_BYTES, signatureRead);
delete signbio;
if(signatureRead != signatureStored)