make it compile

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@2002 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
joss17 2010-01-13 20:58:58 +00:00
parent c23407cae3
commit a0a64fb588
17 changed files with 188 additions and 191 deletions

View file

@ -103,8 +103,8 @@ int RsServer::UpdateAllConfig()
RsConfig &config = iface.mConfig;
config.ownId = getAuthSSL()->OwnId();
config.ownName = getAuthSSL()->getName(config.ownId);
config.ownId = AuthSSL::getAuthSSL()->OwnId();
config.ownName = AuthSSL::getAuthSSL()->getName(config.ownId);
peerConnectState pstate;
mConnMgr->getOwnNetStatus(pstate);
@ -157,7 +157,7 @@ void RsServer::ConfigFinalSave()
/* force saving of transfers TODO */
//ftserver->saveFileTransferStatus();
getAuthSSL()->FinalSaveCertificates();
AuthSSL::getAuthSSL()->FinalSaveCertificates();
mConfigMgr->completeConfiguration();
}

View file

@ -245,7 +245,7 @@ void RsServer::run()
//ftserver->saveFileTransferStatus();
/* see if we need to resave certs */
getAuthSSL()->CheckSaveCertificates();
AuthSSL::getAuthSSL()->CheckSaveCertificates();
/* hour loop */
if (++min >= 60)

View file

@ -156,7 +156,7 @@ bool p3Msgs::getNewChat(std::list<ChatInfo> &chats)
void p3Msgs::initRsChatInfo(RsChatMsgItem *c, ChatInfo &i)
{
i.rsid = c -> PeerId();
i.name = getAuthSSL()->getName(i.rsid);
i.name = AuthSSL::getAuthSSL()->getName(i.rsid);
i.chatflags = 0 ;
i.msg = c -> message;

View file

@ -27,6 +27,7 @@
#include "rsserver/p3face.h"
#include "pqi/p3connmgr.h"
#include "pqi/authssl.h"
#include "pqi/authgpg.h"
#include <rsiface/rsinit.h>
#include <iostream>
@ -202,7 +203,7 @@ std::string p3Peers::getOwnId()
std::cerr << std::endl;
#endif
return getAuthSSL()->OwnId();
return AuthSSL::getAuthSSL()->OwnId();
}
bool p3Peers::getOnlineList(std::list<std::string> &ids)
@ -237,7 +238,7 @@ bool p3Peers::getOthersList(std::list<std::string> &ids)
#endif
/* get from mAuthMgr */
getAuthSSL()->getAllList(ids);
AuthSSL::getAuthSSL()->getAllList(ids);
return true;
}
@ -260,7 +261,7 @@ bool p3Peers::isOnline(std::string id)
bool p3Peers::isTrustingMe(std::string id) const
{
return getAuthSSL()->isTrustingMe(id) ;
return AuthSSL::getAuthSSL()->isTrustingMe(id) ;
}
bool p3Peers::isFriend(std::string id)
@ -302,7 +303,7 @@ bool p3Peers::getPeerDetails(std::string id, RsPeerDetails &d)
/* get from mAuthMgr (first) */
sslcert authDetail;
if (!getAuthSSL()->getCertDetails(id, authDetail))
if (!AuthSSL::getAuthSSL()->getCertDetails(id, authDetail))
{
return false;
}
@ -317,7 +318,7 @@ bool p3Peers::getPeerDetails(std::string id, RsPeerDetails &d)
d.issuer = authDetail.issuer;
d.trusted = getAuthGPG()->isPGPAuthenticated(getAuthSSL()->getGPGId(id));
d.trusted = AuthGPG::getAuthGPG()->isPGPAuthenticated(AuthSSL::getAuthSSL()->getGPGId(id));
/* generate */
@ -326,7 +327,7 @@ bool p3Peers::getPeerDetails(std::string id, RsPeerDetails &d)
/* get from mConnectMgr */
peerConnectState pcs;
if (id == getAuthSSL()->OwnId())
if (id == AuthSSL::getAuthSSL()->OwnId())
{
mConnMgr->getOwnNetStatus(pcs);
}
@ -470,7 +471,7 @@ bool p3Peers::getPeerDetails(std::string id, RsPeerDetails &d)
std::string p3Peers::getPeerPGPName(std::string id)
{
/* get from mAuthMgr as it should have more peers? */
return getAuthSSL()->getIssuerName(id);
return AuthSSL::getAuthSSL()->getIssuerName(id);
}
std::string p3Peers::getPeerName(std::string id)
@ -481,7 +482,7 @@ std::string p3Peers::getPeerName(std::string id)
#endif
/* get from mAuthMgr as it should have more peers? */
return getAuthSSL()->getName(id);
return AuthSSL::getAuthSSL()->getName(id);
}
@ -501,7 +502,7 @@ bool p3Peers::getPGPFriendList(std::list<std::string> &ids)
for(it = certids.begin(); it != certids.end(); it++)
{
sslcert detail;
if (!getAuthSSL()->getCertDetails(*it, detail))
if (!AuthSSL::getAuthSSL()->getCertDetails(*it, detail))
{
continue;
}
@ -544,7 +545,7 @@ bool p3Peers::getPGPAllList(std::list<std::string> &ids)
#endif
/* get from mAuthMgr */
getAuthGPG()->getPGPAllList(ids);
AuthGPG::getAuthGPG()->getPGPAllList(ids);
return true;
}
@ -556,7 +557,7 @@ std::string p3Peers::getPGPOwnId()
#endif
/* get from mAuthMgr */
return getAuthGPG()->PGPOwnId();
return AuthGPG::getAuthGPG()->PGPOwnId();
}
@ -734,12 +735,12 @@ p3Peers::GetRetroshareInvite()
std::cerr << "p3Peers::GetRetroshareInvite()";
std::cerr << std::endl;
std::string ownId = getAuthSSL()->OwnId();
std::string certstr = getAuthSSL()->SaveCertificateToString(ownId);
std::string name = getAuthSSL()->getName(ownId);
std::string ownId = AuthSSL::getAuthSSL()->OwnId();
std::string certstr = AuthSSL::getAuthSSL()->SaveCertificateToString(ownId);
std::string name = AuthSSL::getAuthSSL()->getName(ownId);
std::string pgpownId = getAuthGPG()->PGPOwnId();
std::string pgpcertstr = getAuthGPG()->SaveCertificateToString(pgpownId);
std::string pgpownId = AuthGPG::getAuthGPG()->PGPOwnId();
std::string pgpcertstr = AuthGPG::getAuthGPG()->SaveCertificateToString(pgpownId);
std::cerr << "p3Peers::GetRetroshareInvite() SSL Cert:";
std::cerr << std::endl;
@ -768,7 +769,7 @@ bool p3Peers::LoadCertificateFromFile(std::string fname, std::string &id)
std::cerr << std::endl;
#endif
return getAuthSSL()->LoadCertificateFromFile(fname, id);
return AuthSSL::getAuthSSL()->LoadCertificateFromFile(fname, id);
}
@ -833,14 +834,14 @@ bool p3Peers::LoadCertificateFromString(std::string cert, std::string &id)
std::cerr << "pgpcert .... " << std::endl;
std::cerr << pgpcert << std::endl;
ret = getAuthGPG()->LoadCertificateFromString(pgpcert);
ret = AuthGPG::getAuthGPG()->LoadCertificateFromString(pgpcert);
}
if (sslcert != "")
{
std::cerr << "sslcert .... " << std::endl;
std::cerr << sslcert << std::endl;
ret = getAuthSSL()->LoadCertificateFromString(sslcert, id);
ret = AuthSSL::getAuthSSL()->LoadCertificateFromString(sslcert, id);
}
}
@ -860,7 +861,7 @@ bool p3Peers::SaveCertificateToFile(std::string id, std::string fname)
ensureExtension(fname, "pqi");
return getAuthSSL()->SaveCertificateToFile(id, fname);
return AuthSSL::getAuthSSL()->SaveCertificateToFile(id, fname);
}
std::string p3Peers::SaveCertificateToString(std::string id)
@ -870,7 +871,7 @@ std::string p3Peers::SaveCertificateToString(std::string id)
std::cerr << std::endl;
#endif
return getAuthSSL()->SaveCertificateToString(id);
return AuthSSL::getAuthSSL()->SaveCertificateToString(id);
}
bool p3Peers::AuthCertificate(std::string id, std::string code)
@ -880,7 +881,7 @@ bool p3Peers::AuthCertificate(std::string id, std::string code)
std::cerr << std::endl;
#endif
if (getAuthSSL()->AuthCertificate(id))
if (AuthSSL::getAuthSSL()->AuthCertificate(id))
{
#ifdef P3PEERS_DEBUG
std::cerr << "p3Peers::AuthCertificate() OK ... Adding as Friend";
@ -900,7 +901,7 @@ bool p3Peers::SignCertificate(std::string id)
std::cerr << std::endl;
#endif
return getAuthSSL()->SignCertificate(id);
return AuthSSL::getAuthSSL()->SignCertificate(id);
}
bool p3Peers::TrustCertificate(std::string id, bool trust)
@ -910,7 +911,7 @@ bool p3Peers::TrustCertificate(std::string id, bool trust)
std::cerr << std::endl;
#endif
return getAuthSSL()->TrustCertificate(id, trust);
return AuthSSL::getAuthSSL()->TrustCertificate(id, trust);
}

View file

@ -469,7 +469,7 @@ int RsInit::InitRetroShare(int argcIgnored, char **argvIgnored)
* 2) Get List of Available Accounts.
* 4) Get List of GPG Accounts.
*/
getAuthSSL() -> InitAuth(NULL, NULL, NULL);
AuthSSL::getAuthSSL() -> InitAuth(NULL, NULL, NULL);
// first check config directories, and set bootstrap values.
setupBaseDir();
@ -767,12 +767,12 @@ static bool checkAccount(std::string accountdir, accountId &id)
/* Generating GPGme Account */
int RsInit::GetPGPLogins(std::list<std::string> &pgpIds) {
getAuthGPG()->availablePGPCertificates(pgpIds);
AuthGPG::getAuthGPG()->availablePGPCertificates(pgpIds);
return 1;
}
bool RsInit::getPGPEngineFileName(std::string &fileName) {
return getAuthGPG()->getPGPEngineFileName(fileName);
return AuthGPG::getAuthGPG()->getPGPEngineFileName(fileName);
}
int RsInit::GetPGPLoginDetails(std::string id, std::string &name, std::string &email)
@ -780,8 +780,8 @@ int RsInit::GetPGPLoginDetails(std::string id, std::string &name, std::stri
std::cerr << "RsInit::GetPGPLoginDetails for \"" << id << "\"";
std::cerr << std::endl;
name = getAuthGPG()->getPGPName(getAuthSSL()->getGPGId(id));
email = getAuthGPG()->getPGPEmail(getAuthSSL()->getGPGId(id));
name = AuthGPG::getAuthGPG()->getPGPName(AuthSSL::getAuthSSL()->getGPGId(id));
email = AuthGPG::getAuthGPG()->getPGPEmail(AuthSSL::getAuthSSL()->getGPGId(id));
if (name != "") {
return 1;
} else {
@ -798,8 +798,7 @@ bool RsInit::SelectGPGAccount(std::string id)
std::string gpgId = id;
std::string name = id;
GPGAuthMgr *gpgAuthMgr = getAuthGPG();
if (0 < gpgAuthMgr -> GPGInit(gpgId))
if (0 < AuthGPG::getAuthGPG() -> GPGInit(gpgId))
{
ok = true;
std::cerr << "PGP Auth Success!";
@ -818,10 +817,9 @@ bool RsInit::SelectGPGAccount(std::string id)
bool RsInit::LoadGPGPassword(std::string inPGPpasswd)
{
GPGAuthMgr *gpgAuthMgr =getAuthGPG();
bool ok = false;
if (0 < gpgAuthMgr -> LoadGPGPassword(inPGPpasswd))
if (0 < AuthGPG::getAuthGPG() -> LoadGPGPassword(inPGPpasswd))
{
ok = true;
std::cerr << "PGP LoadPwd Success!";
@ -994,7 +992,7 @@ bool RsInit::GenerateSSLCertificate(std::string name, std::string org, std::
nbits, errString);
long days = 3000;
X509 *x509 = getAuthSSL()->SignX509Req(req, days);
X509 *x509 = AuthSSL::getAuthSSL()->SignX509Req(req, days);
X509_REQ_free(req);
if (x509 == NULL) {
@ -1216,7 +1214,7 @@ int RsInit::LoadCertificates(bool autoLoginNT)
gpgme_data_t plain;
gpgme_data_new_from_mem(&plain, sslPassword, strlen(sslPassword), 1);
gpgme_data_new_from_stream (&cipher, sslPassphraseFile);
if (0 < getAuthGPG()->encryptText(plain, cipher)) {
if (0 < AuthGPG::getAuthGPG()->encryptText(plain, cipher)) {
std::cerr << "Encrypting went ok !" << std::endl;
}
gpgme_data_release (cipher);
@ -1237,7 +1235,7 @@ int RsInit::LoadCertificates(bool autoLoginNT)
gpgme_data_t plain;
gpgme_data_new (&plain);
gpgme_error_t error_reading_file = gpgme_data_new_from_stream (&cipher, sslPassphraseFile);
if (0 < getAuthGPG()->decryptText(cipher, plain)) {
if (0 < AuthGPG::getAuthGPG()->decryptText(cipher, plain)) {
std::cerr << "Decrypting went ok !" << std::endl;
gpgme_data_write (plain, "", 1);
sslPassword = gpgme_data_release_and_get_mem(plain, NULL);
@ -1253,7 +1251,7 @@ int RsInit::LoadCertificates(bool autoLoginNT)
std::cerr << "RsInitConfig::load_key.c_str() : " << RsInitConfig::load_key.c_str() << std::endl;
std::cerr << "sslPassword : " << sslPassword << std::endl;;
if (0 < getAuthSSL() -> InitAuth(RsInitConfig::load_cert.c_str(), RsInitConfig::load_key.c_str(), sslPassword))
if (0 < AuthSSL::getAuthSSL() -> InitAuth(RsInitConfig::load_cert.c_str(), RsInitConfig::load_key.c_str(), sslPassword))
{
ok = true;
}
@ -1828,7 +1826,7 @@ int RsServer::StartupRetroShare()
/* (1) Load up own certificate (DONE ALREADY) - just CHECK */
/**************************************************************************/
if (1 != getAuthSSL() -> InitAuth(NULL, NULL, NULL))
if (1 != AuthSSL::getAuthSSL() -> InitAuth(NULL, NULL, NULL))
{
std::cerr << "main() - Fatal Error....." << std::endl;
std::cerr << "Invalid Certificate configuration!" << std::endl;
@ -1836,7 +1834,7 @@ int RsServer::StartupRetroShare()
exit(1);
}
std::string ownId = getAuthSSL()->OwnId();
std::string ownId = AuthSSL::getAuthSSL()->OwnId();
/**************************************************************************/
/* Any Initial Configuration (Commandline Options) */
@ -1881,9 +1879,9 @@ int RsServer::StartupRetroShare()
bool oldFormat = false;
std::map<std::string, std::string> oldConfigMap;
getAuthSSL() -> setConfigDirectories(certConfigFile, certNeighDir);
AuthSSL::getAuthSSL() -> setConfigDirectories(certConfigFile, certNeighDir);
getAuthSSL() -> loadCertificates();
AuthSSL::getAuthSSL() -> loadCertificates();
/**************************************************************************/
/* setup classes / structures */