add location to account detail at startup, and improve the peersdialog

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@2075 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
joss17 2010-01-18 22:44:09 +00:00
parent 5f27d75dc4
commit ac580a6c07
10 changed files with 548 additions and 808 deletions

View file

@ -2239,7 +2239,7 @@ int AuthSSL::VerifyX509Callback(int preverify_ok, X509_STORE_CTX *ctx)
// Not dependent on sslroot. load, and detroys the X509 memory.
int LoadCheckX509andGetName(const char *cert_file, std::string &userName, std::string &userId)
int LoadCheckX509andGetLocation(const char *cert_file, std::string &location, std::string &userId)
{
/* This function loads the X509 certificate from the file,
* and checks the certificate
@ -2270,7 +2270,7 @@ int LoadCheckX509andGetName(const char *cert_file, std::string &userName, std::s
if (valid)
{
// extract the name.
userName = getX509CNString(x509->cert_info->subject);
location = getX509LocString(x509->cert_info->subject);
}
std::cout << getX509Info(x509) << std::endl ;

View file

@ -236,7 +236,7 @@ bool getX509id(X509 *x509, std::string &xid);
int LoadCheckX509andGetIssuerName(const char *cert_file,
std::string &issuerName, std::string &userId);
int LoadCheckX509andGetName(const char *cert_file,
std::string &userName, std::string &userId);
int LoadCheckX509andGetLocation(const char *cert_file,
std::string &location, std::string &userId);
#endif // MRK_AUTH_SSL_HEADER

View file

@ -57,7 +57,7 @@ class accountId
std::string pgpEmail;
std::string sslId;
std::string sslName;
std::string location;
};
@ -489,7 +489,7 @@ int RsInit::InitRetroShare(int argcIgnored, char **argvIgnored)
{
std::cerr << " * Preferred * " << std::endl;
userId = it->sslId;
userName = it->sslName;
userName = it->pgpName;
existingUser = true;
}
}
@ -533,7 +533,7 @@ bool RsInit::getAccountIds(std::list<std::string> &ids)
std::cerr << "SSL Id: " << it->sslId << " PGP Id " << it->pgpId <<
std::cerr << " PGP Name: " << it->pgpName;
std::cerr << " PGP Email: " << it->pgpEmail;
std::cerr << " SSL Name: " << it->sslName;
std::cerr << " Location: " << it->location;
std::cerr << std::endl;
ids.push_back(it->sslId);
@ -544,7 +544,7 @@ bool RsInit::getAccountIds(std::list<std::string> &ids)
bool RsInit::getAccountDetails(std::string id,
std::string &gpgId, std::string &gpgName,
std::string &gpgEmail, std::string &sslName)
std::string &gpgEmail, std::string &location)
{
std::list<accountId>::iterator it;
for(it = RsInitConfig::accountIds.begin(); it != RsInitConfig::accountIds.end(); it++)
@ -554,7 +554,7 @@ bool RsInit::getAccountDetails(std::string id,
gpgId = it->pgpId;
gpgName = it->pgpName;
gpgEmail = it->pgpEmail;
sslName = it->sslName;
location = it->location;
return true;
}
}
@ -732,8 +732,8 @@ static bool checkAccount(std::string accountdir, accountId &id)
bool ret = false;
/* check against authmanagers private keys */
LoadCheckX509andGetName(cert_name.c_str(), id.sslName, id.sslId);
std::cerr << "sslName: " << id.sslName << " id: " << id.sslId << std::endl;
LoadCheckX509andGetLocation(cert_name.c_str(), id.location, id.sslId);
std::cerr << "location: " << id.location << " id: " << id.sslId << std::endl;
std::string tmpid;
if (LoadCheckX509andGetIssuerName(cert_name.c_str(), id.pgpId, tmpid))
@ -949,10 +949,10 @@ bool RsInit::GenerateSSLCertificate(std::string gpg_id, std::string org, std
/* try to load it, and get Id */
std::string sslName;
std::string location;
int ret = 0;
ret = LoadCheckX509andGetName(cert_name.c_str(), sslName, sslId);
ret = LoadCheckX509andGetLocation(cert_name.c_str(), location, sslId);
/* Move directory to correct id */
std::string finalbase = RsInitConfig::basedir + RsInitConfig::dirSeperator + sslId + RsInitConfig::dirSeperator;