Completed Basic configuration storage:

* Added read/writetofile() fns to BinMemInterface
 * Added SignData() fns to AuthXPGP.
 * Added Certificate saving to AuthXPGP.
 * added Signatures to Configuration.
 * now discards messages if Hash is wrong (p3msgservice)



git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@341 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
drbob 2008-02-08 12:39:40 +00:00
parent 08d3634d28
commit 3e1b155f1a
12 changed files with 353 additions and 39 deletions

View file

@ -328,20 +328,41 @@ bool p3MsgService::loadConfiguration(std::string &loadHash)
std::string hashin = in->gethash();
delete pa_in;
if (hashin != loadHash)
{
/* big error message! */
std::cerr << "p3MsgService::loadConfiguration() FAILED!" << std::endl;
std::cerr << "p3MsgService::loadConfiguration() FAILED!" << std::endl;
std::cerr << "p3MsgService::loadConfiguration() FAILED!" << std::endl;
std::cerr << "p3MsgService::loadConfiguration() FAILED!" << std::endl;
std::cerr << "p3MsgService::loadConfiguration() FAILED!" << std::endl;
std::cerr << "p3MsgService::loadConfiguration() FAILED! Msgs Tampered" << std::endl;
std::string msgfileold = msgfile + ".failed";
rename(msgfile.c_str(), msgfileold.c_str());
std::cerr << "Moving Old file to: " << msgfileold << std::endl;
std::cerr << "removing dodgey msgs" << std::endl;
RsStackMutex stack(mMsgMtx); /********** STACK LOCKED MTX ******/
std::map<uint32_t, RsMsgItem *>::iterator mit;
for(mit = imsg.begin(); mit != imsg.end(); mit++)
{
delete (mit->second);
}
imsg.clear();
for(mit = msgOutgoing.begin(); mit != msgOutgoing.end(); mit++)
{
delete (mit->second);
}
msgOutgoing.clear();
setHash("");
return false;
}
setHash(hashin);
delete pa_in;
return true;
}