From f5a616519c18ac216df9131235511d7fb3ccba80 Mon Sep 17 00:00:00 2001 From: joss17 Date: Mon, 15 Mar 2010 19:10:46 +0000 Subject: [PATCH] avoid sending bad gpg cert in p3disc git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@2554 b45a01b8-16f6-495d-af2f-9b41ad6348cc --- libretroshare/src/services/p3disc.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/libretroshare/src/services/p3disc.cc b/libretroshare/src/services/p3disc.cc index 9f864defd..b7f5f111f 100644 --- a/libretroshare/src/services/p3disc.cc +++ b/libretroshare/src/services/p3disc.cc @@ -383,7 +383,10 @@ void p3disc::sendPeerDetails(std::string to, std::string about) { } std::string cert = AuthGPG::getAuthGPG()->SaveCertificateToString(about); if (cert == "") { - cert = "No Key"; + #ifdef P3DISC_DEBUG + std::cerr << "p3disc::sendPeerDetails() don't send details because the gpg cert is not good" << std::endl; + #endif + return; } di -> certGPG = cert; @@ -507,7 +510,7 @@ void p3disc::recvPeerDetails(RsDiscReply *item) #endif std::string certGpgId; AuthGPG::getAuthGPG()->LoadCertificateFromString(item->certGPG, certGpgId); - if (item->aboutId != certGpgId) { + if (item->aboutId == "" || item->aboutId != certGpgId) { #ifdef P3DISC_DEBUG std::cerr << "p3disc::recvPeerFriendMsg() Error : about id is not the same as gpg id." << std::endl; #endif