mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-11 10:35:22 -04:00
added check for DSA/RSA key algorithm. Disabled make friend, login and cert creation, with unsupported keys
git-svn-id: http://svn.code.sf.net/p/retroshare/code/branches/v0.5-OpenPGP@5221 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
36bec260b9
commit
dba66cdd7a
9 changed files with 65 additions and 30 deletions
|
@ -610,6 +610,10 @@ bool p3Peers::getPeerDetails(const std::string &id, RsPeerDetails &d)
|
|||
}
|
||||
#endif
|
||||
|
||||
bool p3Peers::isKeySupported(const std::string& id)
|
||||
{
|
||||
return AuthGPG::getAuthGPG()->isKeySupported(id);
|
||||
}
|
||||
|
||||
std::string p3Peers::getGPGName(const std::string &gpg_id)
|
||||
{
|
||||
|
|
|
@ -63,6 +63,7 @@ virtual bool getPeerDetails(const std::string &ssl_or_gpg_id, RsPeerDetails &d);
|
|||
/* Using PGP Ids */
|
||||
virtual std::string getGPGOwnId();
|
||||
virtual std::string getGPGId(const std::string &ssl_id);
|
||||
virtual bool isKeySupported(const std::string& ids);
|
||||
virtual bool getGPGAcceptedList(std::list<std::string> &ids);
|
||||
virtual bool getGPGSignedList(std::list<std::string> &ids);
|
||||
virtual bool getGPGValidList(std::list<std::string> &ids);
|
||||
|
|
|
@ -1097,38 +1097,36 @@ static bool checkAccount(std::string accountdir, accountId &id)
|
|||
std::string cert_name = basename + "_cert.pem";
|
||||
std::string userName, userId;
|
||||
|
||||
#ifdef AUTHSSL_DEBUG
|
||||
#ifdef AUTHSSL_DEBUG
|
||||
std::cerr << "checkAccount() dir: " << accountdir << std::endl;
|
||||
#endif
|
||||
|
||||
#endif
|
||||
bool ret = false;
|
||||
|
||||
/* check against authmanagers private keys */
|
||||
if (LoadCheckX509(cert_name.c_str(), id.pgpId, id.location, id.sslId))
|
||||
{
|
||||
#ifdef AUTHSSL_DEBUG
|
||||
std::cerr << "location: " << id.location << " id: " << id.sslId << std::endl;
|
||||
#endif
|
||||
if (LoadCheckX509(cert_name.c_str(), id.pgpId, id.location, id.sslId))
|
||||
{
|
||||
#ifdef AUTHSSL_DEBUG
|
||||
std::cerr << "location: " << id.location << " id: " << id.sslId << std::endl;
|
||||
std::cerr << "issuerName: " << id.pgpId << " id: " << id.sslId << std::endl;
|
||||
#endif
|
||||
|
||||
if(! RsInit::GetPGPLoginDetails(id.pgpId, id.pgpName, id.pgpEmail))
|
||||
return false ;
|
||||
|
||||
#ifdef GPG_DEBUG
|
||||
std::cerr << "issuerName: " << id.pgpId << " id: " << id.sslId << std::endl;
|
||||
#endif
|
||||
if(!AuthGPG::getAuthGPG()->isKeySupported(id.pgpId))
|
||||
return false ;
|
||||
|
||||
if(! RsInit::GetPGPLoginDetails(id.pgpId, id.pgpName, id.pgpEmail))
|
||||
return false ;
|
||||
|
||||
#ifdef GPG_DEBUG
|
||||
std::cerr << "PGPLoginDetails: " << id.pgpId << " name: " << id.pgpName;
|
||||
std::cerr << " email: " << id.pgpEmail << std::endl;
|
||||
#endif
|
||||
ret = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
std::cerr << "GetIssuerName FAILED!" << std::endl;
|
||||
ret = false;
|
||||
}
|
||||
#ifdef GPG_DEBUG
|
||||
std::cerr << "PGPLoginDetails: " << id.pgpId << " name: " << id.pgpName;
|
||||
std::cerr << " email: " << id.pgpEmail << std::endl;
|
||||
#endif
|
||||
ret = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
std::cerr << "GetIssuerName FAILED!" << std::endl;
|
||||
ret = false;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue