renamed isGPGAccepted into isPGPAccepted

This commit is contained in:
csoler 2021-10-29 18:57:58 +02:00
parent b328c3a493
commit 5e37bd42e4
8 changed files with 11 additions and 17 deletions

View File

@ -219,7 +219,7 @@ void p3discovery2::removeFriend(const RsPeerId &sslId)
std::cerr << std::endl;
#endif
/* pgp peer without any ssl entries -> check if they are still a real friend */
if (!(AuthPGP::isGPGAccepted(pgpId)))
if (!(AuthPGP::isPGPAccepted(pgpId)))
{
#ifdef P3DISC_DEBUG
std::cerr << "p3discovery2::addFriend() pgpId is no longer a friend, removing";
@ -1062,7 +1062,7 @@ void p3discovery2::recvPGPCertificateRequest( const RsPeerId& fromId, const RsDi
for(const RsPgpId& pgpId : item->pgpIdSet.ids)
if (pgpId == ownPgpId)
sendPGPCertificate(pgpId, fromId);
else if(ps.vs_disc != RS_VS_DISC_OFF && AuthPGP::isGPGAccepted(pgpId))
else if(ps.vs_disc != RS_VS_DISC_OFF && AuthPGP::isPGPAccepted(pgpId))
sendPGPCertificate(pgpId, fromId);
else
std::cerr << "(WW) not sending certificate " << pgpId << " asked by friend " << fromId << " because this either this cert is not a friend, or discovery is off" << std::endl;

View File

@ -405,10 +405,6 @@ bool AuthPGP::isPGPId(const RsPgpId& id)
{
return instance()->mPgpHandler->isGPGId(id);
}
bool AuthPGP::isPGPAccepted(const RsPgpId& id)
{
return instance()->mPgpHandler->isGPGAccepted(id);
}
/**** These Two are common */
std::string AuthPGP::getGPGEmail(const RsPgpId& id,bool *success)
{
@ -714,7 +710,7 @@ int AuthPGP::privateTrustCertificate(const RsPgpId& id, int trustlvl)
// The trust level is only a user-defined property that has nothing to
// do with the fact that we allow connections or not.
if(!isGPGAccepted(id))
if(!isPGPAccepted(id))
return 0;
int res = instance()->mPgpHandler->privateTrustCertificate(id,trustlvl) ;
@ -732,7 +728,7 @@ RsSerialiser *AuthPGP::setupSerialiser()
rss->addSerialType(new RsGeneralConfigSerialiser());
return rss ;
}
bool AuthPGP::isGPGAccepted(const RsPgpId& id)
bool AuthPGP::isPGPAccepted(const RsPgpId& id)
{
return instance()->mPgpHandler->isGPGAccepted(id);
}

View File

@ -155,8 +155,6 @@ public:
static const RsPgpId& getGPGOwnId();
static std::string getGPGOwnName();
static bool isGPGAccepted(const RsPgpId& id);
//virtual std::string getGPGOwnEmail();
static bool getKeyFingerprint(const RsPgpId& id,PGPFingerprintType& fp) ;
static bool isKeySupported(const RsPgpId &id) ;

View File

@ -1380,7 +1380,7 @@ int AuthSSLimpl::VerifyX509Callback(int /*preverify_ok*/, X509_STORE_CTX* ctx)
std::cerr << "******* VerifyX509Callback cert: " << std::hex << ctx->cert <<std::dec << std::endl;
#endif
if ( !isSslOnlyFriend && pgpId != AuthPGP::getGPGOwnId() && !AuthPGP::isGPGAccepted(pgpId) )
if ( !isSslOnlyFriend && pgpId != AuthPGP::getGPGOwnId() && !AuthPGP::isPGPAccepted(pgpId) )
{
std::string errMsg = "Connection attempt signed by PGP key id: " +
pgpId.toStdString() + " not accepted because it is not"

View File

@ -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::isGPGAccepted(gpg_id) && gpg_id != AuthPGP::getGPGOwnId())
if (!AuthPGP::isPGPAccepted(gpg_id) && gpg_id != AuthPGP::getGPGOwnId())
{
#ifdef PEER_DEBUG
std::cerr << "p3PeerMgrIMPL::addFriend() gpg is not accepted" << std::endl;
@ -2642,7 +2642,7 @@ bool p3PeerMgrIMPL::loadList(std::list<RsItem *>& load)
#endif
for(uint32_t i=0;i<sitem->pgp_ids.size();++i)
if(AuthPGP::isGPGAccepted(sitem->pgp_ids[i]) || sitem->pgp_ids[i] == AuthPGP::getGPGOwnId())
if(AuthPGP::isPGPAccepted(sitem->pgp_ids[i]) || sitem->pgp_ids[i] == AuthPGP::getGPGOwnId())
{
mFriendsPermissionFlags[sitem->pgp_ids[i]] = sitem->service_flags[i] ;
#ifdef PEER_DEBUG
@ -2684,7 +2684,7 @@ bool p3PeerMgrIMPL::loadList(std::list<RsItem *>& load)
for(auto group_pair:groupList)
{
for(auto profileIdIt(group_pair.second.peerIds.begin());profileIdIt!=group_pair.second.peerIds.end();)
if(AuthPGP::isGPGAccepted(*profileIdIt) || *profileIdIt == AuthPGP::getGPGOwnId())
if(AuthPGP::isPGPAccepted(*profileIdIt) || *profileIdIt == AuthPGP::getGPGOwnId())
++profileIdIt;
else
{

View File

@ -1213,7 +1213,7 @@ int pqissl::Authorise_SSL_Connection()
}
RsPgpId pgpId = RsX509Cert::getCertIssuer(*peercert);
if( !isSslOnlyFriend && pgpId != AuthPGP::getGPGOwnId() && !AuthPGP::isGPGAccepted(pgpId) )
if( !isSslOnlyFriend && pgpId != AuthPGP::getGPGOwnId() && !AuthPGP::isPGPAccepted(pgpId) )
{
RsFatal() << __PRETTY_FUNCTION__ << " pgpId: " << pgpId
<< " is not friend. It is very unlikely to happen at this "

View File

@ -797,7 +797,7 @@ int pqissllistener::completeConnection(int fd, IncomingSSLInfo& info)
exit(failure);
}
if( !isSslOnlyFriend && pgpId != AuthPGP::getGPGOwnId() && !AuthPGP::isGPGAccepted(pgpId) )
if( !isSslOnlyFriend && pgpId != AuthPGP::getGPGOwnId() && !AuthPGP::isPGPAccepted(pgpId) )
{
RsFatal() << __PRETTY_FUNCTION__ << " pgpId: " << pgpId
<< " is not friend. It is very unlikely to happen at this "

View File

@ -569,7 +569,7 @@ std::string p3Peers::getGPGName(const RsPgpId &gpg_id)
}
bool p3Peers::isPgpFriend(const RsPgpId& pgpId)
{ return AuthPGP::isGPGAccepted(pgpId); }
{ return AuthPGP::isPGPAccepted(pgpId); }
bool p3Peers::isSslOnlyFriend(const RsPeerId& sslId)
{