mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
fixed additional GPG->Pgp names
This commit is contained in:
parent
7672ffa0ec
commit
7821b29893
@ -1098,7 +1098,7 @@ void p3discovery2::recvPGPCertificate(const RsPeerId& fromId, RsDiscPgpKeyItem*
|
||||
std::string cert_name;
|
||||
std::list<RsPgpId> cert_signers;
|
||||
|
||||
if(!AuthPGP::getGPGDetailsFromBinaryBlock( (unsigned char*)item->bin_data,item->bin_len, cert_pgp_id, cert_name, cert_signers ))
|
||||
if(!AuthPGP::getPgpDetailsFromBinaryBlock( (unsigned char*)item->bin_data,item->bin_len, cert_pgp_id, cert_name, cert_signers ))
|
||||
{
|
||||
std::cerr << "(EE) cannot parse own PGP key sent by " << fromId << std::endl;
|
||||
return;
|
||||
|
@ -4688,7 +4688,7 @@ bool RsGxsNetService::checkPermissionsForFriendGroup(const RsPeerId& sslId,const
|
||||
if(!grpMeta.mInternalCircle.isNull())
|
||||
{
|
||||
RsGroupInfo ginfo ;
|
||||
RsPgpId pgpId = mPgpUtils->getPGPId(sslId) ;
|
||||
RsPgpId pgpId = mPgpUtils->getPgpId(sslId) ;
|
||||
|
||||
#ifdef NXS_NET_DEBUG_4
|
||||
GXSNETDEBUG_PG(sslId,grpMeta.mGroupId) << " Group internal circle: " << grpMeta.mInternalCircle << ", We're owner. Sending to everyone in the group." << std::endl;
|
||||
|
@ -223,7 +223,7 @@ bool GrpCircleVetting::canSend(
|
||||
{
|
||||
if(mCircles->isLoaded(circleId))
|
||||
{
|
||||
const RsPgpId& pgpId = mPgpUtils->getPGPId(peerId);
|
||||
const RsPgpId& pgpId = mPgpUtils->getPgpId(peerId);
|
||||
return mCircles->canSend(circleId, pgpId,should_encrypt);
|
||||
}
|
||||
|
||||
@ -302,7 +302,7 @@ bool MsgCircleIdsRequestVetting::cleared()
|
||||
if(filtered_out_msgs>0)
|
||||
std::cerr << "(WW) " << filtered_out_msgs << " messages not sent because they are signed by author(s) not member of that circle " << mCircleId << std::endl;
|
||||
|
||||
RsPgpId pgpId = mPgpUtils->getPGPId(mPeerId);
|
||||
RsPgpId pgpId = mPgpUtils->getPgpId(mPeerId);
|
||||
bool can_send_res = mCircles->canSend(mCircleId, pgpId,mShouldEncrypt);
|
||||
|
||||
if(mShouldEncrypt) // that means the circle is external
|
||||
|
@ -37,7 +37,7 @@ const RsPgpId& PgpAuxUtilsImpl::getPGPOwnId()
|
||||
return AuthPGP::getPgpOwnId();
|
||||
}
|
||||
|
||||
RsPgpId PgpAuxUtilsImpl::getPGPId(const RsPeerId& sslid)
|
||||
RsPgpId PgpAuxUtilsImpl::getPgpId(const RsPeerId& sslid)
|
||||
{
|
||||
return rsPeers->getGPGId(sslid);
|
||||
}
|
||||
@ -57,7 +57,7 @@ bool PgpAuxUtilsImpl::VerifySignBin(const void *data,
|
||||
return AuthPGP::VerifySignBin(data, len, sign, signlen, withfingerprint);
|
||||
}
|
||||
|
||||
bool PgpAuxUtilsImpl::getGPGAllList(std::list<RsPgpId> &ids)
|
||||
bool PgpAuxUtilsImpl::getPgpAllList(std::list<RsPgpId> &ids)
|
||||
{
|
||||
return AuthPGP::getPgpAllList(ids);
|
||||
}
|
||||
|
@ -35,8 +35,8 @@ class PgpAuxUtils
|
||||
virtual ~PgpAuxUtils(){}
|
||||
|
||||
virtual const RsPgpId &getPGPOwnId() = 0;
|
||||
virtual RsPgpId getPGPId(const RsPeerId& sslid) = 0;
|
||||
virtual bool getGPGAllList(std::list<RsPgpId> &ids) = 0;
|
||||
virtual RsPgpId getPgpId(const RsPeerId& sslid) = 0;
|
||||
virtual bool getPgpAllList(std::list<RsPgpId> &ids) = 0;
|
||||
virtual bool getKeyFingerprint(const RsPgpId& id,PGPFingerprintType& fp) const = 0;
|
||||
|
||||
virtual bool parseSignature(unsigned char *sign, unsigned int signlen, RsPgpId& issuer) const =0;
|
||||
@ -49,12 +49,12 @@ public:
|
||||
PgpAuxUtilsImpl();
|
||||
|
||||
virtual const RsPgpId &getPGPOwnId();
|
||||
virtual RsPgpId getPGPId(const RsPeerId& sslid);
|
||||
virtual RsPgpId getPgpId(const RsPeerId& sslid);
|
||||
|
||||
virtual bool parseSignature(unsigned char *sign, unsigned int signlen, RsPgpId& issuer) const ;
|
||||
virtual bool getKeyFingerprint(const RsPgpId& id,PGPFingerprintType& fp) const;
|
||||
virtual bool VerifySignBin(const void *data, uint32_t len, unsigned char *sign, unsigned int signlen, const PGPFingerprintType& withfingerprint);
|
||||
virtual bool getGPGAllList(std::list<RsPgpId> &ids);
|
||||
virtual bool getPgpAllList(std::list<RsPgpId> &ids);
|
||||
};
|
||||
|
||||
|
||||
|
@ -54,11 +54,11 @@ void cleanupZombies(int numkill); // function to cleanup zombies under OSX.
|
||||
|
||||
/* Function to sign X509_REQ via GPGme. */
|
||||
|
||||
int AuthPGP::availableGPGCertificatesWithPrivateKeys(std::list<RsPgpId>& pgpIds)
|
||||
int AuthPGP::availablePgpCertificatesWithPrivateKeys(std::list<RsPgpId>& pgpIds)
|
||||
{
|
||||
return instance()->mPgpHandler->availableGPGCertificatesWithPrivateKeys(pgpIds);
|
||||
}
|
||||
bool AuthPGP::getGPGDetailsFromBinaryBlock(const unsigned char *mem,size_t mem_size,RsPgpId& key_id, std::string& name, std::list<RsPgpId>& signers)
|
||||
bool AuthPGP::getPgpDetailsFromBinaryBlock(const unsigned char *mem,size_t mem_size,RsPgpId& key_id, std::string& name, std::list<RsPgpId>& signers)
|
||||
{
|
||||
return instance()->mPgpHandler->getGPGDetailsFromBinaryBlock(mem,mem_size,key_id,name,signers);
|
||||
}
|
||||
@ -178,7 +178,7 @@ AuthPGP::AuthPGP(const std::string& path_to_public_keyring,const std::string& pa
|
||||
* This function must be called successfully (return == 1)
|
||||
* before anything else can be done. (except above fn).
|
||||
*/
|
||||
int AuthPGP::GPGInit(const RsPgpId &ownId)
|
||||
int AuthPGP::PgpInit(const RsPgpId &ownId)
|
||||
{
|
||||
#ifdef DEBUG_AUTHGPG
|
||||
std::cerr << "AuthGPG::GPGInit() called with own gpg id : " << ownId.toStdString() << std::endl;
|
||||
@ -365,7 +365,7 @@ bool AuthPGP::active()
|
||||
return instance()->gpgKeySelected;
|
||||
}
|
||||
|
||||
bool AuthPGP::GeneratePGPCertificate(const std::string& name, const std::string& email, const std::string& passwd, RsPgpId& pgpId, const int keynumbits, std::string& errString)
|
||||
bool AuthPGP::GeneratePgpCertificate(const std::string& name, const std::string& email, const std::string& passwd, RsPgpId& pgpId, const int keynumbits, std::string& errString)
|
||||
{
|
||||
RsStackMutex stack(instance()->gpgMtxEngine); /******* LOCKED ******/
|
||||
|
||||
|
@ -129,11 +129,11 @@ public:
|
||||
|
||||
/* Init by generating new Own PGP Cert, or selecting existing PGP Cert */
|
||||
|
||||
static int GPGInit(const RsPgpId &ownId);
|
||||
static bool GeneratePGPCertificate(const std::string& name, const std::string& email, const std::string& passwd, RsPgpId &pgpId, const int keynumbits, std::string &errString);
|
||||
static int PgpInit(const RsPgpId &ownId);
|
||||
static bool GeneratePgpCertificate(const std::string& name, const std::string& email, const std::string& passwd, RsPgpId &pgpId, const int keynumbits, std::string &errString);
|
||||
|
||||
static bool getGPGDetailsFromBinaryBlock(const unsigned char *mem,size_t mem_size,RsPgpId& key_id, std::string& name, std::list<RsPgpId>& signers) ;
|
||||
static int availableGPGCertificatesWithPrivateKeys(std::list<RsPgpId>& pgpIds);
|
||||
static bool getPgpDetailsFromBinaryBlock(const unsigned char *mem,size_t mem_size,RsPgpId& key_id, std::string& name, std::list<RsPgpId>& signers) ;
|
||||
static int availablePgpCertificatesWithPrivateKeys(std::list<RsPgpId>& pgpIds);
|
||||
|
||||
/*********************************************************************************/
|
||||
/************************* STAGE 3 ***********************************************/
|
||||
|
@ -1670,7 +1670,7 @@ bool p3Peers::loadDetailsFromStringCert( const std::string &certstr,
|
||||
|
||||
RsCertificate& cert = *certPtr;
|
||||
|
||||
if(!AuthPGP::getGPGDetailsFromBinaryBlock( cert.pgp_key(), cert.pgp_key_size(), pd.gpg_id, pd.name, pd.gpgSigners ))
|
||||
if(!AuthPGP::getPgpDetailsFromBinaryBlock( cert.pgp_key(), cert.pgp_key_size(), pd.gpg_id, pd.name, pd.gpgSigners ))
|
||||
return false;
|
||||
|
||||
Dbg4() << __PRETTY_FUNCTION__ << " Parsing cert for sslid, location, ext "
|
||||
|
@ -853,7 +853,7 @@ static bool checkAccount(const std::string &accountdir, AccountDetails &account,
|
||||
/* Generating GPGme Account */
|
||||
int RsAccountsDetail::GetPGPLogins(std::list<RsPgpId>& pgpIds)
|
||||
{
|
||||
AuthPGP::availableGPGCertificatesWithPrivateKeys(pgpIds);
|
||||
AuthPGP::availablePgpCertificatesWithPrivateKeys(pgpIds);
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -887,7 +887,7 @@ bool RsAccountsDetail::SelectPGPAccount(const RsPgpId& pgpId)
|
||||
{
|
||||
bool retVal = false;
|
||||
|
||||
if (0 < AuthPGP::GPGInit(pgpId))
|
||||
if (0 < AuthPGP::PgpInit(pgpId))
|
||||
{
|
||||
retVal = true;
|
||||
#ifdef DEBUG_ACCOUNTS
|
||||
@ -907,7 +907,7 @@ bool RsAccountsDetail::SelectPGPAccount(const RsPgpId& pgpId)
|
||||
|
||||
bool RsAccountsDetail::GeneratePGPCertificate(const std::string& name, const std::string& email, const std::string& passwd, RsPgpId &pgpId, const int keynumbits, std::string &errString)
|
||||
{
|
||||
return AuthPGP::GeneratePGPCertificate(name, email, passwd, pgpId, keynumbits, errString);
|
||||
return AuthPGP::GeneratePgpCertificate(name, email, passwd, pgpId, keynumbits, errString);
|
||||
}
|
||||
|
||||
// PGP Support Functions.
|
||||
|
@ -510,7 +510,7 @@ RsInit::LoadCertificateStatus RsInit::LockAndLoadCertificates(
|
||||
if(!RsAccounts::GetAccountDetails(accountId, pgpId, pgpName, pgpEmail, location))
|
||||
throw RsInit::ERR_UNKNOWN; // invalid PreferredAccount;
|
||||
|
||||
if(0 == AuthPGP::GPGInit(pgpId))
|
||||
if(0 == AuthPGP::PgpInit(pgpId))
|
||||
throw RsInit::ERR_UNKNOWN; // PGP Error.
|
||||
|
||||
LoadCertificateStatus retVal =
|
||||
|
@ -4096,7 +4096,7 @@ void p3IdService::getPgpIdList()
|
||||
#endif // DEBUG_IDS
|
||||
|
||||
std::list<RsPgpId> list;
|
||||
mPgpUtils->getGPGAllList(list);
|
||||
mPgpUtils->getPgpAllList(list);
|
||||
|
||||
RsStackMutex stack(mIdMtx); /********** STACK LOCKED MTX ******/
|
||||
|
||||
@ -4593,7 +4593,7 @@ void p3IdService::generateDummy_FriendPGP()
|
||||
// Now Generate for friends.
|
||||
std::list<RsPgpId> gpgids;
|
||||
std::list<RsPgpId>::const_iterator it;
|
||||
mPgpUtils->getGPGAllList(gpgids);
|
||||
mPgpUtils->getPgpAllList(gpgids);
|
||||
|
||||
RsGxsIdGroup id;
|
||||
|
||||
|
@ -134,11 +134,11 @@ const RsPgpId& rs_nxs_test::RsDummyPgpUtils::getPGPOwnId() {
|
||||
return mOwnId;
|
||||
}
|
||||
|
||||
RsPgpId rs_nxs_test::RsDummyPgpUtils::getPGPId(const RsPeerId& /*sslid*/) {
|
||||
RsPgpId rs_nxs_test::RsDummyPgpUtils::getPgpId(const RsPeerId& /*sslid*/) {
|
||||
return RsPgpId().random();
|
||||
}
|
||||
|
||||
bool rs_nxs_test::RsDummyPgpUtils::getGPGAllList(std::list<RsPgpId>& /*ids*/) {
|
||||
bool rs_nxs_test::RsDummyPgpUtils::getPgpAllList(std::list<RsPgpId>& /*ids*/) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -164,8 +164,8 @@ namespace rs_nxs_test
|
||||
|
||||
virtual ~RsDummyPgpUtils(){}
|
||||
const RsPgpId &getPGPOwnId() ;
|
||||
RsPgpId getPGPId(const RsPeerId& sslid) ;
|
||||
bool getGPGAllList(std::list<RsPgpId> &ids) ;
|
||||
RsPgpId getPgpId(const RsPeerId& sslid) ;
|
||||
bool getPgpAllList(std::list<RsPgpId> &ids) ;
|
||||
bool getKeyFingerprint(const RsPgpId& id,PGPFingerprintType& fp) const;
|
||||
|
||||
bool parseSignature(unsigned char *sign, unsigned int signlen, RsPgpId& issuer) const;
|
||||
|
@ -24,7 +24,7 @@
|
||||
|
||||
FakePgpAuxUtils::FakePgpAuxUtils(const RsPeerId& ownId)
|
||||
{
|
||||
mOwnId = getPGPId(ownId);
|
||||
mOwnId = getPgpId(ownId);
|
||||
addPeerIdToPgpList(ownId);
|
||||
}
|
||||
|
||||
@ -39,7 +39,7 @@ void FakePgpAuxUtils::addPeerListToPgpList(const std::list<RsPeerId> &ids)
|
||||
|
||||
void FakePgpAuxUtils::addPeerIdToPgpList(const RsPeerId &id)
|
||||
{
|
||||
RsPgpId pgpId = getPGPId(id);
|
||||
RsPgpId pgpId = getPgpId(id);
|
||||
if (mPgpList.end() == std::find(mPgpList.begin(), mPgpList.end(), pgpId))
|
||||
{
|
||||
mPgpList.push_back(pgpId);
|
||||
@ -51,7 +51,7 @@ const RsPgpId & FakePgpAuxUtils::getPGPOwnId()
|
||||
return mOwnId;
|
||||
}
|
||||
|
||||
RsPgpId FakePgpAuxUtils::getPGPId(const RsPeerId& sslid)
|
||||
RsPgpId FakePgpAuxUtils::getPgpId(const RsPeerId& sslid)
|
||||
{
|
||||
/* convert an sslId */
|
||||
std::string idstring = sslid.toStdString();
|
||||
@ -95,7 +95,7 @@ bool FakePgpAuxUtils::VerifySignBin(const void* /*data*/, uint32_t /*len*/, unsi
|
||||
return true;
|
||||
}
|
||||
|
||||
bool FakePgpAuxUtils::getGPGAllList(std::list<RsPgpId> &ids)
|
||||
bool FakePgpAuxUtils::getPgpAllList(std::list<RsPgpId> &ids)
|
||||
{
|
||||
ids = mPgpList;
|
||||
return true;
|
||||
|
@ -28,7 +28,7 @@ public:
|
||||
FakePgpAuxUtils(const RsPeerId& ownId);
|
||||
|
||||
virtual const RsPgpId &getPGPOwnId();
|
||||
virtual RsPgpId getPGPId(const RsPeerId& sslid);
|
||||
virtual RsPgpId getPgpId(const RsPeerId& sslid);
|
||||
virtual bool getKeyFingerprint(const RsPgpId& id,PGPFingerprintType& fp) const;
|
||||
|
||||
virtual bool parseSignature(unsigned char *sign, unsigned int signlen, RsPgpId& issuer) const;
|
||||
@ -36,7 +36,7 @@ public:
|
||||
|
||||
virtual void addPeerListToPgpList(const std::list<RsPeerId> &ids);
|
||||
virtual void addPeerIdToPgpList(const RsPeerId &id);
|
||||
virtual bool getGPGAllList(std::list<RsPgpId> &ids);
|
||||
virtual bool getPgpAllList(std::list<RsPgpId> &ids);
|
||||
private:
|
||||
RsPgpId mOwnId;
|
||||
std::list<RsPgpId> mPgpList;
|
||||
|
Loading…
Reference in New Issue
Block a user