mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-08 17:15:16 -04:00
Send RsDiscReply information of the connected friend to himself too, when there is only one ssl id available. The reason is, that the signers of the gpg key has to be transfered. The friend skips the own RsDiscReply informations, but imports the gpg key.
Reload all gpg keys in AuthGPGimpl::LoadCertificateFromString, when new signatures are added - not only the key was imported. Changed parameters of RsPeers and AuthGPG from "std::string" to "const std::string&" Recompile of the GUI needed. git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@3753 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
a32bcbb635
commit
c19c8b5532
6 changed files with 133 additions and 143 deletions
|
@ -231,7 +231,7 @@ bool p3Peers::getPeerCount (unsigned int *pnFriendCount, unsigned int *pnOnlineC
|
|||
return mConnMgr->getPeerCount(pnFriendCount, pnOnlineCount, ssl);
|
||||
}
|
||||
|
||||
bool p3Peers::isOnline(std::string id)
|
||||
bool p3Peers::isOnline(const std::string &id)
|
||||
{
|
||||
#ifdef P3PEERS_DEBUG
|
||||
std::cerr << "p3Peers::isOnline() " << id << std::endl;
|
||||
|
@ -247,7 +247,7 @@ bool p3Peers::isOnline(std::string id)
|
|||
return false;
|
||||
}
|
||||
|
||||
bool p3Peers::isFriend(std::string ssl_id)
|
||||
bool p3Peers::isFriend(const std::string &ssl_id)
|
||||
{
|
||||
#ifdef P3PEERS_DEBUG
|
||||
std::cerr << "p3Peers::isFriend() " << ssl_id << std::endl;
|
||||
|
@ -272,7 +272,7 @@ static struct sockaddr_in getPreferredAddress( const struct sockaddr_in& addr1,t
|
|||
}
|
||||
#endif
|
||||
|
||||
bool p3Peers::getPeerDetails(std::string id, RsPeerDetails &d)
|
||||
bool p3Peers::getPeerDetails(const std::string &id, RsPeerDetails &d)
|
||||
{
|
||||
#ifdef P3PEERS_DEBUG
|
||||
std::cerr << "p3Peers::getPeerDetails() called for id : " << id << std::endl;
|
||||
|
@ -449,19 +449,19 @@ bool p3Peers::getPeerDetails(std::string id, RsPeerDetails &d)
|
|||
}
|
||||
|
||||
|
||||
std::string p3Peers::getGPGName(std::string gpg_id)
|
||||
std::string p3Peers::getGPGName(const std::string &gpg_id)
|
||||
{
|
||||
/* get from mAuthMgr as it should have more peers? */
|
||||
return AuthGPG::getAuthGPG()->getGPGName(gpg_id);
|
||||
}
|
||||
|
||||
bool p3Peers::isGPGAccepted(std::string gpg_id_is_friend)
|
||||
bool p3Peers::isGPGAccepted(const std::string &gpg_id_is_friend)
|
||||
{
|
||||
/* get from mAuthMgr as it should have more peers? */
|
||||
return AuthGPG::getAuthGPG()->isGPGAccepted(gpg_id_is_friend);
|
||||
}
|
||||
|
||||
std::string p3Peers::getPeerName(std::string ssl_or_gpg_id)
|
||||
std::string p3Peers::getPeerName(const std::string &ssl_or_gpg_id)
|
||||
{
|
||||
#ifdef P3PEERS_DEBUG
|
||||
std::cerr << "p3Peers::getPeerName() " << ssl_or_gpg_id << std::endl;
|
||||
|
@ -523,7 +523,7 @@ bool p3Peers::getGPGAcceptedList(std::list<std::string> &ids)
|
|||
return true;
|
||||
}
|
||||
|
||||
bool p3Peers::getSSLChildListOfGPGId(std::string gpg_id, std::list<std::string> &ids)
|
||||
bool p3Peers::getSSLChildListOfGPGId(const std::string &gpg_id, std::list<std::string> &ids)
|
||||
{
|
||||
#ifdef P3PEERS_DEBUG
|
||||
std::cerr << "p3Peers::getSSLChildListOfGPGId() for id : " << gpg_id << std::endl;
|
||||
|
@ -550,7 +550,7 @@ bool p3Peers::getSSLChildListOfGPGId(std::string gpg_id, std::list<std::string>
|
|||
return true;
|
||||
}
|
||||
|
||||
bool p3Peers::getGPGDetails(std::string id, RsPeerDetails &d)
|
||||
bool p3Peers::getGPGDetails(const std::string &id, RsPeerDetails &d)
|
||||
{
|
||||
#ifdef P3PEERS_DEBUG
|
||||
std::cerr << "p3Peers::getPgpDetails() called for id : " << id << std::endl;
|
||||
|
@ -570,7 +570,7 @@ std::string p3Peers::getGPGOwnId()
|
|||
return AuthGPG::getAuthGPG()->getGPGOwnId();
|
||||
}
|
||||
|
||||
std::string p3Peers::getGPGId(std::string sslid_or_gpgid)
|
||||
std::string p3Peers::getGPGId(const std::string &sslid_or_gpgid)
|
||||
{
|
||||
#ifdef P3PEERS_DEBUG
|
||||
std::cerr << "p3Peers::getPGPId()" << std::endl;
|
||||
|
@ -597,7 +597,7 @@ std::string p3Peers::getGPGId(std::string sslid_or_gpgid)
|
|||
|
||||
|
||||
/* Add/Remove Friends */
|
||||
bool p3Peers::addFriend(std::string id, std::string gpg_id)
|
||||
bool p3Peers::addFriend(const std::string &id, const std::string &gpg_id)
|
||||
{
|
||||
#ifdef P3PEERS_DEBUG
|
||||
std::cerr << "p3Peers::addFriend() with : id : " << id << "; gpg_id : " << gpg_id << std::endl;
|
||||
|
@ -609,7 +609,7 @@ bool p3Peers::addFriend(std::string id, std::string gpg_id)
|
|||
}
|
||||
}
|
||||
|
||||
bool p3Peers::addDummyFriend(std::string gpg_id)
|
||||
bool p3Peers::addDummyFriend(const std::string &gpg_id)
|
||||
{
|
||||
#ifdef P3PEERS_DEBUG
|
||||
std::cerr << "p3Peers::addDummyFriend() called" << std::endl;
|
||||
|
@ -626,7 +626,7 @@ bool p3Peers::addDummyFriend(std::string gpg_id)
|
|||
}
|
||||
}
|
||||
|
||||
bool p3Peers::isDummyFriend(std::string ssl_id) {
|
||||
bool p3Peers::isDummyFriend(const std::string &ssl_id) {
|
||||
#ifdef P3PEERS_DEBUG
|
||||
std::cerr << "p3Peers::isDummyFriend() called" << std::endl;
|
||||
#endif
|
||||
|
@ -643,7 +643,7 @@ bool p3Peers::isDummyFriend(std::string ssl_id) {
|
|||
return ret;
|
||||
}
|
||||
|
||||
bool p3Peers::removeFriend(std::string ssl_or_gpgid)
|
||||
bool p3Peers::removeFriend(const std::string &ssl_or_gpgid)
|
||||
{
|
||||
#ifdef P3PEERS_DEBUG
|
||||
std::cerr << "p3Peers::removeFriend() " << ssl_or_gpgid << std::endl;
|
||||
|
@ -664,7 +664,7 @@ bool p3Peers::removeFriend(std::string ssl_or_gpgid)
|
|||
}
|
||||
|
||||
/* Network Stuff */
|
||||
bool p3Peers::connectAttempt(std::string id)
|
||||
bool p3Peers::connectAttempt(const std::string &id)
|
||||
{
|
||||
#ifdef P3PEERS_DEBUG
|
||||
std::cerr << "p3Peers::connectAttempt() " << id << std::endl;
|
||||
|
@ -703,7 +703,7 @@ bool p3Peers::getAllowTunnelConnection()
|
|||
return mConnMgr->getTunnelConnection() ;
|
||||
}
|
||||
|
||||
bool p3Peers::setLocalAddress(std::string id, std::string addr_str, uint16_t port)
|
||||
bool p3Peers::setLocalAddress(const std::string &id, const std::string &addr_str, uint16_t port)
|
||||
{
|
||||
#ifdef P3PEERS_DEBUG
|
||||
std::cerr << "p3Peers::setLocalAddress() " << id << std::endl;
|
||||
|
@ -728,7 +728,7 @@ bool p3Peers::setLocalAddress(std::string id, std::string addr_str, uint16_t po
|
|||
return false;
|
||||
}
|
||||
|
||||
bool p3Peers::setLocation(std::string ssl_id, std::string location)
|
||||
bool p3Peers::setLocation(const std::string &ssl_id, const std::string &location)
|
||||
{
|
||||
#ifdef P3PEERS_DEBUG
|
||||
std::cerr << "p3Peers::setLocation() " << ssl_id << std::endl;
|
||||
|
@ -736,7 +736,7 @@ bool p3Peers::setLocation(std::string ssl_id, std::string location)
|
|||
|
||||
return mConnMgr->setLocation(ssl_id, location);
|
||||
}
|
||||
bool p3Peers::setExtAddress(std::string id, std::string addr_str, uint16_t port)
|
||||
bool p3Peers::setExtAddress(const std::string &id, const std::string &addr_str, uint16_t port)
|
||||
{
|
||||
#ifdef P3PEERS_DEBUG
|
||||
std::cerr << "p3Peers::setExtAddress() " << id << std::endl;
|
||||
|
@ -761,7 +761,7 @@ bool p3Peers::setExtAddress(std::string id, std::string addr_str, uint16_t port
|
|||
return false;
|
||||
}
|
||||
|
||||
bool p3Peers::setDynDNS(std::string id, std::string dyndns)
|
||||
bool p3Peers::setDynDNS(const std::string &id, const std::string &dyndns)
|
||||
{
|
||||
#ifdef P3PEERS_DEBUG
|
||||
std::cerr << "p3Peers::setDynDNS() called with id: " << id << " dyndns: " << dyndns <<std::endl;
|
||||
|
@ -769,7 +769,7 @@ bool p3Peers::setDynDNS(std::string id, std::string dyndns)
|
|||
return mConnMgr->setDynDNS(id, dyndns);
|
||||
}
|
||||
|
||||
bool p3Peers::setNetworkMode(std::string id, uint32_t extNetMode)
|
||||
bool p3Peers::setNetworkMode(const std::string &id, uint32_t extNetMode)
|
||||
{
|
||||
#ifdef P3PEERS_DEBUG
|
||||
std::cerr << "p3Peers::setNetworkMode() " << id << std::endl;
|
||||
|
@ -800,7 +800,7 @@ bool p3Peers::setNetworkMode(std::string id, uint32_t extNetMode)
|
|||
|
||||
|
||||
bool
|
||||
p3Peers::setVisState(std::string id, uint32_t extVisState)
|
||||
p3Peers::setVisState(const std::string &id, uint32_t extVisState)
|
||||
{
|
||||
#ifdef P3PEERS_DEBUG
|
||||
std::cerr << "p3Peers::setVisState() " << id << std::endl;
|
||||
|
@ -865,7 +865,7 @@ p3Peers::GetRetroshareInvite(const std::string& ssl_id)
|
|||
|
||||
//===========================================================================
|
||||
|
||||
bool p3Peers::loadCertificateFromFile(std::string fname, std::string &id, std::string &gpg_id)
|
||||
bool p3Peers::loadCertificateFromFile(const std::string &fname, std::string &id, std::string &gpg_id)
|
||||
{
|
||||
#ifdef P3PEERS_DEBUG
|
||||
std::cerr << "p3Peers::LoadCertificateFromFile() not implemented yet";
|
||||
|
@ -920,7 +920,7 @@ bool p3Peers::loadCertificateFromFile(std::string fname, std::string &id, std::
|
|||
|
||||
|
||||
|
||||
bool p3Peers::loadDetailsFromStringCert(std::string certstr, RsPeerDetails &pd)
|
||||
bool p3Peers::loadDetailsFromStringCert(const std::string &certstr, RsPeerDetails &pd)
|
||||
{
|
||||
#ifdef P3PEERS_DEBUG
|
||||
std::cerr << "p3Peers::LoadCertificateFromString() ";
|
||||
|
@ -1060,7 +1060,7 @@ bool p3Peers::loadDetailsFromStringCert(std::string certstr, RsPeerDetails &pd)
|
|||
|
||||
|
||||
|
||||
bool p3Peers::saveCertificateToFile(std::string id, std::string fname)
|
||||
bool p3Peers::saveCertificateToFile(const std::string &id, const std::string &fname)
|
||||
{
|
||||
#ifdef P3PEERS_DEBUG
|
||||
std::cerr << "p3Peers::SaveCertificateToFile() not implemented yet " << id;
|
||||
|
@ -1073,7 +1073,7 @@ bool p3Peers::saveCertificateToFile(std::string id, std::string fname)
|
|||
return false;
|
||||
}
|
||||
|
||||
std::string p3Peers::saveCertificateToString(std::string id)
|
||||
std::string p3Peers::saveCertificateToString(const std::string &id)
|
||||
{
|
||||
#ifdef P3PEERS_DEBUG
|
||||
std::cerr << "p3Peers::SaveCertificateToString() " << id;
|
||||
|
@ -1086,7 +1086,7 @@ std::string p3Peers::saveCertificateToString(std::string id)
|
|||
}
|
||||
}
|
||||
|
||||
bool p3Peers::signGPGCertificate(std::string id)
|
||||
bool p3Peers::signGPGCertificate(const std::string &id)
|
||||
{
|
||||
#ifdef P3PEERS_DEBUG
|
||||
std::cerr << "p3Peers::SignCertificate() " << id;
|
||||
|
@ -1098,7 +1098,7 @@ bool p3Peers::signGPGCertificate(std::string id)
|
|||
return AuthGPG::getAuthGPG()->SignCertificateLevel0(id);
|
||||
}
|
||||
|
||||
bool p3Peers::setAcceptToConnectGPGCertificate(std::string gpg_id, bool acceptance)
|
||||
bool p3Peers::setAcceptToConnectGPGCertificate(const std::string &gpg_id, bool acceptance)
|
||||
{
|
||||
#ifdef P3PEERS_DEBUG
|
||||
std::cerr << "p3Peers::setAcceptToConnectGPGCertificate() called with gpg_id : " << gpg_id << ", acceptance : " << acceptance << std::endl;
|
||||
|
@ -1116,7 +1116,7 @@ bool p3Peers::setAcceptToConnectGPGCertificate(std::string gpg_id, bool accepta
|
|||
return AuthGPG::getAuthGPG()->setAcceptToConnectGPGCertificate(gpg_id, acceptance);
|
||||
}
|
||||
|
||||
bool p3Peers::trustGPGCertificate(std::string id, uint32_t trustlvl)
|
||||
bool p3Peers::trustGPGCertificate(const std::string &id, uint32_t trustlvl)
|
||||
{
|
||||
#ifdef P3PEERS_DEBUG
|
||||
std::cerr << "p3Peers::TrustCertificate() " << id;
|
||||
|
|
|
@ -48,37 +48,37 @@ virtual bool getFriendList(std::list<std::string> &ids);
|
|||
//virtual bool getOthersList(std::list<std::string> &ids);
|
||||
virtual bool getPeerCount (unsigned int *pnFriendCount, unsigned int *pnOnlineCount, bool ssl);
|
||||
|
||||
virtual bool isOnline(std::string id);
|
||||
virtual bool isFriend(std::string id);
|
||||
virtual bool isGPGAccepted(std::string gpg_id_is_friend); //
|
||||
virtual std::string getGPGName(std::string gpg_id);
|
||||
virtual std::string getPeerName(std::string ssl_or_gpg_id);
|
||||
virtual bool getPeerDetails(std::string id, RsPeerDetails &d);
|
||||
virtual bool isOnline(const std::string &id);
|
||||
virtual bool isFriend(const std::string &id);
|
||||
virtual bool isGPGAccepted(const std::string &gpg_id_is_friend); //
|
||||
virtual std::string getGPGName(const std::string &gpg_id);
|
||||
virtual std::string getPeerName(const std::string &ssl_or_gpg_id);
|
||||
virtual bool getPeerDetails(const std::string &id, RsPeerDetails &d);
|
||||
|
||||
/* Using PGP Ids */
|
||||
virtual std::string getGPGOwnId();
|
||||
virtual std::string getGPGId(std::string ssl_id);
|
||||
virtual std::string getGPGId(const std::string &ssl_id);
|
||||
virtual bool getGPGAcceptedList(std::list<std::string> &ids);
|
||||
virtual bool getGPGSignedList(std::list<std::string> &ids);
|
||||
virtual bool getGPGValidList(std::list<std::string> &ids);
|
||||
virtual bool getGPGAllList(std::list<std::string> &ids);
|
||||
virtual bool getGPGDetails(std::string id, RsPeerDetails &d);
|
||||
virtual bool getSSLChildListOfGPGId(std::string gpg_id, std::list<std::string> &ids);
|
||||
virtual bool getGPGDetails(const std::string &id, RsPeerDetails &d);
|
||||
virtual bool getSSLChildListOfGPGId(const std::string &gpg_id, std::list<std::string> &ids);
|
||||
|
||||
/* Add/Remove Friends */
|
||||
virtual bool addFriend(std::string ssl_id, std::string gpg_id);
|
||||
virtual bool addDummyFriend(std::string gpg_id); //we want to add a empty ssl friend for this gpg id
|
||||
virtual bool isDummyFriend(std::string ssl_id);
|
||||
virtual bool removeFriend(std::string ssl_id);
|
||||
virtual bool addFriend(const std::string &ssl_id, const std::string &gpg_id);
|
||||
virtual bool addDummyFriend(const std::string &gpg_id); //we want to add a empty ssl friend for this gpg id
|
||||
virtual bool isDummyFriend(const std::string &ssl_id);
|
||||
virtual bool removeFriend(const std::string &ssl_id);
|
||||
|
||||
/* Network Stuff */
|
||||
virtual bool connectAttempt(std::string id);
|
||||
virtual bool setLocation(std::string ssl_id, std::string location);//location is shown in the gui to differentiate ssl certs
|
||||
virtual bool setLocalAddress(std::string id, std::string addr, uint16_t port);
|
||||
virtual bool setExtAddress(std::string id, std::string addr, uint16_t port);
|
||||
virtual bool setDynDNS(std::string id, std::string dyndns);
|
||||
virtual bool setNetworkMode(std::string id, uint32_t netMode);
|
||||
virtual bool setVisState(std::string id, uint32_t mode);
|
||||
virtual bool connectAttempt(const std::string &id);
|
||||
virtual bool setLocation(const std::string &ssl_id, const std::string &location);//location is shown in the gui to differentiate ssl certs
|
||||
virtual bool setLocalAddress(const std::string &id, const std::string &addr, uint16_t port);
|
||||
virtual bool setExtAddress(const std::string &id, const std::string &addr, uint16_t port);
|
||||
virtual bool setDynDNS(const std::string &id, const std::string &dyndns);
|
||||
virtual bool setNetworkMode(const std::string &id, uint32_t netMode);
|
||||
virtual bool setVisState(const std::string &id, uint32_t mode);
|
||||
|
||||
virtual void getIPServersList(std::list<std::string>& ip_servers) ;
|
||||
virtual void allowServerIPDetermination(bool) ;
|
||||
|
@ -92,14 +92,14 @@ virtual std::string GetRetroshareInvite(const std::string& ssl_id);
|
|||
// same but for own id
|
||||
virtual std::string GetRetroshareInvite();
|
||||
|
||||
virtual bool loadCertificateFromFile(std::string fname, std::string &id, std::string &gpg_id);
|
||||
virtual bool loadDetailsFromStringCert(std::string cert, RsPeerDetails &pd);
|
||||
virtual bool saveCertificateToFile(std::string id, std::string fname);
|
||||
virtual std::string saveCertificateToString(std::string id);
|
||||
virtual bool loadCertificateFromFile(const std::string &fname, std::string &id, std::string &gpg_id);
|
||||
virtual bool loadDetailsFromStringCert(const std::string &cert, RsPeerDetails &pd);
|
||||
virtual bool saveCertificateToFile(const std::string &id, const std::string &fname);
|
||||
virtual std::string saveCertificateToString(const std::string &id);
|
||||
|
||||
virtual bool setAcceptToConnectGPGCertificate(std::string gpg_id, bool acceptance);
|
||||
virtual bool signGPGCertificate(std::string id);
|
||||
virtual bool trustGPGCertificate(std::string id, uint32_t trustlvl);
|
||||
virtual bool setAcceptToConnectGPGCertificate(const std::string &gpg_id, bool acceptance);
|
||||
virtual bool signGPGCertificate(const std::string &id);
|
||||
virtual bool trustGPGCertificate(const std::string &id, uint32_t trustlvl);
|
||||
|
||||
/* Group Stuff */
|
||||
virtual bool addGroup(RsGroupInfo &groupInfo);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue