mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-06-27 23:57:38 -04:00
Added the infrastructure for propagating trust info through third parties
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@892 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
6919d3bd7f
commit
19aa089701
10 changed files with 101 additions and 26 deletions
|
@ -267,6 +267,32 @@ int AuthXPGP::setConfigDirectories(std::string configfile, std::string neigh
|
|||
return 1;
|
||||
}
|
||||
|
||||
bool AuthXPGP::isTrustingMe(std::string id)
|
||||
{
|
||||
xpgpMtx.lock(); /***** LOCK *****/
|
||||
|
||||
bool res = false ;
|
||||
|
||||
for(std::list<std::string>::const_iterator it(_trusting_peers.begin());it!=_trusting_peers.end() && !res;++it)
|
||||
if( *it == id )
|
||||
res = true ;
|
||||
|
||||
xpgpMtx.unlock(); /**** UNLOCK ****/
|
||||
|
||||
return res ;
|
||||
}
|
||||
void AuthXPGP::addTrustingPeer(std::string id)
|
||||
{
|
||||
if( !isTrustingMe(id) )
|
||||
{
|
||||
xpgpMtx.lock(); /***** LOCK *****/
|
||||
|
||||
_trusting_peers.push_back(id) ;
|
||||
|
||||
xpgpMtx.unlock(); /**** UNLOCK ****/
|
||||
}
|
||||
}
|
||||
|
||||
std::string AuthXPGP::OwnId()
|
||||
{
|
||||
#ifdef AUTHXPGP_DEBUG
|
||||
|
@ -1546,6 +1572,7 @@ int LoadCheckXPGPandGetName(const char *cert_file, std::string &userName, std::s
|
|||
valid = false;
|
||||
}
|
||||
|
||||
std::cout << getXPGPInfo(xpgp) << std::endl ;
|
||||
// clean up.
|
||||
XPGP_free(xpgp);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue