mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-12-19 04:44:21 -05:00
make it run
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@2003 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
a0a64fb588
commit
9d53481946
@ -272,8 +272,6 @@ class CachePair
|
||||
bool operator<(const CachePair &a, const CachePair &b);
|
||||
|
||||
|
||||
class p3AuthMgr;
|
||||
|
||||
class CacheStrapper: public pqiMonitor, public p3Config
|
||||
{
|
||||
public:
|
||||
@ -317,7 +315,6 @@ virtual bool loadList(std::list<RsItem *> load);
|
||||
private:
|
||||
|
||||
/* these are static - so shouldn't need mutex */
|
||||
p3AuthMgr *mAuthMgr;
|
||||
p3ConnectMgr *mConnMgr;
|
||||
|
||||
std::map<uint16_t, CachePair> caches;
|
||||
|
@ -51,7 +51,6 @@
|
||||
#include "pqi/p3cfgmgr.h"
|
||||
|
||||
class p3ConnectMgr;
|
||||
class p3AuthMgr;
|
||||
|
||||
class CacheStrapper;
|
||||
class CacheTransfer;
|
||||
@ -242,7 +241,6 @@ bool loadConfigMap(std::map<std::string, std::string> &configMap);
|
||||
*/
|
||||
|
||||
P3Interface *mP3iface; /* XXX THIS NEEDS PROTECTION */
|
||||
p3AuthMgr *mAuthMgr;
|
||||
p3ConnectMgr *mConnMgr;
|
||||
|
||||
ftCacheStrapper *mCacheStrapper;
|
||||
|
@ -813,21 +813,32 @@ bool AuthSSL::getCertDetails(SSL_id id, sslcert &cert)
|
||||
|
||||
bool valid = false;
|
||||
sslcert *tcert = NULL;
|
||||
if (id == mOwnId)
|
||||
{
|
||||
cert = *mOwnCert;
|
||||
if (id == mOwnId) {
|
||||
cert.authed = mOwnCert->authed;
|
||||
cert.certificate = mOwnCert->certificate;
|
||||
cert.email = mOwnCert->email;
|
||||
cert.fpr = mOwnCert->fpr;
|
||||
cert.id = mOwnCert->id;
|
||||
cert.issuer = mOwnCert->issuer;
|
||||
cert.location = mOwnCert->location;
|
||||
cert.name = mOwnCert->name;
|
||||
cert.org = mOwnCert->org;
|
||||
cert.signers = mOwnCert->signers;
|
||||
valid = true;
|
||||
}
|
||||
else if (locked_FindCert(id, &tcert))
|
||||
{
|
||||
} else if (locked_FindCert(id, &tcert)) {
|
||||
cert.authed = tcert->authed;
|
||||
cert.certificate = tcert->certificate;
|
||||
cert.email = tcert->email;
|
||||
cert.fpr = tcert->fpr;
|
||||
cert.id = tcert->id;
|
||||
cert.issuer = tcert->issuer;
|
||||
cert.location = tcert->location;
|
||||
cert.name = tcert->name;
|
||||
cert.org = tcert->org;
|
||||
cert.signers = tcert->signers;
|
||||
valid = true;
|
||||
}
|
||||
|
||||
if (valid)
|
||||
{
|
||||
cert = *tcert;
|
||||
}
|
||||
|
||||
sslMtx.unlock(); /**** UNLOCK ****/
|
||||
|
||||
return valid;
|
||||
|
@ -109,7 +109,7 @@ pqissl::pqissl(pqissllistener *l, PQInterface *parent, p3ConnectMgr *cm)
|
||||
rslog(RSL_ALERT, pqisslzone, out.str());
|
||||
}
|
||||
|
||||
if (!(mAuthMgr->isAuthenticated(PeerId())))
|
||||
if (!(AuthSSL::getAuthSSL()->isAuthenticated(PeerId())))
|
||||
{
|
||||
rslog(RSL_ALERT, pqisslzone,
|
||||
"pqissl::Warning Certificate Not Approved!");
|
||||
@ -945,7 +945,7 @@ int pqissl::Initiate_SSL_Connection()
|
||||
|
||||
// Perform SSL magic.
|
||||
// library already inited by sslroot().
|
||||
SSL *ssl = SSL_new(mAuthMgr->getCTX());
|
||||
SSL *ssl = SSL_new(AuthSSL::getAuthSSL()->getCTX());
|
||||
if (ssl == NULL)
|
||||
{
|
||||
rslog(RSL_ALERT, pqisslzone,
|
||||
@ -1089,14 +1089,7 @@ int pqissl::Extract_Failed_SSL_Certificate()
|
||||
// we actually connected to remote_addr,
|
||||
// which could be
|
||||
// (pqissl's case) sslcert->serveraddr or sslcert->localaddr.
|
||||
/**************** PQI_USE_XPGP ******************/
|
||||
#if defined(PQI_USE_XPGP)
|
||||
mAuthMgr->FailedCertificateXPGP(peercert, false);
|
||||
#else /* X509 Certificates */
|
||||
/**************** PQI_USE_XPGP ******************/
|
||||
mAuthMgr->FailedCertificate(peercert, false);
|
||||
#endif /* X509 Certificates */
|
||||
/**************** PQI_USE_XPGP ******************/
|
||||
AuthSSL::getAuthSSL()->FailedCertificate(peercert, false);
|
||||
|
||||
return 1;
|
||||
}
|
||||
@ -1153,7 +1146,7 @@ int pqissl::Authorise_SSL_Connection()
|
||||
// (pqissl's case) sslcert->serveraddr or sslcert->localaddr.
|
||||
|
||||
bool certCorrect = false;
|
||||
certCorrect = mAuthMgr->CheckCertificate(PeerId(), peercert);
|
||||
certCorrect = AuthSSL::getAuthSSL()->CheckCertificate(PeerId(), peercert);
|
||||
|
||||
// check it's the right one.
|
||||
if (certCorrect)
|
||||
|
@ -205,20 +205,6 @@ virtual int net_internal_fcntl_nonblock(int fd) { return unix_fcntl_nonblock(fd)
|
||||
time_t mTimeoutTS;
|
||||
bool quietShutdown;
|
||||
|
||||
/* Need Certificate specific functions here! */
|
||||
/**************** PQI_USE_XPGP ******************/
|
||||
#if defined(PQI_USE_XPGP)
|
||||
|
||||
AuthXPGP *mAuthMgr;
|
||||
|
||||
#else /* X509 Certificates */
|
||||
/**************** PQI_USE_XPGP ******************/
|
||||
|
||||
AuthSSL *mAuthMgr;
|
||||
|
||||
#endif /* X509 Certificates */
|
||||
/**************** PQI_USE_XPGP ******************/
|
||||
|
||||
p3ConnectMgr *mConnMgr;
|
||||
|
||||
private:
|
||||
|
@ -59,8 +59,7 @@ pqissllistenbase::pqissllistenbase(struct sockaddr_in addr, p3ConnectMgr *cm)
|
||||
:laddr(addr), active(false), mConnMgr(cm)
|
||||
|
||||
{
|
||||
if (!(mAuthMgr -> active()))
|
||||
{
|
||||
if (!(AuthSSL::getAuthSSL()-> active())) {
|
||||
pqioutput(PQL_ALERT, pqissllistenzone,
|
||||
"SSL-CTX-CERT-ROOT not initialised!");
|
||||
|
||||
@ -346,7 +345,7 @@ int pqissllistenbase::acceptconnection()
|
||||
// Negotiate certificates. SSL stylee.
|
||||
// Allow negotiations for secure transaction.
|
||||
|
||||
SSL *ssl = SSL_new(mAuthMgr -> getCTX());
|
||||
SSL *ssl = SSL_new(AuthSSL::getAuthSSL() -> getCTX());
|
||||
SSL_set_fd(ssl, fd);
|
||||
|
||||
return continueSSL(ssl, remote_addr, true); // continue and save if incomplete.
|
||||
@ -477,7 +476,7 @@ int pqissllistenbase::Extract_Failed_SSL_Certificate(SSL *ssl, struct sockaddr_
|
||||
|
||||
// save certificate... (and ip locations)
|
||||
// false for outgoing....
|
||||
mAuthMgr->FailedCertificate(peercert, true);
|
||||
AuthSSL::getAuthSSL()->FailedCertificate(peercert, true);
|
||||
|
||||
return 1;
|
||||
}
|
||||
@ -630,7 +629,7 @@ int pqissllistener::completeConnection(int fd, SSL *ssl, struct sockaddr_in &rem
|
||||
* we should only need to call CheckCertificate here!
|
||||
****/
|
||||
|
||||
bool certOk = mAuthMgr->ValidateCertificate(peercert, newPeerId);
|
||||
bool certOk = AuthSSL::getAuthSSL()->ValidateCertificate(peercert, newPeerId);
|
||||
|
||||
bool found = false;
|
||||
std::map<std::string, pqissl *>::iterator it;
|
||||
@ -685,7 +684,7 @@ int pqissllistener::completeConnection(int fd, SSL *ssl, struct sockaddr_in &rem
|
||||
}
|
||||
|
||||
/* Certificate consumed! */
|
||||
bool certKnown = mAuthMgr->CheckCertificate(it->first, peercert);
|
||||
bool certKnown = AuthSSL::getAuthSSL()->CheckCertificate(it->first, peercert);
|
||||
|
||||
if (certKnown == false)
|
||||
{
|
||||
|
@ -88,8 +88,6 @@ int Extract_Failed_SSL_Certificate(SSL *ssl, struct sockaddr_in *inaddr);
|
||||
|
||||
protected:
|
||||
|
||||
AuthSSL *mAuthMgr;
|
||||
|
||||
p3ConnectMgr *mConnMgr;
|
||||
|
||||
};
|
||||
|
@ -102,7 +102,7 @@ pqissltunnel::pqissltunnel(PQInterface *parent, p3ConnectMgr *cm)
|
||||
rslog(RSL_ALERT, pqisslzone, out.str());
|
||||
}
|
||||
|
||||
if (!(mAuthMgr->isAuthenticated(PeerId()))) {
|
||||
if (!(AuthSSL::getAuthSSL()->isAuthenticated(PeerId()))) {
|
||||
rslog(RSL_ALERT, pqisslzone,
|
||||
"pqissltunnel::Warning Certificate Not Approved!");
|
||||
rslog(RSL_ALERT, pqisslzone,
|
||||
@ -470,7 +470,7 @@ int pqissltunnel::senddata(void *data, int len)
|
||||
item->connection_accepted = 1;
|
||||
|
||||
int oulen;
|
||||
if (!mAuthMgr->encrypt(item->encoded_data, oulen, data, len, parent()->PeerId())) {
|
||||
if (!AuthSSL::getAuthSSL()->encrypt(item->encoded_data, oulen, data, len, parent()->PeerId())) {
|
||||
std::cerr << "pqissltunnel::readdata() problem while crypting packet, ignoring it." << std::endl;
|
||||
return -1;
|
||||
}
|
||||
@ -499,7 +499,7 @@ int pqissltunnel::readdata(void *data, int len)
|
||||
//let's read a new packet
|
||||
current_data_offset = 0;
|
||||
//decrypt one packet from the queue and put it into the current data packet.
|
||||
if (!mAuthMgr->decrypt(curent_data_packet.data, curent_data_packet.length, data_packet_queue.back().data, data_packet_queue.back().length)) {
|
||||
if (!AuthSSL::getAuthSSL()->decrypt(curent_data_packet.data, curent_data_packet.length, data_packet_queue.back().data, data_packet_queue.back().length)) {
|
||||
std::cerr << "pqissltunnel::readdata() problem while decrypting packet, ignoring it." << std::endl;
|
||||
curent_data_packet.length = 0;
|
||||
return -1;
|
||||
|
@ -128,8 +128,6 @@ private:
|
||||
/* Need Certificate specific functions here! */
|
||||
time_t mConnectTS;
|
||||
|
||||
AuthSSL *mAuthMgr;
|
||||
|
||||
p3ConnectMgr *mConnMgr;
|
||||
|
||||
p3tunnel *mP3tunnel;
|
||||
|
@ -161,7 +161,6 @@ class RsServer: public RsControl, public RsThread
|
||||
ftServer *ftserver;
|
||||
|
||||
p3ConnectMgr *mConnMgr;
|
||||
p3AuthMgr *mAuthMgr;
|
||||
|
||||
pqipersongrp *pqih;
|
||||
|
||||
|
@ -28,7 +28,6 @@
|
||||
|
||||
#include "rsiface/rsmsgs.h"
|
||||
|
||||
class p3AuthMgr;
|
||||
class p3MsgService;
|
||||
class p3ChatService;
|
||||
|
||||
@ -38,8 +37,8 @@ class p3Msgs: public RsMsgs
|
||||
{
|
||||
public:
|
||||
|
||||
p3Msgs(p3AuthMgr *p3a, p3MsgService *p3m, p3ChatService *p3c)
|
||||
:mAuthMgr(p3a), mMsgSrv(p3m), mChatSrv(p3c) { return; }
|
||||
p3Msgs(p3MsgService *p3m, p3ChatService *p3c)
|
||||
:mMsgSrv(p3m), mChatSrv(p3c) { return; }
|
||||
virtual ~p3Msgs() { return; }
|
||||
|
||||
/****************************************/
|
||||
@ -78,7 +77,6 @@ class p3Msgs: public RsMsgs
|
||||
|
||||
void initRsChatInfo(RsChatMsgItem *c, ChatInfo &i);
|
||||
|
||||
p3AuthMgr *mAuthMgr;
|
||||
p3MsgService *mMsgSrv;
|
||||
p3ChatService *mChatSrv;
|
||||
};
|
||||
|
@ -2133,7 +2133,7 @@ int RsServer::StartupRetroShare()
|
||||
/* Setup GUI Interfaces. */
|
||||
|
||||
rsPeers = new p3Peers(mConnMgr);
|
||||
rsMsgs = new p3Msgs(mAuthMgr, msgSrv, chatSrv);
|
||||
rsMsgs = new p3Msgs(msgSrv, chatSrv);
|
||||
rsDisc = new p3Discovery(ad);
|
||||
|
||||
rsForums = mForums;
|
||||
|
@ -390,7 +390,6 @@ bool groupsChanged(std::list<std::string> &groupIds);
|
||||
|
||||
RsMutex distribMtx; /* Protects All Data Below */
|
||||
std::string mOwnId;
|
||||
p3AuthMgr *mAuthMgr;
|
||||
|
||||
private:
|
||||
|
||||
|
@ -153,7 +153,6 @@
|
||||
#include "rsturtleitem.h"
|
||||
|
||||
class ftServer ;
|
||||
class p3AuthMgr;
|
||||
class p3ConnectMgr;
|
||||
class ftDataMultiplex;
|
||||
class RsSerialiser;
|
||||
|
Loading…
Reference in New Issue
Block a user