From a38ae6241e6555bf4aba8163e17751d10ee20158 Mon Sep 17 00:00:00 2001 From: csoler Date: Tue, 15 Jun 2010 21:21:39 +0000 Subject: [PATCH] corrected bug responsible for mixing IP lists between peers of same GPG id (connection attempt to other peer responded with connection to oneself). Added additional debug info in p3disc. git-svn-id: http://svn.code.sf.net/p/retroshare/code/branches/v0.5.0@3143 b45a01b8-16f6-495d-af2f-9b41ad6348cc --- libretroshare/src/pqi/authssl.cc | 4 ++++ libretroshare/src/services/p3disc.cc | 8 ++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/libretroshare/src/pqi/authssl.cc b/libretroshare/src/pqi/authssl.cc index f3c4dc8d7..87cf41f0d 100644 --- a/libretroshare/src/pqi/authssl.cc +++ b/libretroshare/src/pqi/authssl.cc @@ -2048,6 +2048,10 @@ int AuthSSL::VerifyX509Callback(int preverify_ok, X509_STORE_CTX *ctx) //sslcert *cert = NULL; std::string certId; getX509id(X509_STORE_CTX_get_current_cert(ctx), certId); + + if(certId == mConnMgr->getOwnId()) + return false ; + if (!mConnMgr->isFriend(certId)) { //we've got a new ssl id preverify_ok = false; diff --git a/libretroshare/src/services/p3disc.cc b/libretroshare/src/services/p3disc.cc index c8da46d79..79546df31 100644 --- a/libretroshare/src/services/p3disc.cc +++ b/libretroshare/src/services/p3disc.cc @@ -539,8 +539,8 @@ void p3disc::recvPeerDetails(RsDiscReply *item) addDiscoveryData(item->PeerId(), pitem->pid, pitem->currentlocaladdr, pitem->currentremoteaddr, 0, time(NULL)); - #ifdef P3DISC_DEBUG - std::cerr << "p3disc::recvPeerFriendMsg() Peer Config Item:" << std::endl; +#ifdef P3DISC_DEBUG + std::cerr << "p3disc::recvPeerFriendMsg() Peer Config Item:" << std::endl; pitem->print(std::cerr, 10); std::cerr << std::endl; #endif @@ -595,6 +595,10 @@ void p3disc::recvPeerDetails(RsDiscReply *item) } #ifdef P3DISC_DEBUG std::cerr << "Friend is already connected -> not updating" << std::endl; + + std::cerr << "Setting address list to peer " << pitem->pid << ", to be:" << std::endl ; + for(std::list::const_iterator it(pitem->ipAddressList.begin());it!=pitem->ipAddressList.end();++it) + std::cerr << " " << (*it).ipAddr << " (" << (*it).seenTime << ")" << std::endl ; #endif // allways update address list, except if it's ours