From 4fabf3deb1654250f7b3f168970cc74d48f782da Mon Sep 17 00:00:00 2001 From: csoler Date: Thu, 19 Sep 2019 21:14:57 +0200 Subject: [PATCH] renamed skip_signature_validation into more appropriate skip_pgp_signature_validation --- libretroshare/src/gossipdiscovery/p3gossipdiscovery.cc | 7 ++++--- libretroshare/src/pqi/authssl.cc | 2 +- libretroshare/src/retroshare/rspeers.h | 2 +- libretroshare/src/rsserver/p3peers.cc | 8 ++++---- retroshare-gui/src/gui/connect/ConnectFriendWizard.cpp | 2 +- 5 files changed, 11 insertions(+), 10 deletions(-) diff --git a/libretroshare/src/gossipdiscovery/p3gossipdiscovery.cc b/libretroshare/src/gossipdiscovery/p3gossipdiscovery.cc index 2001667f1..223d08c7f 100644 --- a/libretroshare/src/gossipdiscovery/p3gossipdiscovery.cc +++ b/libretroshare/src/gossipdiscovery/p3gossipdiscovery.cc @@ -396,7 +396,7 @@ void p3discovery2::recvOwnContactInfo(const RsPeerId &fromId, const RsDiscContac // if the peer is not validated, we stop the exchange here - if(det.skip_signature_validation) + if(det.skip_pgp_signature_validation) { #ifdef P3DISC_DEBUG std::cerr << "p3discovery2::recvOwnContactInfo() missing PGP key " << item->pgpId << " from short invite friend " << fromId << ". Requesting it." << std::endl; @@ -954,6 +954,7 @@ void p3discovery2::processContactInfo(const RsPeerId &fromId, const RsDiscContac auto sit= it->second.mSslIds.find(item->sslId); DiscSslInfo& sslInfo(it->second.mSslIds[item->sslId]); // This line inserts the entry while not removing already existing data + // do not remove it! if (!mPeerMgr->isFriend(item->sslId)) { @@ -1098,7 +1099,7 @@ void p3discovery2::recvPGPCertificate(const RsPeerId& fromId, RsDiscPgpKeyItem* // We treat own pgp keys right away when they are sent by a friend for which we dont have it. This way we can keep the skip_pgg_signature_validation consistent - if(det.skip_signature_validation) + if(det.skip_pgp_signature_validation) { #ifdef P3DISC_DEBUG std::cerr << __PRETTY_FUNCTION__ << " Received own full certificate from short-invite friend " << fromId << std::endl; @@ -1124,7 +1125,7 @@ void p3discovery2::recvPGPCertificate(const RsPeerId& fromId, RsDiscPgpKeyItem* // Make sure we allow connections after the key is added. This is not the case otherwise. We only do that if the peer is non validated peer, since // otherwise the connection should already be accepted. This only happens when the short invite peer sends its own PGP key. - if(det.skip_signature_validation) + if(det.skip_pgp_signature_validation) AuthGPG::getAuthGPG()->AllowConnection(det.gpg_id,true); } diff --git a/libretroshare/src/pqi/authssl.cc b/libretroshare/src/pqi/authssl.cc index 6700a3fde..300bd6110 100644 --- a/libretroshare/src/pqi/authssl.cc +++ b/libretroshare/src/pqi/authssl.cc @@ -1205,7 +1205,7 @@ int AuthSSLimpl::VerifyX509Callback(int /*preverify_ok*/, X509_STORE_CTX* ctx) return verificationFailed; } - bool isSslOnlyFriend = det.skip_signature_validation; + bool isSslOnlyFriend = det.skip_pgp_signature_validation; if(det.gpg_id != pgpId) { diff --git a/libretroshare/src/retroshare/rspeers.h b/libretroshare/src/retroshare/rspeers.h index 383430541..b4b0a64d0 100644 --- a/libretroshare/src/retroshare/rspeers.h +++ b/libretroshare/src/retroshare/rspeers.h @@ -238,7 +238,7 @@ struct RsPeerDetails : RsSerializable uint32_t trustLvl; uint32_t validLvl; - bool skip_signature_validation; + bool skip_pgp_signature_validation; bool ownsign; /* we have signed the remote peer GPG key */ bool hasSignedMe; /* the remote peer has signed my GPG key */ diff --git a/libretroshare/src/rsserver/p3peers.cc b/libretroshare/src/rsserver/p3peers.cc index 4197260cd..6b7592629 100644 --- a/libretroshare/src/rsserver/p3peers.cc +++ b/libretroshare/src/rsserver/p3peers.cc @@ -295,10 +295,10 @@ bool p3Peers::getPeerDetails(const RsPeerId& id, RsPeerDetails &d) return false; d.gpg_id = ps.gpg_id ; - d.skip_signature_validation = true; + d.skip_pgp_signature_validation = true; } else - d.skip_signature_validation = false; + d.skip_pgp_signature_validation = false; d.isOnlyGPGdetail = false; @@ -1386,7 +1386,7 @@ bool p3Peers::parseShortInvite(const std::string& inviteStrUrl, RsPeerDetails& d details.accept_connection = pgp_det.accept_connection; } else - details.skip_signature_validation = true; + details.skip_pgp_signature_validation = true; if(details.gpg_id.isNull()) { @@ -1795,7 +1795,7 @@ RsPeerDetails::RsPeerDetails() :isOnlyGPGdetail(false), name(""),email(""),location(""), org(""),authcode(""), - trustLvl(0), validLvl(0),skip_signature_validation(false),ownsign(false), + trustLvl(0), validLvl(0),skip_pgp_signature_validation(false),ownsign(false), hasSignedMe(false),accept_connection(false), state(0),actAsServer(false), connectPort(0), diff --git a/retroshare-gui/src/gui/connect/ConnectFriendWizard.cpp b/retroshare-gui/src/gui/connect/ConnectFriendWizard.cpp index 3e4bc1ad6..f4d1ba6ed 100755 --- a/retroshare-gui/src/gui/connect/ConnectFriendWizard.cpp +++ b/retroshare-gui/src/gui/connect/ConnectFriendWizard.cpp @@ -702,7 +702,7 @@ void ConnectFriendWizard::accept() { std::cerr << "ConclusionPage::validatePage() accepting GPG key for connection." << std::endl; - if(peerDetails.skip_signature_validation) + if(peerDetails.skip_pgp_signature_validation) rsPeers->addSslOnlyFriend(peerDetails.id, peerDetails.gpg_id,peerDetails); else rsPeers->addFriend(peerDetails.id, peerDetails.gpg_id,serviceFlags()) ;