mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-11-22 17:00:41 -05:00
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:
parent
c41f98cb4c
commit
413cee375c
1 changed files with 5 additions and 5 deletions
|
|
@ -304,7 +304,11 @@ bool p3Config::loadAttempt(const std::string& cfgFname,const std::string& signFn
|
||||||
/* set hash */
|
/* set hash */
|
||||||
setHash(bio->gethash());
|
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()))
|
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 signatureStored((char *) signbio->memptr(), signbio->memsize());
|
||||||
|
|
||||||
std::string signatureRead;
|
|
||||||
RsFileHash strHash(Hash());
|
|
||||||
AuthSSL::getAuthSSL()->SignData(strHash.toByteArray(), RsFileHash::SIZE_IN_BYTES, signatureRead);
|
|
||||||
|
|
||||||
delete signbio;
|
delete signbio;
|
||||||
|
|
||||||
if(signatureRead != signatureStored)
|
if(signatureRead != signatureStored)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue