Addition of several utility functions:

(1) xpgp_id to extract the name/id from a certificate.
(2) dht_bootstrap to check the status of the bootstrap peers.

Various bits of code needed to be rearranged to make these utilities possible.



git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@394 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
drbob 2008-03-21 02:02:58 +00:00
parent e1f4dc1dff
commit 7044822e1f
12 changed files with 651 additions and 31 deletions

View file

@ -370,10 +370,12 @@ int InitRetroShare(int argcIgnored, char **argvIgnored, RsInit *config)
/******************************** WINDOWS/UNIX SPECIFIC PART ******************/
std::string userName;
std::string userId;
bool existingUser = false;
if (LoadCheckXPGPandGetName(config->load_cert.c_str(), userName))
if (LoadCheckXPGPandGetName(config->load_cert.c_str(), userName, userId))
{
std::cerr << "Existing Name: " << userName << std::endl;
std::cerr << "Existing Id: " << userId << std::endl;
existingUser = true;
}
else
@ -773,16 +775,18 @@ int LoadCertificates(RsInit *config, bool autoLoginNT)
bool ValidateCertificate(RsInit *config, std::string &userName)
{
std::string fname = config->load_cert;
std::string userId;
if (fname != "")
{
return LoadCheckXPGPandGetName(fname.c_str(), userName);
return LoadCheckXPGPandGetName(fname.c_str(), userName, userId);
}
return false;
}
bool ValidateTrustedUser(RsInit *config, std::string fname, std::string &userName)
{
bool valid = LoadCheckXPGPandGetName(fname.c_str(), userName);
std::string userId;
bool valid = LoadCheckXPGPandGetName(fname.c_str(), userName, userId);
if (valid)
{
config -> load_trustedpeer = true;