From fdac22f49cc72d443b96214e8c19f8cb17a24eaf Mon Sep 17 00:00:00 2001 From: csoler Date: Fri, 29 Oct 2021 19:02:09 +0200 Subject: [PATCH] renamed remaining *GPG* names into *PGP* --- .../src/gossipdiscovery/p3gossipdiscovery.cc | 8 +++---- libretroshare/src/pgp/pgpauxutils.cc | 4 ++-- libretroshare/src/pqi/authgpg.cc | 16 +++++++------- libretroshare/src/pqi/authgpg.h | 14 ++++++------ libretroshare/src/pqi/authssl.cc | 8 +++---- libretroshare/src/pqi/p3peermgr.cc | 12 +++++----- libretroshare/src/pqi/pqissl.cc | 2 +- libretroshare/src/pqi/pqissllistener.cc | 2 +- libretroshare/src/rsserver/p3peers.cc | 22 +++++++++---------- libretroshare/src/rsserver/p3serverconfig.cc | 2 +- libretroshare/src/rsserver/rsinit.cc | 4 ++-- libretroshare/src/services/p3idservice.cc | 2 +- 12 files changed, 48 insertions(+), 48 deletions(-) diff --git a/libretroshare/src/gossipdiscovery/p3gossipdiscovery.cc b/libretroshare/src/gossipdiscovery/p3gossipdiscovery.cc index 3f4290dd4..b14efb550 100644 --- a/libretroshare/src/gossipdiscovery/p3gossipdiscovery.cc +++ b/libretroshare/src/gossipdiscovery/p3gossipdiscovery.cc @@ -107,7 +107,7 @@ p3discovery2::p3discovery2( addSerialType(new RsDiscSerialiser()); // Add self into PGP FriendList. - mFriendList[AuthPGP::getGPGOwnId()] = DiscPgpInfo(); + mFriendList[AuthPGP::getPGPOwnId()] = DiscPgpInfo(); } @@ -604,8 +604,8 @@ void p3discovery2::updatePgpFriendList() std::list::iterator lit; std::map::iterator it; - RsPgpId ownPgpId = AuthPGP::getGPGOwnId(); - AuthPGP::getGPGAcceptedList(pgpList); + RsPgpId ownPgpId = AuthPGP::getPGPOwnId(); + AuthPGP::getPGPAcceptedList(pgpList); pgpList.push_back(ownPgpId); // convert to set for ordering. @@ -1058,7 +1058,7 @@ void p3discovery2::recvPGPCertificateRequest( const RsPeerId& fromId, const RsDi return; } - RsPgpId ownPgpId = AuthPGP::getGPGOwnId(); + RsPgpId ownPgpId = AuthPGP::getPGPOwnId(); for(const RsPgpId& pgpId : item->pgpIdSet.ids) if (pgpId == ownPgpId) sendPGPCertificate(pgpId, fromId); diff --git a/libretroshare/src/pgp/pgpauxutils.cc b/libretroshare/src/pgp/pgpauxutils.cc index 99d3e8880..a95424973 100644 --- a/libretroshare/src/pgp/pgpauxutils.cc +++ b/libretroshare/src/pgp/pgpauxutils.cc @@ -34,7 +34,7 @@ PgpAuxUtilsImpl::PgpAuxUtilsImpl() const RsPgpId& PgpAuxUtilsImpl::getPGPOwnId() { - return AuthPGP::getGPGOwnId(); + return AuthPGP::getPGPOwnId(); } RsPgpId PgpAuxUtilsImpl::getPGPId(const RsPeerId& sslid) @@ -59,7 +59,7 @@ bool PgpAuxUtilsImpl::VerifySignBin(const void *data, bool PgpAuxUtilsImpl::getGPGAllList(std::list &ids) { - return AuthPGP::getGPGAllList(ids); + return AuthPGP::getPGPAllList(ids); } bool PgpAuxUtilsImpl::parseSignature(unsigned char *sign, unsigned int signlen, RsPgpId& issuer) const diff --git a/libretroshare/src/pqi/authgpg.cc b/libretroshare/src/pqi/authgpg.cc index 1d0481112..371cebe0d 100644 --- a/libretroshare/src/pqi/authgpg.cc +++ b/libretroshare/src/pqi/authgpg.cc @@ -425,18 +425,18 @@ std::string AuthPGP::getGPGEmail(const RsPgpId& id,bool *success) /**** GPG versions ***/ -const RsPgpId& AuthPGP::getGPGOwnId() +const RsPgpId& AuthPGP::getPGPOwnId() { RsStackMutex stack(instance()->gpgMtxData); /******* LOCKED ******/ return instance()->mOwnGpgId ; } -std::string AuthPGP::getGPGOwnName() +std::string AuthPGP::getPGPOwnName() { return getGPGName(instance()->mOwnGpgId) ; } -bool AuthPGP::getGPGAllList(std::list &ids) +bool AuthPGP::getPGPAllList(std::list &ids) { RsStackMutex stack(instance()->gpgMtxData); /******* LOCKED ******/ @@ -470,7 +470,7 @@ bool AuthPGP::isKeySupported(const RsPgpId& id) return !(pc->_flags & PGPCertificateInfo::PGP_CERTIFICATE_FLAG_UNSUPPORTED_ALGORITHM) ; } -bool AuthPGP::getGPGDetails(const RsPgpId& pgp_id, RsPeerDetails &d) +bool AuthPGP::getPGPDetails(const RsPgpId& pgp_id, RsPeerDetails &d) { RsStackMutex stack(instance()->gpgMtxData); /******* LOCKED ******/ @@ -510,17 +510,17 @@ static bool filter_Validity(const PGPCertificateInfo& /*info*/) { return true ; static bool filter_Accepted(const PGPCertificateInfo& info) { return info._flags & PGPCertificateInfo::PGP_CERTIFICATE_FLAG_ACCEPT_CONNEXION ; } static bool filter_OwnSigned(const PGPCertificateInfo& info) { return info._flags & PGPCertificateInfo::PGP_CERTIFICATE_FLAG_HAS_OWN_SIGNATURE ; } -bool AuthPGP::getGPGValidList(std::list &ids) +bool AuthPGP::getPGPValidList(std::list &ids) { return getGPGFilteredList(ids,&filter_Validity); } -bool AuthPGP::getGPGAcceptedList(std::list &ids) +bool AuthPGP::getPGPAcceptedList(std::list &ids) { return getGPGFilteredList(ids,&filter_Accepted); } -bool AuthPGP::getGPGSignedList(std::list &ids) +bool AuthPGP::getPGPSignedList(std::list &ids) { return getGPGFilteredList(ids,&filter_OwnSigned); } @@ -739,7 +739,7 @@ bool AuthPGP::saveList(bool& cleanup, std::list& lst) std::cerr << "AuthGPG::saveList() called" << std::endl ; #endif std::list ids ; - getGPGAcceptedList(ids) ; // needs to be done before the lock + getPGPAcceptedList(ids) ; // needs to be done before the lock RsStackMutex stack(gpgMtxData); /******* LOCKED ******/ diff --git a/libretroshare/src/pqi/authgpg.h b/libretroshare/src/pqi/authgpg.h index 6081600b5..a94d0161f 100644 --- a/libretroshare/src/pqi/authgpg.h +++ b/libretroshare/src/pqi/authgpg.h @@ -152,19 +152,19 @@ public: static bool exportPublicKey( const RsPgpId& id, unsigned char*& mem_block, size_t& mem_size, bool armoured, bool include_signatures ); /* PGP web of trust management */ - static const RsPgpId& getGPGOwnId(); - static std::string getGPGOwnName(); + static const RsPgpId& getPGPOwnId(); + static std::string getPGPOwnName(); //virtual std::string getGPGOwnEmail(); static bool getKeyFingerprint(const RsPgpId& id,PGPFingerprintType& fp) ; static bool isKeySupported(const RsPgpId &id) ; static bool isPgpPubKeyAvailable(const RsPgpId& pgp_id); static bool haveSecretKey(const RsPgpId &id) ; - static bool getGPGDetails(const RsPgpId& id, RsPeerDetails &d); - static bool getGPGAllList(std::list &ids); - static bool getGPGValidList(std::list &ids); - static bool getGPGAcceptedList(std::list &ids); - static bool getGPGSignedList(std::list &ids); + static bool getPGPDetails(const RsPgpId& id, RsPeerDetails &d); + static bool getPGPAllList(std::list &ids); + static bool getPGPValidList(std::list &ids); + static bool getPGPAcceptedList(std::list &ids); + static bool getPGPSignedList(std::list &ids); static bool importProfile(const std::string& filename,RsPgpId& gpg_id,std::string& import_error) ; static bool importProfileFromString(const std::string& data,RsPgpId& gpg_id,std::string& import_error) ; static bool exportProfile(const std::string& filename,const RsPgpId& gpg_id) ; diff --git a/libretroshare/src/pqi/authssl.cc b/libretroshare/src/pqi/authssl.cc index 75dcf2fe3..cfded5951 100644 --- a/libretroshare/src/pqi/authssl.cc +++ b/libretroshare/src/pqi/authssl.cc @@ -759,7 +759,7 @@ X509 *AuthSSLimpl::SignX509ReqWithGPG(X509_REQ *req, long /*days*/) //long version = 0x00; unsigned long chtype = MBSTRING_UTF8; X509_NAME *issuer_name = X509_NAME_new(); - X509_NAME_add_entry_by_txt(issuer_name, "CN", chtype, (unsigned char *) AuthPGP::getGPGOwnId().toStdString().c_str(), -1, -1, 0); + X509_NAME_add_entry_by_txt(issuer_name, "CN", chtype, (unsigned char *) AuthPGP::getPGPOwnId().toStdString().c_str(), -1, -1, 0); /**** X509_NAME_add_entry_by_NID(issuer_name, 48, 0, (unsigned char *) "email@email.com", -1, -1, 0); @@ -769,7 +769,7 @@ X509 *AuthSSLimpl::SignX509ReqWithGPG(X509_REQ *req, long /*days*/) (unsigned char *) "loc", -1, -1, 0); ****/ - std::cerr << "AuthSSLimpl::SignX509Req() Issuer name: " << AuthPGP::getGPGOwnId().toStdString() << std::endl; + std::cerr << "AuthSSLimpl::SignX509Req() Issuer name: " << AuthPGP::getPGPOwnId().toStdString() << std::endl; #ifdef V07_NON_BACKWARD_COMPATIBLE_CHANGE_002 static const uint64_t CERTIFICATE_SERIAL_NUMBER = RS_CERTIFICATE_VERSION_NUMBER_07_0001 ; @@ -1039,7 +1039,7 @@ bool AuthSSLimpl::AuthX509WithGPG(X509 *x509,bool verbose, uint32_t& diagnostic) { RsPgpId issuer = RsX509Cert::getCertIssuer(*x509); RsPeerDetails pd; - if (!AuthPGP::getGPGDetails(issuer, pd)) + if (!AuthPGP::getPGPDetails(issuer, pd)) { RsInfo() << __PRETTY_FUNCTION__ << " X509 NOT authenticated : " << "AuthGPG::getAuthGPG()->getGPGDetails(" << issuer @@ -1380,7 +1380,7 @@ int AuthSSLimpl::VerifyX509Callback(int /*preverify_ok*/, X509_STORE_CTX* ctx) std::cerr << "******* VerifyX509Callback cert: " << std::hex << ctx->cert < gpgIds; - AuthPGP::getGPGAcceptedList(gpgIds); + AuthPGP::getPGPAcceptedList(gpgIds); // add own gpg id, if we have more than one location std::list ownSslIds; - getAssociatedPeers(AuthPGP::getGPGOwnId(), ownSslIds); + getAssociatedPeers(AuthPGP::getPGPOwnId(), ownSslIds); return gpgIds.size() + ((ownSslIds.size() > 0) ? 1 : 0); } @@ -970,7 +970,7 @@ bool p3PeerMgrIMPL::addFriend(const RsPeerId& input_id, const RsPgpId& input_gpg //Authentication is now tested at connection time, we don't store the ssl cert anymore // - if (!AuthPGP::isPGPAccepted(gpg_id) && gpg_id != AuthPGP::getGPGOwnId()) + if (!AuthPGP::isPGPAccepted(gpg_id) && gpg_id != AuthPGP::getPGPOwnId()) { #ifdef PEER_DEBUG std::cerr << "p3PeerMgrIMPL::addFriend() gpg is not accepted" << std::endl; @@ -2470,7 +2470,7 @@ bool p3PeerMgrIMPL::loadList(std::list& load) setOwnNetworkMode(pitem->netMode); setOwnVisState(pitem->vs_disc, pitem->vs_dht); - mOwnState.gpg_id = AuthPGP::getGPGOwnId(); + mOwnState.gpg_id = AuthPGP::getPGPOwnId(); mOwnState.location = AuthSSL::getAuthSSL()->getOwnLocation(); } else @@ -2642,7 +2642,7 @@ bool p3PeerMgrIMPL::loadList(std::list& load) #endif for(uint32_t i=0;ipgp_ids.size();++i) - if(AuthPGP::isPGPAccepted(sitem->pgp_ids[i]) || sitem->pgp_ids[i] == AuthPGP::getGPGOwnId()) + if(AuthPGP::isPGPAccepted(sitem->pgp_ids[i]) || sitem->pgp_ids[i] == AuthPGP::getPGPOwnId()) { mFriendsPermissionFlags[sitem->pgp_ids[i]] = sitem->service_flags[i] ; #ifdef PEER_DEBUG @@ -2684,7 +2684,7 @@ bool p3PeerMgrIMPL::loadList(std::list& load) for(auto group_pair:groupList) { for(auto profileIdIt(group_pair.second.peerIds.begin());profileIdIt!=group_pair.second.peerIds.end();) - if(AuthPGP::isPGPAccepted(*profileIdIt) || *profileIdIt == AuthPGP::getGPGOwnId()) + if(AuthPGP::isPGPAccepted(*profileIdIt) || *profileIdIt == AuthPGP::getPGPOwnId()) ++profileIdIt; else { diff --git a/libretroshare/src/pqi/pqissl.cc b/libretroshare/src/pqi/pqissl.cc index f56f73180..75ed02faa 100644 --- a/libretroshare/src/pqi/pqissl.cc +++ b/libretroshare/src/pqi/pqissl.cc @@ -1213,7 +1213,7 @@ int pqissl::Authorise_SSL_Connection() } RsPgpId pgpId = RsX509Cert::getCertIssuer(*peercert); - if( !isSslOnlyFriend && pgpId != AuthPGP::getGPGOwnId() && !AuthPGP::isPGPAccepted(pgpId) ) + if( !isSslOnlyFriend && pgpId != AuthPGP::getPGPOwnId() && !AuthPGP::isPGPAccepted(pgpId) ) { RsFatal() << __PRETTY_FUNCTION__ << " pgpId: " << pgpId << " is not friend. It is very unlikely to happen at this " diff --git a/libretroshare/src/pqi/pqissllistener.cc b/libretroshare/src/pqi/pqissllistener.cc index 8986a9a19..9cf2d4aef 100644 --- a/libretroshare/src/pqi/pqissllistener.cc +++ b/libretroshare/src/pqi/pqissllistener.cc @@ -797,7 +797,7 @@ int pqissllistener::completeConnection(int fd, IncomingSSLInfo& info) exit(failure); } - if( !isSslOnlyFriend && pgpId != AuthPGP::getGPGOwnId() && !AuthPGP::isPGPAccepted(pgpId) ) + if( !isSslOnlyFriend && pgpId != AuthPGP::getPGPOwnId() && !AuthPGP::isPGPAccepted(pgpId) ) { RsFatal() << __PRETTY_FUNCTION__ << " pgpId: " << pgpId << " is not friend. It is very unlikely to happen at this " diff --git a/libretroshare/src/rsserver/p3peers.cc b/libretroshare/src/rsserver/p3peers.cc index 48c0b79c2..931b75aa6 100644 --- a/libretroshare/src/rsserver/p3peers.cc +++ b/libretroshare/src/rsserver/p3peers.cc @@ -273,7 +273,7 @@ bool p3Peers::getPeerDetails(const RsPeerId& id, RsPeerDetails &d) if (id == sOwnId) { mPeerMgr->getOwnNetStatus(ps); - ps.gpg_id = AuthPGP::getGPGOwnId(); + ps.gpg_id = AuthPGP::getPGPOwnId(); } else if (!mPeerMgr->getFriendNetStatus(id, ps)) { @@ -597,7 +597,7 @@ std::string p3Peers::getPeerName(const RsPeerId& ssl) #endif std::string name; if (ssl == AuthSSL::getAuthSSL()->OwnId()) - return AuthPGP::getGPGOwnName(); + return AuthPGP::getPGPOwnName(); if (mPeerMgr->getPeerName(ssl, name)) { @@ -617,7 +617,7 @@ bool p3Peers::getGPGAllList(std::list &ids) #endif /* get from mAuthMgr */ - AuthPGP::getGPGAllList(ids); + AuthPGP::getPGPAllList(ids); return true; } @@ -628,7 +628,7 @@ bool p3Peers::getGPGValidList(std::list &ids) #endif /* get from mAuthMgr */ - AuthPGP::getGPGValidList(ids); + AuthPGP::getPGPValidList(ids); return true; } @@ -639,14 +639,14 @@ bool p3Peers::getGPGSignedList(std::list &ids) #endif /* get from mAuthMgr */ - AuthPGP::getGPGSignedList(ids); + AuthPGP::getPGPSignedList(ids); return true; } bool p3Peers::getPgpFriendList(std::vector& pgpIds) { std::list ids; - if(AuthPGP::getGPGAcceptedList(ids)) + if(AuthPGP::getPGPAcceptedList(ids)) { pgpIds.clear(); std::copy(ids.begin(), ids.end(), std::back_inserter(pgpIds)); @@ -660,7 +660,7 @@ bool p3Peers::getGPGAcceptedList(std::list &ids) #ifdef P3PEERS_DEBUG std::cerr << "p3Peers::getGPGAcceptedList()" << std::endl; #endif - AuthPGP::getGPGAcceptedList(ids); + AuthPGP::getPGPAcceptedList(ids); return true; } @@ -691,7 +691,7 @@ bool p3Peers::getGPGDetails(const RsPgpId &pgp_id, RsPeerDetails &d) #endif /* get from mAuthMgr */ - bool res = AuthPGP::getGPGDetails(pgp_id, d); + bool res = AuthPGP::getPGPDetails(pgp_id, d); d.isOnlyGPGdetail = true ; d.service_perm_flags = mPeerMgr->servicePermissionFlags(pgp_id) ; @@ -706,7 +706,7 @@ const RsPgpId& p3Peers::getGPGOwnId() #endif /* get from mAuthMgr */ - return AuthPGP::getGPGOwnId(); + return AuthPGP::getPGPOwnId(); } RsPgpId p3Peers::getGPGId(const RsPeerId& sslid) @@ -718,7 +718,7 @@ RsPgpId p3Peers::getGPGId(const RsPeerId& sslid) /* get from mAuthMgr */ if (sslid == AuthSSL::getAuthSSL()->OwnId()) { - return AuthPGP::getGPGOwnId(); + return AuthPGP::getPGPOwnId(); } peerState pcs; if (mPeerMgr->getFriendNetStatus(sslid, pcs)) @@ -817,7 +817,7 @@ bool p3Peers::removeFriend(const RsPgpId& gpgId) #ifdef P3PEERS_DEBUG std::cerr << "p3Peers::removeFriend() " << gpgId << std::endl; #endif - if (gpgId == AuthPGP::getGPGOwnId()) { + if (gpgId == AuthPGP::getPGPOwnId()) { std::cerr << "p3Peers::removeFriend() ERROR we're not going to remove our own GPG id." << std::endl; return false; } diff --git a/libretroshare/src/rsserver/p3serverconfig.cc b/libretroshare/src/rsserver/p3serverconfig.cc index 2aa859fe1..ae48ebb16 100644 --- a/libretroshare/src/rsserver/p3serverconfig.cc +++ b/libretroshare/src/rsserver/p3serverconfig.cc @@ -140,7 +140,7 @@ bool p3ServerConfig::setConfigurationOption(uint32_t key, const std::string &opt int p3ServerConfig::getConfigNetStatus(RsConfigNetStatus &status) { status.ownId = AuthSSL::getAuthSSL()->OwnId(); - status.ownName = AuthPGP::getGPGOwnName(); + status.ownName = AuthPGP::getPGPOwnName(); // Details from PeerMgr. peerState pstate; diff --git a/libretroshare/src/rsserver/rsinit.cc b/libretroshare/src/rsserver/rsinit.cc index eb2b07790..d4d87ba60 100644 --- a/libretroshare/src/rsserver/rsinit.cc +++ b/libretroshare/src/rsserver/rsinit.cc @@ -910,8 +910,8 @@ int RsServer::StartupRetroShare() /* History Manager */ mHistoryMgr = new p3HistoryMgr(); mPeerMgr = new p3PeerMgrIMPL( AuthSSL::getAuthSSL()->OwnId(), - AuthPGP::getGPGOwnId(), - AuthPGP::getGPGOwnName(), + AuthPGP::getPGPOwnId(), + AuthPGP::getPGPOwnName(), AuthSSL::getAuthSSL()->getOwnLocation()); mNetMgr = new p3NetMgrIMPL(); mLinkMgr = new p3LinkMgrIMPL(mPeerMgr, mNetMgr); diff --git a/libretroshare/src/services/p3idservice.cc b/libretroshare/src/services/p3idservice.cc index 49bfc36dc..bffdaccde 100644 --- a/libretroshare/src/services/p3idservice.cc +++ b/libretroshare/src/services/p3idservice.cc @@ -1067,7 +1067,7 @@ bool p3IdService::createIdentity(uint32_t& token, RsIdentityParameters ¶ms) if(params.isPgpLinked) { - ssdata.pgp.pgpId = AuthPGP::getGPGOwnId(); + ssdata.pgp.pgpId = AuthPGP::getPGPOwnId(); ssdata.pgp.lastCheckTs = time(nullptr); }