mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-06-08 22:52:54 -04:00
commit
a8df555df2
4 changed files with 35 additions and 5 deletions
|
@ -308,6 +308,20 @@ AuthSSLimpl::AuthSSLimpl() :
|
||||||
p3Config(), sslctx(nullptr), mOwnCert(nullptr), sslMtx("AuthSSL"),
|
p3Config(), sslctx(nullptr), mOwnCert(nullptr), sslMtx("AuthSSL"),
|
||||||
mOwnPrivateKey(nullptr), mOwnPublicKey(nullptr), init(0) {}
|
mOwnPrivateKey(nullptr), mOwnPublicKey(nullptr), init(0) {}
|
||||||
|
|
||||||
|
AuthSSLimpl::~AuthSSLimpl()
|
||||||
|
{
|
||||||
|
RS_STACK_MUTEX(sslMtx);
|
||||||
|
|
||||||
|
SSL_CTX_free(sslctx);
|
||||||
|
X509_free(mOwnCert);
|
||||||
|
|
||||||
|
EVP_PKEY_free(mOwnPrivateKey);
|
||||||
|
EVP_PKEY_free(mOwnPublicKey);
|
||||||
|
|
||||||
|
for(auto pcert: mCerts)
|
||||||
|
X509_free(pcert.second);
|
||||||
|
}
|
||||||
|
|
||||||
bool AuthSSLimpl::active() { return init; }
|
bool AuthSSLimpl::active() { return init; }
|
||||||
|
|
||||||
int AuthSSLimpl::InitAuth(
|
int AuthSSLimpl::InitAuth(
|
||||||
|
@ -1459,14 +1473,14 @@ bool AuthSSLimpl::encrypt(void *&out, int &outlen, const void *in, int inlen,
|
||||||
if (peerId == mOwnId) { public_key = mOwnPublicKey; }
|
if (peerId == mOwnId) { public_key = mOwnPublicKey; }
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (!mCerts[peerId])
|
auto it = mCerts.find(peerId);
|
||||||
|
|
||||||
|
if (it == mCerts.end())
|
||||||
{
|
{
|
||||||
RsErr() << __PRETTY_FUNCTION__ << " public key not found."
|
RsErr() << __PRETTY_FUNCTION__ << " public key not found." << std::endl;
|
||||||
<< std::endl;
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
else public_key = const_cast<EVP_PKEY*>(
|
else public_key = const_cast<EVP_PKEY*>( RsX509Cert::getPubKey(*it->second) );
|
||||||
RsX509Cert::getPubKey(*mCerts[peerId]) );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
EVP_CIPHER_CTX *ctx = EVP_CIPHER_CTX_new();
|
EVP_CIPHER_CTX *ctx = EVP_CIPHER_CTX_new();
|
||||||
|
|
|
@ -161,6 +161,8 @@ public:
|
||||||
|
|
||||||
/** Initialisation Functions (Unique) */
|
/** Initialisation Functions (Unique) */
|
||||||
AuthSSLimpl();
|
AuthSSLimpl();
|
||||||
|
virtual ~AuthSSLimpl();
|
||||||
|
|
||||||
bool validateOwnCertificate(X509 *x509, EVP_PKEY *pkey) override;
|
bool validateOwnCertificate(X509 *x509, EVP_PKEY *pkey) override;
|
||||||
|
|
||||||
bool active() override;
|
bool active() override;
|
||||||
|
|
|
@ -115,6 +115,19 @@ RsServiceInfo p3MsgService::getServiceInfo()
|
||||||
MSG_MIN_MINOR_VERSION);
|
MSG_MIN_MINOR_VERSION);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
p3MsgService::~p3MsgService()
|
||||||
|
{
|
||||||
|
RS_STACK_MUTEX(mMsgMtx); /********** STACK LOCKED MTX ******/
|
||||||
|
|
||||||
|
for(auto tag:mTags) delete tag.second;
|
||||||
|
for(auto tag:mMsgTags) delete tag.second;
|
||||||
|
for(auto msgid:mSrcIds) delete msgid.second;
|
||||||
|
for(auto parentid:mParentId) delete parentid.second;
|
||||||
|
for(auto img:imsg) delete img.second;
|
||||||
|
for(auto mout:msgOutgoing) delete mout.second;
|
||||||
|
|
||||||
|
for(auto mpend:_pendingPartialMessages) delete mpend.second;
|
||||||
|
}
|
||||||
|
|
||||||
uint32_t p3MsgService::getNewUniqueMsgId()
|
uint32_t p3MsgService::getNewUniqueMsgId()
|
||||||
{
|
{
|
||||||
|
|
|
@ -56,6 +56,7 @@ class p3MsgService :
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
p3MsgService(p3ServiceControl *sc, p3IdService *id_service, p3GxsTrans& gxsMS);
|
p3MsgService(p3ServiceControl *sc, p3IdService *id_service, p3GxsTrans& gxsMS);
|
||||||
|
virtual ~p3MsgService();
|
||||||
|
|
||||||
virtual RsServiceInfo getServiceInfo();
|
virtual RsServiceInfo getServiceInfo();
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue