Ejemplo n.º 1
0
void DefaultConnection::disconnectFromHost()
{
	FRecords.clear();
	if (FSocket.state() != QSslSocket::UnconnectedState)
	{
		if (FSocket.state() == QSslSocket::ConnectedState)
		{
			LogDetail(QString("[DefaultConnection] Starting socket disconnection from host"));
			emit aboutToDisconnect();
			FSocket.flush();
			FSocket.disconnectFromHost();
		}
		else
		{
			LogError(QString("[DefaultConnection] Aborting socket connection to host"));
			FSocket.abort();
			emit disconnected();
		}
	}
	else if (FSrvQueryId != START_QUERY_ID)
	{
		LogDetail(QString("[DefaultConnection] Shutdown SRV lookup"));
		FSrvQueryId = STOP_QUERY_ID;
		FDns.shutdown();
	}

	if (FSocket.state()!=QSslSocket::UnconnectedState && !FSocket.waitForDisconnected(DISCONNECT_TIMEOUT))
	{
		LogError(QString("[DefaultConnection] Disconnection timed out"));
		setError(tr("Disconnection timed out"));
		emit disconnected();
	}
}
Ejemplo n.º 2
0
bool LegacySymmetric::Decrypt(
    const api::Crypto& crypto,
    const String& strKey,
    String& strCiphertext,
    String& strOutput,
    const String& pstrDisplay,
    const OTPassword* pAlreadyHavePW)
{

    if (!strKey.Exists()) {
        LogDetail(OT_METHOD)(__FUNCTION__)(
            ": Nonexistent: The symmetric key. Please supply. (Failure).")
            .Flush();
        return false;
    }

    implementation::LegacySymmetric theKey(crypto);

    if (!theKey.SerializeFrom(strKey)) {
        LogDetail(OT_METHOD)(__FUNCTION__)(
            ": Failed trying to load symmetric key from "
            "string. (Returning false).")
            .Flush();
        return false;
    }

    // By this point, we know we have a ciphertext envelope and a symmetric Key.
    //
    return Decrypt(
        theKey, strCiphertext, strOutput, pstrDisplay, pAlreadyHavePW);
}
Ejemplo n.º 3
0
void InstanceMgr::_LoadInstances()
{
    MapInfo const* inf;
    Instance* in;
    QueryResult* result;

    // clear any instances that have expired.
    LogDetail("InstanceMgr : Deleting Expired Instances...");
    CharacterDatabase.WaitExecute("DELETE FROM instances WHERE expiration > 0 AND expiration <= %u", UNIXTIME);
    CharacterDatabase.Execute("DELETE FROM instanceids WHERE instanceid NOT IN (SELECT id FROM instances)");

    // load saved instances
    result = CharacterDatabase.Query("SELECT id, mapid, creation, expiration, killed_npc_guids, difficulty, creator_group, creator_guid, persistent FROM instances");
    LogDetail("InstanceMgr : Loading %u saved instances.", result ? result->GetRowCount() : 0);

    if (result)
    {
        do
        {
            inf = sMySQLStore.GetWorldMapInfo(result->Fetch()[1].GetUInt32());
            if (inf == NULL || result->Fetch()[1].GetUInt32() >= NUM_MAPS)
            {
                CharacterDatabase.Execute("DELETE FROM instances WHERE mapid = %u", result->Fetch()[1].GetUInt32());
                continue;
            }

            in = new Instance();
            in->m_mapInfo = inf;
            in->LoadFromDB(result->Fetch());

            // this assumes that groups are already loaded at this point.
            if (!in->m_persistent && in->m_creatorGroup && objmgr.GetGroupById(in->m_creatorGroup) == NULL)
            {
                CharacterDatabase.Execute("DELETE FROM `instances` WHERE `id` = %u", in->m_instanceId);
                delete in;
                continue;
            }

            if (m_instances[in->m_mapId] == NULL)
                m_instances[in->m_mapId] = new InstanceMap;

            m_instances[in->m_mapId]->insert(InstanceMap::value_type(in->m_instanceId, in));

        }
        while (result->NextRow());
        delete result;
    }
}
Ejemplo n.º 4
0
void XmppStream::close()
{
	if (FConnection && FStreamState!=SS_OFFLINE && FStreamState!=SS_ERROR)
	{
		if (FStreamState != SS_DISCONNECTING)
		{
			LogDetail(QString("[XmppStream][%1] Closing XMPP stream").arg(FStreamJid.bare()));
			FStreamState = SS_DISCONNECTING;
			if (FConnection->isOpen())
			{
				emit aboutToClose();
				QByteArray data = "</stream:stream>";
				if (!processDataHandlers(data,true))
					FConnection->write(data);
				FKeepAliveTimer.start(DISCONNECT_TIMEOUT);
			}
			else
			{
				FConnection->disconnectFromHost();
			}
		}
	}
	else
	{
		FStreamState = SS_OFFLINE;
	}
}
Ejemplo n.º 5
0
XmppStream::~XmppStream()
{
	abort(tr("XMPP stream destroyed"));
	clearActiveFeatures();
	LogDetail(QString("[XmppStream][%1] XMPP stream destroyed").arg(FStreamJid.bare()));
	emit streamDestroyed();
}
Ejemplo n.º 6
0
bool Master::LoadWorldConfiguration(char* config_file)
{
    LogNotice("Config : Loading Config Files...");
    if (Config.MainConfig.openAndLoadConfigFile(config_file))
    {
        LogDetail("Config : " CONFDIR "/world.conf loaded");
    }
    else
    {
        LogError("Config : error occurred loading " CONFDIR "/world.conf");
        AscLog.~AscEmuLog();
        return false;
    }

#if !defined(WIN32) && defined(__DEBUG__)
    if (Config.MainConfig.GetIntDefault("LogLevel", "DisableCrashdumpReport", 0) == 0)
    {
        char cmd[1024];
        char banner[1024];
        snprintf(banner, 1024, BANNER, BUILD_TAG, BUILD_REVISION, CONFIG, PLATFORM_TEXT, ARCH);
        snprintf(cmd, 1024, "./crashreport -r %d -d \'%s\'", BUILD_REVISION, banner);
        system(cmd);
    }
    unlink("worldserver.uptime");
#endif
    return true;
}
Ejemplo n.º 7
0
void DefaultConnection::connectSocketToHost(const QString &AHost, quint16 APort)
{
	FHost = AHost;
	FPort = APort;

	FConnectTimer.start();
	if (FSSLConnection)
	{
		LogDetail(QString("[DefaultConnection] Connecting socket to host with legacy-SSL, host='%1', port='%2', proxy-type='%3', proxy-host='%4', proxy-port='%5'").arg(AHost).arg(APort).arg(proxy().type()).arg(proxy().hostName()).arg(proxy().port()));
		FSocket.connectToHostEncrypted(FHost, FPort);
	}
	else
	{
		LogDetail(QString("[DefaultConnection] Connecting socket to host, host='%1', port='%2', proxy-type='%3', proxy-host='%4', proxy-port='%5'").arg(AHost).arg(APort).arg(proxy().type()).arg(proxy().hostName()).arg(proxy().port()));
		FSocket.connectToHost(FHost, FPort);
	}
}
Ejemplo n.º 8
0
void DefaultConnection::setProxy(const QNetworkProxy &AProxy)
{
	if (AProxy != FSocket.proxy())
	{
		LogDetail(QString("[DefaultConnection] Connection proxy changed, type='%1', host='%2', port='%3'").arg(AProxy.type()).arg(AProxy.hostName()).arg(AProxy.port()));
		FSocket.setProxy(AProxy);
		emit proxyChanged(AProxy);
	}
}
Ejemplo n.º 9
0
void DefaultConnection::onSocketConnected()
{
	FConnectTimer.stop();
	LogDetail(QString("[DefaultConnection] Socket connected to host"));
	if (!FSSLConnection)
	{
		FRecords.clear();
		emit connected();
	}
}
Ejemplo n.º 10
0
void DefaultConnection::onSocketEncrypted()
{
	LogDetail(QString("[DefaultConnection] Socket connection encrypted"));
	emit encrypted();
	if (FSSLConnection)
	{
		FRecords.clear();
		emit connected();
	}
}
Ejemplo n.º 11
0
bool LegacySymmetric::CreateNewKey(
    const api::Crypto& crypto,
    String& strOutput,
    const String& pstrDisplay,
    const OTPassword* pAlreadyHavePW)
{
    std::unique_ptr<OTPassword> pPassUserInput;

    if (nullptr == pAlreadyHavePW) {
        const char* szDisplay = "Creating new symmetric key.";
        const auto strDisplay = String::Factory(
            (!pstrDisplay.Exists()) ? szDisplay : pstrDisplay.Get());

        pPassUserInput.reset(GetPassphraseFromUser(
            strDisplay, true));  // bAskTwice=false by default.
    } else
        pPassUserInput.reset(new OTPassword(*pAlreadyHavePW));

    bool bSuccess = false;

    if (pPassUserInput)  // Success retrieving the passphrase from the
                         // user. (Now let's generate the key...)
    {
        LogDebug(OT_METHOD)(__FUNCTION__)(
            ": Calling LegacySymmetric theKey.GenerateKey()...")
            .Flush();
        implementation::LegacySymmetric theKey(crypto, *pPassUserInput);
        const bool bGenerated = theKey.IsGenerated();

        if (bGenerated && theKey.SerializeTo(strOutput))
            bSuccess = true;
        else
            LogDetail(OT_METHOD)(__FUNCTION__)(
                ": Sorry, unable to generate key. (Failure).")
                .Flush();
    } else
        LogDetail(OT_METHOD)(__FUNCTION__)(
            ": Sorry, unable to retrieve password from user. (Failure).")
            .Flush();

    return bSuccess;
}
Ejemplo n.º 12
0
void SocketMgr::SpawnWorkerThreads()
{
    SYSTEM_INFO si;
    GetSystemInfo(&si);

    threadcount = si.dwNumberOfProcessors;

    LogDetail("IOCP: Spawning %u worker threads.", threadcount);
    for(long x = 0; x < threadcount; ++x)
        ThreadPool.ExecuteTask(new SocketWorkerThread());
}
Ejemplo n.º 13
0
Transporter* ObjectMgr::LoadTransportInInstance(MapMgr *instance, uint32 goEntry, uint32 period)
{
    auto gameobject_info = sMySQLStore.getGameObjectProperties(goEntry);
    if (gameobject_info == nullptr)
    {
        LOG_ERROR("Transport ID:%u, will not be loaded, gameobject_properties missing", goEntry);
        return NULL;
    }

    if (gameobject_info->type != GAMEOBJECT_TYPE_MO_TRANSPORT)
    {
        LOG_ERROR("Transport ID:%u, Name: %s, will not be loaded, gameobject_properties type wrong", goEntry, gameobject_info->name.c_str());
        return NULL;
    }

    std::set<uint32> mapsUsed;

    Transporter* t = new Transporter((uint64)HIGHGUID_TYPE_TRANSPORTER << 32 | goEntry);

    // Generate waypoints
    if (!t->GenerateWaypoints(gameobject_info->mo_transport.taxi_path_id))
    {
        LOG_ERROR("Transport ID:%u, Name: %s, failed to create waypoints", gameobject_info->entry, gameobject_info->name.c_str());
        delete t;
        return NULL;
    }

    // Create Transporter
    if (!t->Create(goEntry, period))
    {
        delete t;
        return NULL;
    }

    m_Transporters.insert(t);
    m_TransportersByInstanceIdMap[instance->GetInstanceID()].insert(t);
    AddTransport(t);

    // AddObject To World
    t->AddToWorld(instance);

    // correct incorrect instance id's
    t->SetInstanceID(instance->GetInstanceID());
    t->SetMapId(t->GetMapId());

    t->BuildStartMovePacket(instance);
    t->BuildStopMovePacket(instance);
    t->m_WayPoints.clear(); // Make transport stopped at server-side, movement will be handled by scripts

    LogDetail("Transport Handler : Spawned Transport Entry %u, map %u, instance id %u", goEntry, t->GetMapId(), t->GetInstanceID());
    return t;
}
Ejemplo n.º 14
0
bool DefaultConnection::connectToHost()
{
	if (FSrvQueryId==START_QUERY_ID && FSocket.state()==QAbstractSocket::UnconnectedState)
	{
		LogDetail(QString("[DefaultConnection] Starting connection"));
		emit aboutToConnect();

		FRecords.clear();
		FSSLError = false;
		FErrorString = QString::null;

		QString host = option(IDefaultConnection::COR_HOST).toString();
		quint16 port = option(IDefaultConnection::COR_PORT).toInt();
		QString domain = option(IDefaultConnection::COR_DOMAINE).toString();
		FSSLConnection = option(IDefaultConnection::COR_USE_SSL).toBool();
		FIgnoreSSLErrors = option(IDefaultConnection::COR_IGNORE_SSL_ERRORS).toBool();
		FChangeProxyType = option(IDefaultConnection::COR_CHANGE_PROXY_TYPE).toBool();

		QJDns::Record record;
		record.name = !host.isEmpty() ? host.toLatin1() : QByteArray("xmpp.rambler.ru");
		record.port = port;
		record.priority = 0;
		record.weight = 0;
		FRecords.append(record);

		if (host.isEmpty() && FDns.init(QJDns::Unicast, QHostAddress::Any))
		{
			LogDetail(QString("[DefaultConnection] Starting SRV lookup on host '%1'").arg(domain));
			FDns.setNameServers(QJDns::systemInfo().nameServers);
			FSrvQueryId = FDns.queryStart(QString("_xmpp-client._tcp.%1.").arg(domain).toLatin1(),QJDns::Srv);
		}
		else
		{
			connectToNextHost();
		}
		return true;
	}
	return false;
}
Ejemplo n.º 15
0
void DefaultConnection::onDnsResultsReady(int AId, const QJDns::Response &AResults)
{
	if (FSrvQueryId == AId)
	{
		LogDetail(QString("[DefaultConnection] SRV lookup results ready"));
		if (!AResults.answerRecords.isEmpty())
		{
			FSSLConnection = false;
			FRecords = AResults.answerRecords;
		}
		FDns.shutdown();
	}
}
Ejemplo n.º 16
0
void DefaultConnection::onDnsShutdownFinished()
{
	LogDetail(QString("[DefaultConnection] SRV lookup finished"));
	if (FSrvQueryId != STOP_QUERY_ID)
	{
		FSrvQueryId = START_QUERY_ID;
		connectToNextHost();
	}
	else
	{
		FSrvQueryId = START_QUERY_ID;
		emit disconnected();
	}
}
Ejemplo n.º 17
0
bool Context::ConsumeIssued(const TransactionNumber& number)
{
    Lock lock(lock_);

    if (0 < available_transaction_numbers_.count(number)) {
        LogDetail(OT_METHOD)(__FUNCTION__)(
            ": Consuming an issued number that was still available.")
            .Flush();

        available_transaction_numbers_.erase(number);
    }

    return 1 == issued_transaction_numbers_.erase(number);
}
Ejemplo n.º 18
0
bool XmppStream::xmppStanzaIn(IXmppStream *AXmppStream, Stanza &AStanza, int AOrder)
{
	if (AXmppStream == this && AOrder == XSHO_XMPP_STREAM)
	{
		if (FStreamState==SS_INITIALIZE && AStanza.element().nodeName()=="stream:stream")
		{
			LogDetail(QString("[XmppStream][%1] XMPP stream initialized").arg(FStreamJid.bare()));
			FStreamId = AStanza.id();
			FStreamState = SS_FEATURES;
			if (VersionParser(AStanza.element().attribute("version","0.0")) < VersionParser(1,0))
			{
				Stanza stanza("stream:features");
				stanza.addElement("register",NS_FEATURE_REGISTER);
				stanza.addElement("auth",NS_FEATURE_IQAUTH);
				xmppStanzaIn(AXmppStream, stanza, AOrder);
			}
			return true;
		}
		else if (FStreamState==SS_FEATURES && AStanza.element().nodeName()=="stream:features")
		{
			LogDetail(QString("[XmppStream][%1] Processing XMPP stream features").arg(FStreamJid.bare()));
			FServerFeatures = AStanza.element().cloneNode(true).toElement();
			FAvailFeatures = FXmppStreams->xmppFeaturesOrdered();
			processFeatures();
			return true;
		}
		else if (AStanza.element().nodeName() == "stream:error")
		{
			ErrorHandler err(AStanza.element(),NS_XMPP_STREAMS);
			LogError(QString("[XmppStream][%1] XMPP stream error received: %2").arg(FStreamJid.bare(),err.message()));
			abort(err.message());
			return true;
		}
	}
	return false;
}
Ejemplo n.º 19
0
bool RamblerMailNotify::stanzaReadWrite(int AHandleId, const Jid &AStreamJid, Stanza &AStanza, bool &AAccept)
{
	if (AHandleId == FSHIMailNotify)
	{
		if (FGateways && FGateways->streamServices(AStreamJid).contains(AStanza.from()))
		{
			AAccept = true;
			LogDetail(QString("[RamblerMailNotify] Rambler mail notify received from '%1'").arg(AStanza.from()));
			insertMailNotify(AStreamJid,AStanza);
		}
		else if (FGateways)
		{
			LogError(QString("[RamblerMailNotify] Rambler mail notify received from not stream service '%1'").arg(AStanza.from()));
		}
		return true;
	}
	return false;
}
Ejemplo n.º 20
0
void Socket::Disconnect()
{
    //if returns false it means it's already disconnected
    if (!m_connected)
        return;

    m_connected = false;

    LogDetail("Socket::Disconnect on socket %u", m_fd);

    // remove from mgr
    sSocketMgr.RemoveSocket(this);

    // Call virtual ondisconnect
    OnDisconnect();

    if(!IsDeleted())
        Delete();
}
Ejemplo n.º 21
0
void XmppStream::processFeatures()
{
	bool started = false;
	while (!started && !FAvailFeatures.isEmpty())
	{
		QString featureNS = FAvailFeatures.takeFirst();
		QDomElement featureElem = FServerFeatures.firstChildElement();
		while (!featureElem.isNull() && featureElem.namespaceURI()!=featureNS)
			featureElem = featureElem.nextSiblingElement();
		started = featureElem.namespaceURI()==featureNS ? startFeature(featureNS, featureElem) : false;
	}
	if (!started)
	{
		LogDetail(QString("[XmppStream][%1] XMPP stream opened").arg(FStreamJid.bare()));
		FOpen = true;
		FStreamState = SS_ONLINE;
		emit opened();
	}
}
Ejemplo n.º 22
0
XmppStream::XmppStream(IXmppStreams *AXmppStreams, const Jid &AStreamJid) : QObject(AXmppStreams->instance())
{
	FXmppStreams = AXmppStreams;

	FOpen = false;
	FStreamJid = AStreamJid;
	FConnection = NULL;
	FStreamState = SS_OFFLINE;

	connect(&FParser,SIGNAL(opened(QDomElement)), SLOT(onParserOpened(QDomElement)));
	connect(&FParser,SIGNAL(element(QDomElement)), SLOT(onParserElement(QDomElement)));
	connect(&FParser,SIGNAL(error(const QString &)), SLOT(onParserError(const QString &)));
	connect(&FParser,SIGNAL(closed()), SLOT(onParserClosed()));

	FKeepAliveTimer.setSingleShot(false);
	connect(&FKeepAliveTimer,SIGNAL(timeout()),SLOT(onKeepAliveTimeout()));

	LogDetail(QString("[XmppStream][%1] XMPP stream created").arg(FStreamJid.bare()));
}
Ejemplo n.º 23
0
void XmppStream::setStreamJid(const Jid &AJid)
{
	if (FStreamJid!=AJid && (FStreamState==SS_OFFLINE || FStreamState==SS_FEATURES))
	{
		LogDetail(QString("[XmppStream][%1] XMPP stream JID changing from '%2' to '%3'").arg(FStreamJid.bare(),FStreamJid.full(),AJid.full()));

		if (FStreamState==SS_FEATURES && !FOfflineJid.isValid())
			FOfflineJid = FStreamJid;

		if (!(FStreamJid && AJid))
			FSessionPassword.clear();

		Jid befour = FStreamJid;
		emit jidAboutToBeChanged(AJid);

		FStreamJid = AJid;
		emit jidChanged(befour);
	}
}
Ejemplo n.º 24
0
void XmppStream::onConnectionDisconnected()
{
	FOpen = false;
	FKeepAliveTimer.stop();

	if (FStreamState != SS_DISCONNECTING)
		abort(tr("Connection closed unexpectedly"));

	LogDetail(QString("[XmppStream][%1] XMPP stream closed").arg(FStreamJid.bare()));
	FStreamState = SS_OFFLINE;
	removeXmppStanzaHandler(this,XSHO_XMPP_STREAM);
	emit closed();

	clearActiveFeatures();
	if (FOfflineJid.isValid())
	{
		setStreamJid(FOfflineJid);
		FOfflineJid = Jid();
	}
}
Ejemplo n.º 25
0
bool XmppStream::open()
{
	if (FConnection && FStreamState==SS_OFFLINE)
	{
		LogDetail(QString("[XmppStream][%1] Opening XMPP stream").arg(FStreamJid.bare()));
		FErrorString.clear();
		if (FConnection->connectToHost())
		{
			FStreamState = SS_CONNECTING;
			return true;
		}
		else
		{
			LogError(QString("[XmppStream][%1] Failed to start stream connection").arg(FStreamJid.bare()));
			abort(tr("Failed to start connection"));
		}
	}
	else if (!FConnection)
	{
		LogError(QString("[XmppStream][%1] XMPP stream connection is not specified").arg(FStreamJid.bare()));
		emit error(tr("Connection not specified"));
	}
	return false;
}
Ejemplo n.º 26
0
void XmppStream::startStream()
{
	LogDetail(QString("[XmppStream][%1] Initializing XMPP stream").arg(FStreamJid.bare()));

	FParser.restart();
	FKeepAliveTimer.start(KEEP_ALIVE_TIMEOUT);

	QDomDocument doc;
	QDomElement root = doc.createElementNS(NS_JABBER_STREAMS,"stream:stream");
	doc.appendChild(root);
	root.setAttribute("xmlns",NS_JABBER_CLIENT);
	root.setAttribute("to", FStreamJid.domain());
	if (!FDefLang.isEmpty())
		root.setAttribute("xml:lang",FDefLang);

	FStreamState = SS_INITIALIZE;
	Stanza stanza(doc.documentElement());
	if (!processStanzaHandlers(stanza,true))
	{
		QByteArray data = QString("<?xml version=\"1.0\"?>").toUtf8()+stanza.toByteArray().trimmed();
		data.remove(data.size()-2,1);
		sendData(data);
	}
}
Ejemplo n.º 27
0
void XmppStream::onParserClosed()
{
	LogDetail(QString("[XmppStream][%1] Parser closed").arg(FStreamJid.bare()));
	FConnection->disconnectFromHost();
}
Ejemplo n.º 28
0
void DefaultConnection::onSocketDisconnected()
{
	FConnectTimer.stop();
	LogDetail(QString("[DefaultConnection] Socket disconnected from host"));
	emit disconnected();
}
Ejemplo n.º 29
0
// static
bool LegacySymmetric::Encrypt(
    const LegacySymmetric& theKey,
    const String& strPlaintext,
    String& strOutput,
    const String& pstrDisplay,
    bool bBookends,
    const OTPassword* pAlreadyHavePW)
{
    if (!theKey.IsGenerated()) {
        LogDetail(OT_METHOD)(__FUNCTION__)(
            ": Failure: theKey.IsGenerated() was false. (The calling "
            "code probably should have checked that key already...).")
            .Flush();
        return false;
    }

    if (!strPlaintext.Exists()) {
        LogDetail(OT_METHOD)(__FUNCTION__)(
            ": Plaintext is empty. Please supply. (Failure).")
            .Flush();
        return false;
    }

    // By this point, we know we have a plaintext and a symmetric Key.
    //
    std::unique_ptr<OTPassword> pPassUserInput;

    if (nullptr == pAlreadyHavePW) {
        const char* szDisplay = "Password-protecting a plaintext.";
        const auto strDisplay = String::Factory(
            (!pstrDisplay.Exists()) ? szDisplay : pstrDisplay.Get());

        pPassUserInput.reset(
            GetPassphraseFromUser(strDisplay));  // bAskTwice=false
                                                 // by default.
    } else
        pPassUserInput.reset(new OTPassword(*pAlreadyHavePW));

    auto ascOutput = Armored::Factory();
    bool bSuccess = false;

    if (nullptr != pPassUserInput)  // Success retrieving the passphrase from
                                    // the user. (Now let's encrypt...)
    {
        OTEnvelope theEnvelope;

        if (theEnvelope.Encrypt(
                strPlaintext,
                const_cast<LegacySymmetric&>(theKey),
                *pPassUserInput) &&
            theEnvelope.GetCiphertext(ascOutput)) {
            bSuccess = true;

            if (bBookends) {
                return ascOutput->WriteArmoredString(
                    strOutput,
                    "SYMMETRIC MSG",  // todo hardcoding.
                    false);           // bEscaped=false
            } else {
                strOutput.Set(ascOutput->Get());
            }
        } else {
            LogDetail(OT_METHOD)(__FUNCTION__)(
                ": Failed trying to encrypt. (Sorry).")
                .Flush();
        }
    } else
        LogDetail(OT_METHOD)(__FUNCTION__)(
            ": Sorry, unable to retrieve passphrase from user. (Failure).")
            .Flush();

    return bSuccess;
}
Ejemplo n.º 30
0
void DefaultConnection::startClientEncryption()
{
	LogDetail(QString("[DefaultConnection] Starting connection encryption"));
	FSocket.startClientEncryption();
}