mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-06-16 18:39:46 -04:00
merge of branch v0.6-idclean 7180
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@7187 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
7815efb16f
commit
0f29d28b1b
397 changed files with 6503 additions and 5702 deletions
|
@ -132,7 +132,7 @@ void p3ConfigMgr::loadConfiguration()
|
|||
void p3ConfigMgr::loadConfig()
|
||||
{
|
||||
std::map<uint32_t, pqiConfig *>::iterator cit;
|
||||
std::string dummyHash = "dummyHash";
|
||||
RsFileHash dummyHash ;
|
||||
for (cit = configs.begin(); cit != configs.end(); cit++)
|
||||
{
|
||||
#ifdef CONFIG_DEBUG
|
||||
|
@ -195,7 +195,7 @@ p3Config::p3Config(uint32_t t)
|
|||
}
|
||||
|
||||
|
||||
bool p3Config::loadConfiguration(std::string &loadHash)
|
||||
bool p3Config::loadConfiguration(RsFileHash &loadHash)
|
||||
{
|
||||
return loadConfig();
|
||||
}
|
||||
|
@ -278,7 +278,7 @@ bool p3Config::loadAttempt(const std::string& cfgFname,const std::string& signFn
|
|||
uint32_t stream_flags = BIN_FLAGS_READABLE;
|
||||
|
||||
BinEncryptedFileInterface *bio = new BinEncryptedFileInterface(cfgFname.c_str(), bioflags);
|
||||
pqiSSLstore stream(setupSerialiser(), "CONFIG", bio, stream_flags);
|
||||
pqiSSLstore stream(setupSerialiser(), RsPeerId(), bio, stream_flags);
|
||||
|
||||
if(!stream.getEncryptedItems(load))
|
||||
{
|
||||
|
@ -302,8 +302,8 @@ bool p3Config::loadAttempt(const std::string& cfgFname,const std::string& signFn
|
|||
std::string signatureStored((char *) signbio->memptr(), signbio->memsize());
|
||||
|
||||
std::string signatureRead;
|
||||
std::string strHash(Hash());
|
||||
AuthSSL::getAuthSSL()->SignData(strHash.c_str(), strHash.length(), signatureRead);
|
||||
RsFileHash strHash(Hash());
|
||||
AuthSSL::getAuthSSL()->SignData(strHash.toByteArray(), RsFileHash::SIZE_IN_BYTES, signatureRead);
|
||||
|
||||
delete signbio;
|
||||
|
||||
|
@ -344,7 +344,7 @@ bool p3Config::saveConfig()
|
|||
stream_flags |= BIN_FLAGS_NO_DELETE;
|
||||
|
||||
BinEncryptedFileInterface *cfg_bio = new BinEncryptedFileInterface(newCfgFname.c_str(), bioflags);
|
||||
pqiSSLstore *stream = new pqiSSLstore(setupSerialiser(), "CONFIG", cfg_bio, stream_flags);
|
||||
pqiSSLstore *stream = new pqiSSLstore(setupSerialiser(), RsPeerId(), cfg_bio, stream_flags);
|
||||
|
||||
written = written && stream->encryptedSendItems(toSave);
|
||||
|
||||
|
@ -359,8 +359,8 @@ bool p3Config::saveConfig()
|
|||
|
||||
/* sign data */
|
||||
std::string signature;
|
||||
std::string strHash(Hash());
|
||||
AuthSSL::getAuthSSL()->SignData(strHash.c_str(),strHash.length(), signature);
|
||||
RsFileHash strHash(Hash());
|
||||
AuthSSL::getAuthSSL()->SignData(strHash.toByteArray(),strHash.SIZE_IN_BYTES, signature);
|
||||
|
||||
/* write signature to configuration */
|
||||
BinMemInterface *signbio = new BinMemInterface(signature.c_str(),
|
||||
|
@ -567,7 +567,7 @@ const std::string& pqiConfig::Filename()
|
|||
return filename;
|
||||
}
|
||||
|
||||
const std::string& pqiConfig::Hash()
|
||||
const RsFileHash& pqiConfig::Hash()
|
||||
{
|
||||
RsStackMutex stack(cfgMtx); /***** LOCK STACK MUTEX ****/
|
||||
return hash;
|
||||
|
@ -591,7 +591,7 @@ void pqiConfig::setFilename(const std::string& name)
|
|||
filename = name;
|
||||
}
|
||||
|
||||
void pqiConfig::setHash(const std::string& h)
|
||||
void pqiConfig::setHash(const RsFileHash& h)
|
||||
{
|
||||
RsStackMutex stack(cfgMtx); /***** LOCK STACK MUTEX ****/
|
||||
hash = h;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue