29 #if !defined ONLY_LOCAL_PROXY || defined INCLUDE_FIRST_MIX
41 #ifdef HAVE_UNIX_DOMAIN_PROTOCOL
50 #ifdef WITH_CONTROL_CHANNELS_TEST
83 for(
UINT32 i=1;i<=tmpSocketsIn;i++)
98 CAMsg::printMsg(LOG_CRIT,
"No usable ListenerInterfaces specified (maybe wrong values or all are 'virtual'!\n");
116 m_bBreakNeeded = m_bReconfigured;
154 CAMsg::printMsg(LOG_CRIT,
"No next Mix specified! Please insert the address of a next mix into your configuration.\n");
161 "Cannot create SOCKET for connection to next Mix! Please check if the network and socket settings in your system are correct.\n");
183 CAMsg::printMsg(LOG_INFO,
"Established socket connection to next mix. Starting key exchange...\n");
185 #ifdef __BUILD_AS_SHADOW_PLUGIN__
193 CAMsg::printMsg(LOG_CRIT,
"Error in establishing secure communication with next Mix. Disconnecting...\n");
198 CAMsg::printMsg(LOG_INFO,
"Secure connection to next Mix was established successfully.\n");
219 #ifndef MULTI_THREADED_PACKET_PROCESSING
239 for (
UINT32 i = 0; i < m_numThreads; i++)
255 #ifdef REPLAY_DETECTION
288 nrOfChThread =
new CAThread((
UINT8*)
"CAFirstMix - Channel open logging thread");
289 nrOfChThread->setMainLoop(fm_loopLogChannelsOpened);
290 nrOfChThread->start(
this);
291 currentOpenedChannels = 0;
294 #ifdef LOG_PACKET_TIMES
295 m_pLogPacketStats=
new CALogPacketStats();
297 m_pLogPacketStats->start();
299 #ifdef REPLAY_DETECTION
311 CAMsg::printMsg(LOG_INFO,
"Try to connect to next Mix on %s ...\n",buff);
315 for(
UINT32 i=0; i < 100; i++)
319 if(m_bBreakNeeded != m_bReconfigured)
321 CAMsg::printMsg(LOG_DEBUG,
"CAFirstMix::connectToNextMix - Broken the connect loop!\n");
332 CAMsg::printMsg(LOG_ERR,
"Cannot connect to next Mix on %s. Reason: %s (%i)\n",
337 if (errLast != err || i % 10 == 0)
339 CAMsg::printMsg(LOG_ERR,
"Cannot connect to next Mix on %s. Reason: %s (%i). Retrying...\n",
376 CAMsg::printMsg(LOG_CRIT,
"Error receiving Key Info length from next mix!\n");
385 CAMsg::printMsg(LOG_WARNING,
"Unrealistic length for key info: %u We might not be able to get a connection.\n",
len);
412 DOMElement* elemMixes=doc->getDocumentElement();
413 if(elemMixes == NULL)
447 appendTermsAndConditionsExtension(doc, elemMixes);
462 #ifdef EXPORT_ASYM_PRIVATE_KEY
465 UINT32 keyFileBuffLen=8096;
469 m_pRSA->setPrivateKeyAsXML(keyBuff,keyFileBuffLen);
470 delete[] keyFileBuff;
478 #ifdef EXPORT_ASYM_PRIVATE_KEY
481 UINT32 keyFileBuffLen=8096;
485 m_pRSA->getPrivateKeyAsXML(keyBuff,&keyFileBuffLen);
486 saveFile(keyFileBuff,keyBuff,keyFileBuffLen);
487 delete[] keyFileBuff;
491 DOMNode* child=elemMixes->getLastChild();
501 docXmlKeyInfo->appendChild(elemRootKey);
502 DOMElement* elemMixProtocolVersion=
createDOMElement(docXmlKeyInfo,
"MixProtocolVersion");
504 elemRootKey->appendChild(elemMixProtocolVersion);
505 DOMNode* elemMixesKey=docXmlKeyInfo->importNode(elemMixes,
true);
506 elemRootKey->appendChild(elemMixesKey);
524 DOMElement* elemKey=NULL;
527 DOMElement* elemOwnMix=NULL;
529 elemOwnMix->appendChild(elemKey);
534 elemOwnMix->appendChild(termsAndConditionsInfoNode(docXmlKeyInfo));
538 elemOwnMix->appendChild(
createDOMElement(docXmlKeyInfo,
"SupportsEncrypedControlChannels"));
542 CAMsg::printMsg(LOG_DEBUG,
"Could not sign MixInfo sent to users...\n");
549 elemRootKey->appendChild(elemPayment);
563 CAMsg::printMsg(LOG_DEBUG,
"Could not sign KeyInfo sent to users...\n");
569 if (docXmlKeyInfo != NULL)
571 docXmlKeyInfo->release();
572 docXmlKeyInfo = NULL;
575 if(tmp32Len > 0xFFFD)
577 CAMsg::printMsg(LOG_CRIT,
"The key info size of %u bytes is too large for the clients. (maximum is %u)\n", 0xFFFD);
597 child=elemMixes->getFirstChild();
600 if(
equals(child->getNodeName(),
"Mix"))
606 if(nextMixCert != NULL)
608 CAMsg::printMsg(LOG_DEBUG,
"Next mix certificate was verified by a trusted root CA.\n");
613 CAMsg::printMsg(LOG_ERR,
"Could not verify certificate received from next mix!\n");
629 CAMsg::printMsg(LOG_CRIT,
"Could not verify the symmetric key from next mix! The operator of the next mix has to send you his current mix certificate, and you will have to import it in your configuration.\n");
637 CAMsg::printMsg(LOG_DEBUG,
"Successfully verified XML signature of next mix!\n");
642 DOMNode* rsaKey=child->getFirstChild();
645 DOMElement* elemNonce=NULL;
661 #ifdef SET_STATIC_MUX_SOCKET_KEY
662 CAMsg::printMsg(LOG_CRIT,
"Warning! Will use an all zero MuxSocket key - do not use this Mix in a productive environment -- only for testing!\n");
670 DOMElement* elemRoot=NULL;
672 docSymKey->appendChild(elemRoot);
677 elemRoot->appendChild(elemNonceHash);
683 DOMElement* elemKeepAlive=NULL;
684 DOMElement* elemKeepAliveSendInterval=NULL;
685 DOMElement* elemKeepAliveRecvInterval=NULL;
688 getDOMChildByName(elemKeepAlive,
"ReceiveInterval",elemKeepAliveRecvInterval,
false);
689 UINT32 tmpSendInterval,tmpRecvInterval;
692 CAMsg::printMsg(LOG_DEBUG,
"KeepAlive-Traffic: Getting offer -- SendInterval %u -- ReceiveInterval %u\n",tmpSendInterval,tmpRecvInterval);
699 elemKeepAlive->appendChild(elemKeepAliveSendInterval);
700 elemKeepAlive->appendChild(elemKeepAliveRecvInterval);
703 elemRoot->appendChild(elemKeepAlive);
704 CAMsg::printMsg(LOG_DEBUG,
"KeepAlive-Traffic: Offering -- SendInterval %u -- Receive Interval %u\n",u32KeepAliveSendInterval,u32KeepAliveRecvInterval);
719 if (docSymKey != NULL)
721 docSymKey->release();
726 UINT32 size = htonl(outlen);
727 CAMsg::printMsg(LOG_DEBUG,
"Sending symmetric key to next Mix! Size: %i\n", outlen);
735 child=child->getNextSibling();
786 #ifdef REPLAY_DETECTION
813 DOMElement *extensionRoot = NULL;
816 if(extensionRoot != NULL)
818 extensionRoot = (DOMElement *) root->removeChild(extensionRoot);
820 extensionRoot->release();
827 if(extensionsRoot == NULL)
832 DOMElement *tncDefs = NULL;
833 DOMElement *tncTemplates = NULL;
851 DOMElement *currentTnCList = NULL;
852 DOMElement *currentTnCEntry = NULL;
856 if(tncTemplates != NULL)
871 CAMsg::printMsg(LOG_ERR,
"Not a single TC Template specified! the Cascade is not properly configured.\n");
877 CAMsg::printMsg(LOG_ERR,
"No TC Template node found! Cascade is not properly configured.\n");
882 if(tncDefList->getLength() == 0)
894 currentTnCList = (DOMElement *) tncDefList->item(i);
900 for (XMLSize_t j = 0; j < tncDefEntryList->getLength(); j++)
902 currentTnCEntry = (DOMElement *) tncDefEntryList->item(j);
905 currentTnCEntry_templateRefid, ¤tTnCEntry_templateRefid_len);
907 currentTnCEntry_locale, ¤tTnCEntry_locale_len);
910 if(templateNode != NULL)
918 CAMsg::printMsg(LOG_CRIT,
"Could not find template %s for T&C %s.\n", currentTnCEntry_templateRefid, currentTnC_id);
934 if( (
m_tnCDefs == NULL) || (opSki == NULL) )
942 if(strncasecmp((
char *)
m_tnCDefs[i]->getID(),
943 (
const char *) opSki,
944 strlen((
char *)
m_tnCDefs[i]->getID())) == 0)
955 UINT8 *currentRefId = NULL;
961 match = (currentRefId != NULL) &&
963 delete [] currentRefId;
1010 CAMsg::printMsg(LOG_ERR,
"CAFirstMix::lm_loopSendToMix - Error in dequeueing MixPaket\n");
1017 CAMsg::printMsg(LOG_ERR,
"CAFirstMix::lm_loopSendToMix - Error in sending MixPaket\n");
1020 #if defined (LOG_PACKET_TIMES)
1021 if(!
isZero64(pQueueEntry->timestamp_proccessing_start))
1024 pFirstMix->m_pLogPacketStats->addToTimeingStats(*pQueueEntry,pMixPacket->
flags,
true);
1027 #ifdef DATA_RETENTION_LOG
1030 pQueueEntry->dataRetentionLogEntry.t_out=htonl(time(NULL));
1031 pFirstMix->m_pDataRetentionLog->log(&(pQueueEntry->dataRetentionLogEntry));
1050 #ifdef LOG_PACKET_TIMES
1051 setZero64(pPoolEntry->timestamp_proccessing_start);
1056 #ifdef LOG_PACKET_TIMES
1059 pPool->
pool(pPoolEntry);
1060 #ifdef LOG_PACKET_TIMES
1065 #ifdef LOG_PACKET_TIMES
1066 if(!
isZero64(pPoolEntry->timestamp_proccessing_start))
1069 pFirstMix->m_pLogPacketStats->addToTimeingStats(*pPoolEntry,pMixPacket->
flags,
true);
1103 pSocketGroup->
add(*pMuxSocket);
1107 UINT64 keepaliveNow,keepaliveLast;
1124 UINT32 keepaliveDiff =
diff64(keepaliveNow, keepaliveLast);
1125 if (keepaliveDiff > u32KeepAliveRecvInterval)
1127 CAMsg::printMsg(LOG_DEBUG,
"CAFirstMix::loopReadFromMix() -- restart because of KeepAlive-Traffic Timeout!\n");
1141 #ifdef LOG_PACKET_TIMES
1142 setZero64(pQueueEntry->timestamp_proccessing_start);
1157 CAMsg::printMsg(LOG_DEBUG,
"CAFirstMix::loopReadFromMix() - socket select error: %i\n",ret);
1164 ret = pMuxSocket->
receive(pMixPacket);
1165 #ifdef LOG_PACKET_TIMES
1171 CAMsg::printMsg(LOG_ERR,
"CAFirstMix::lm_loopReadFromMix - received returned: %i -- restarting!\n", ret);
1178 CAMsg::printMsg(LOG_DEBUG,
"CAFirstMix - sent a packet from the next mix to the ControlChanelDispatcher... \n");
1186 #ifdef LOG_PACKET_TIMES
1190 #ifdef LOG_PACKET_TIMES
1194 #ifdef ANON_DEBUG_MODE
1198 EVP_EncodeBlock(base64Payload, pMixPacket->
data,
DATA_SIZE);
1199 CAMsg::printMsg(LOG_DEBUG,
"Received Downstream AN.ON packet from previous Mix debug: %s\n", base64Payload);
1208 delete pSocketGroup;
1209 pSocketGroup = NULL;
1242 for(
UINT32 i = 0; i < size; i++)
1252 addr->
getIP(remoteIP);
1256 if(memcmp(
peerIP, remoteIP, 4) == 0)
1258 CAMsg::printMsg(LOG_DEBUG,
"Got InfoService connection: You are allowed for login...\n");
1288 #ifdef __BUILD_AS_SHADOW_PLUGIN__
1303 for(i=0;i<nSocketsIn;i++)
1305 while (socketsIn[i]->close() !=
E_SUCCESS)
1309 delete socketsIn[i];
1318 for(i=0;i<nSocketsIn;i++)
1320 psocketgroupAccept->
add(*socketsIn[i]);
1322 #ifdef REPLAY_DETECTION
1323 CAMsg::printMsg(LOG_DEBUG,
"Waiting for Replay Timestamp from next mixes\n");
1325 while(!pFirstMix->
m_bRestart && i < pFirstMix->m_u32MixCount-1)
1340 if (pIPBlockList->
count()>40)
1343 for(i=0;i<nSocketsIn;i++)
1345 psocketgroupAccept->
remove(*socketsIn[i]);
1346 while (socketsIn[i]->close() !=
E_SUCCESS)
1357 for(i=0;i<nSocketsIn;i++)
1359 psocketgroupAccept->
add(*socketsIn[i]);
1363 #ifdef __BUILD_AS_SHADOW_PLUGIN__
1365 countRead=psocketgroupAccept->
select();
1368 countRead = psocketgroupAccept->
select(10000);
1377 CAMsg::printMsg(LOG_DEBUG,
"UserAcceptLoop: countRead=%i\n",countRead);
1379 while(countRead>0&&i<nSocketsIn)
1381 if(psocketgroupAccept->
isSignaled(*socketsIn[i]))
1387 #ifdef SYM_CHANNEL_CIPHER_CTR
1389 #elif defined NO_ENCRYPTION
1431 CAMsg::printMsg(LOG_DEBUG,
"Could not insert IP address as IP could not be retrieved! We have %d login threads currently running.\n", pthreadsLogin->
countRequests());
1434 else if (retPeerIP < 0)
1436 CAMsg::printMsg(LOG_DEBUG,
"CAFirstMix Flooding protection: Could not insert IP address! We have %d login threads currently running.\n", pthreadsLogin->
countRequests());
1458 CAMsg::printMsg(LOG_ERR,
"Could not add an login request to the login thread pool!\n");
1465 delete pNewMuxSocket;
1466 pNewMuxSocket = NULL;
1486 delete psocketgroupAccept;
1487 psocketgroupAccept = NULL;
1520 time_t newIvalTS = 0, ival = 0;
1522 pFirstMix->nrOfChOpMutex->lock();
1523 pFirstMix->lastLogTime = time(NULL);
1524 pFirstMix->nrOfChOpMutex->unlock();
1530 pFirstMix->nrOfChOpMutex->lock();
1531 value = pFirstMix->nrOfOpenedChannels;
1532 total = pFirstMix->currentOpenedChannels;
1533 pFirstMix->nrOfOpenedChannels = 0;
1534 newIvalTS = time(NULL);
1535 ival = newIvalTS - pFirstMix->lastLogTime;
1536 pFirstMix->lastLogTime = newIvalTS;
1537 pFirstMix->nrOfChOpMutex->unlock();
1538 CAMsg::printMsg(LOG_INFO,
"Analyzing channels: Opened channels for %u JonDo connections in the last %u seconds, overall open channels: %u, users online: %u\n",
1553 #ifdef COUNTRY_STATS
1560 SAVE_STACK(
"CAFirstMix::fm_loopDoUserLogin",
"after user login");
1565 #ifdef COUNTRY_STATS
1578 const XMLCh* reqName = request->getDocumentElement()->getTagName();
1587 response->appendChild(responseRoot);
1591 DOMNodeList *requestedResourceItems = NULL;
1593 DOMNode *currentNode = NULL;
1594 DOMNode *currentAnswerNode = NULL;
1595 DOMNode *currentAnswerResourceNode = NULL;
1599 memset(
id, 0, idLen);
1603 memset(locale, 0, localeLen);
1605 bool resourceError =
false;
1607 if(requestedResources->getLength() == 0)
1609 response->release();
1615 for (XMLSize_t i = 0; i < requestedResources->getLength(); i++)
1619 bool validResource =
false;
1621 currentNode = requestedResources->item(i);
1624 (strlen((
char *)
id) < 1) )
1627 resourceError =
true;
1630 if(!currentNode->hasChildNodes())
1634 resourceError =
true;
1641 if(requestedTnC != NULL)
1644 for(XMLSize_t j = 0; j < requestedResourceItems->getLength(); j++)
1646 validResource =
false;
1663 if(requestedTranslation != NULL)
1666 currentAnswerNode = response->importNode(currentNode,
false);
1667 responseRoot->appendChild(currentAnswerNode);
1669 currentAnswerResourceNode,
false) ==
E_SUCCESS)
1671 currentAnswerResourceNode = response->importNode(currentAnswerResourceNode,
true);
1672 currentAnswerResourceNode->appendChild(
1673 response->importNode(requestedTranslation->
tnc_template,
true));
1674 currentAnswerNode->appendChild(currentAnswerResourceNode);
1675 validResource =
true;
1679 currentAnswerResourceNode,
false) ==
E_SUCCESS)
1681 currentAnswerResourceNode = response->importNode(currentAnswerResourceNode,
true);
1682 currentAnswerResourceNode->appendChild(
1683 response->importNode(requestedTranslation->
tnc_customized,
true));
1684 currentAnswerNode->appendChild(currentAnswerResourceNode);
1685 validResource =
true;
1706 response->release();
1719 bool tcAccepted =
false;
1721 CAMsg::printMsg(LOG_DEBUG,
"Client has%s accepted the T&Cs.\n", (tcAccepted ?
"" :
" not") );
1729 CAMsg::printMsg(LOG_DEBUG,
"client requested interrupting the tc login.\n");
1762 #ifdef __BUILD_AS_SHADOW_PLUGIN__
1768 CAMsg::printMsg(LOG_DEBUG,
"Error setting KeepAlive for user login connection!");
1774 SAVE_STACK(
"CAFirstMix::doUserLogin",
"after setting keep alive");
1781 CAMsg::printMsg(LOG_DEBUG,
"User login: Sending login data to client %u.%u.x.x has been interrupted! Reason: '%s' (%i)\n",
1799 SAVE_STACK(
"CAFirstMix::doUserLogin",
"after sending login data");
1808 CAMsg::printMsg(LOG_DEBUG,
"User login: Socket was closed while waiting for first symmetric key from client!\n");
1814 CAMsg::printMsg(LOG_DEBUG,
"User login: Waiting for first symmetric key from client %u.%u.x.x! failed for reason: '%s' (%i)\n",
1819 CAMsg::printMsg(LOG_DEBUG,
"User login: Waiting for first symmetric key from client %u.%u.x.x! failed.\n",
1830 CAMsg::printMsg(LOG_DEBUG,
"User login: received first symmetric key from client\n");
1832 SAVE_STACK(
"CAFirstMix::doUserLogin",
"received first symmetric key");
1834 xml_len=ntohs(xml_len);
1847 CAMsg::printMsg(LOG_DEBUG,
"User login: Waiting for second symmetric key from client failed for reason: '%s' (%i)\n",
1852 CAMsg::printMsg(LOG_DEBUG,
"User login: Waiting for second symmetric key from client failed.\n");
1866 CAMsg::printMsg(LOG_DEBUG,
"User login: received second symmetric key from client\n");
1868 SAVE_STACK(
"CAFirstMix::doUserLogin",
"received second symmetric key");
1870 XERCES_CPP_NAMESPACE::DOMDocument* doc=
parseDOMDocument(xml_buff+2,xml_len);
1871 DOMElement* elemRoot=NULL;
1872 if(doc==NULL||(elemRoot=doc->getDocumentElement())==NULL||
1887 elemRoot=doc->getDocumentElement();
1888 if(!
equals(elemRoot->getNodeName(),
"JAPKeyExchange"))
1902 DOMElement* elemLinkEnc=NULL;
1903 DOMElement* elemMixEnc=NULL;
1906 UINT8 linkKey[255],mixKey[255];
1907 UINT32 linkKeyLen=255,mixKeyLen=255;
1912 linkKeyLen!=64||mixKeyLen!=32)
1929 DOMElement* elemCredential = NULL;
1930 UINT8 buffUserCredential[255], buffMixCredential[255];
1931 UINT32 lenUserCredential = 255, lenMixCredential = 255;
1935 lenUserCredential!= lenMixCredential ||
1936 memcmp(buffMixCredential, buffUserCredential, lenMixCredential)!=0)
1955 DOMElement* elemControlChannelEnc=NULL;
1956 getDOMChildByName(elemRoot,
"ControlChannelEncryption",elemControlChannelEnc,
false);
1957 UINT8 controlchannelKey[255];
1958 UINT32 controlchannelKeyLen=255;
1959 UINT8* controlchannelRecvKey=NULL;
1960 UINT8* controlchannelSentKey=NULL;
1963 controlchannelKeyLen==32)
1965 controlchannelRecvKey=controlchannelKey;
1966 controlchannelSentKey=controlchannelKey+16;
1970 xml_buff[0]=(
UINT8)(xml_len>>8);
1971 xml_buff[1]=(
UINT8)(xml_len&0xFF);
1979 DOMElement *elemSig=NULL;
1982 DOMElement* elemDialog=NULL;
1984 UINT8 strDialog[255];
1985 memset(strDialog,0,255);
1989 #ifdef REPLAY_DETECTION
1991 DOMElement *elemReplay=NULL;
1996 (strncmp((
char*)replay,
"true",5)==0)){
1999 docSig->appendChild(elemRoot);
2000 elemRoot->appendChild(elemReplay);
2009 elemMix->appendChild(elemReplayOffset);
2012 elemMix->appendChild(elemReplayBase);
2013 elemReplay->appendChild(elemMix);
2022 elemMix->appendChild(elemReplayOffset);
2025 elemMix->appendChild(elemReplayOffset);
2026 elemReplay->appendChild(elemMix);
2029 elemRoot->appendChild(elemSig);
2035 docSig->appendChild(elemSig);
2038 #ifndef REPLAY_DETECTION
2040 docSig->appendChild(elemSig);
2043 elemSig->appendChild(elemSigValue);
2056 xml_buff[0]=(
UINT8)(u32>>8);
2057 xml_buff[1]=(
UINT8)(u32&0xFF);
2067 CAMsg::printMsg(LOG_DEBUG,
"User login: Sending key exchange signature has been interrupted!\n");
2078 CAMsg::printMsg(LOG_DEBUG,
"User login: key exchange signature sent\n");
2084 bool loginFailed =
false;
2085 bool tcProcedureFinished =
false;
2087 while( !(tcProcedureFinished || loginFailed) )
2089 UINT16 tcRequestDataLen = 0;
2101 CAMsg::printMsg(LOG_ERR,
"User login: Receiving t&c protocol data size has been interrupted. Reason: '%s' (%i)\n",
2106 CAMsg::printMsg(LOG_ERR,
"User login: Receiving t&c protocol data size has been interrupted.\n");
2111 tcRequestDataLen = ntohs(tcRequestDataLen);
2113 UINT8 tcDataBuf[tcRequestDataLen+1];
2114 tcDataBuf[tcRequestDataLen] = 0;
2127 CAMsg::printMsg(LOG_ERR,
"User login: Receiving t&c protocol data has been interrupted. Reason: '%s' (%i)\n",
2132 CAMsg::printMsg(LOG_ERR,
"User login: Receiving t&c protocol data has been interrupted.\n");
2137 XERCES_CPP_NAMESPACE::DOMDocument *tcData =
parseDOMDocument(tcDataBuf, tcRequestDataLen);
2138 if( (tcData == NULL) || (tcData->getDocumentElement() == NULL) )
2158 if(answerBuff != NULL)
2162 UINT32 netSize = htonl(size);
2167 CAMsg::printMsg(LOG_DEBUG,
"User login: sending t&c protocol data size has been interrupted!\n");
2173 CAMsg::printMsg(LOG_DEBUG,
"User login: Sending t&c protocol data has been interrupted!\n");
2176 delete [] answerBuff;
2207 SAVE_STACK(
"CAFirstMix::doUserLogin",
"sent key exchange signature");
2211 SAVE_STACK(
"CAFirstMix::doUserLogin",
"Creating CAQueue...");
2214 SAVE_STACK(
"CAFirstMix::doUserLogin",
"Adding user to connection list...");
2218 #ifndef MULTI_THREADED_PACKET_PROCESSING
2226 if( (pHashEntry == NULL) ||
2234 CAMsg::printMsg(LOG_ERR,
"User login: Could not add new socket to connection list!\n");
2235 if (pHashEntry != NULL)
2237 #ifndef MULTI_THREADED_PACKET_PROCESSING
2251 SAVE_STACK(
"CAFirstMix::doUserLogin",
"socket added to connection list");
2254 CAMsg::printMsg(LOG_DEBUG,
"User login: registering payment control channel\n");
2257 SAVE_STACK(
"CAFirstMix::doUserLogin",
"payment registered");
2273 SAVE_STACK(
"CAFirstMix::doUserLogin",
"Starting AI login procedure");
2275 CAMsg::printMsg(LOG_DEBUG,
"Starting AI login procedure for owner %x \n", pHashEntry);
2282 SINT32 aiLoginStatus = 0;
2292 if(paymentLoginPacket->
channel > 0 && paymentLoginPacket->
channel < 256)
2300 while(controlMessages->
getSize()>0)
2302 controlMessages->
get((
UINT8*)aiAnswerQueueEntry,&qlen);
2324 SAVE_STACK(
"CAFirstMix::doUserLogin",
"AI login packages exchanged.");
2336 CAMsg::printMsg(LOG_DEBUG,
"AI login messages successfully exchanged: now starting settlement for user account balancing check\n");
2346 CAMsg::printMsg(LOG_DEBUG,
"AI login messages successfully exchanged: skipping settlement, user has valid prepaid amount\n");
2356 while(controlMessages->
getSize()>0)
2358 controlMessages->
get((
UINT8*)aiAnswerQueueEntry,&qlen);
2371 CAMsg::printMsg(LOG_INFO,
"AI login: net error occured after settling: %s\n", strerror(errnum));
2384 delete paymentLoginPacket;
2385 paymentLoginPacket = NULL;
2386 delete aiAnswerQueueEntry;
2387 aiAnswerQueueEntry = NULL;
2389 SAVE_STACK(
"CAFirstMix::doUserLogin",
"AI login procedure finished.");
2394 CAMsg::printMsg(LOG_INFO,
"User AI login failed: deleting socket %x\n", pHashEntry);
2415 for (
UINT32 iAccount = 0; iAccount < nrOfSurveillanceAccounts; iAccount++)
2417 if (accountNumber == surveillanceAccounts[iAccount])
2428 CAMsg::printMsg(LOG_INFO,
"User AI login successful for owner %x\n", pHashEntry);
2432 #ifdef WITH_CONTROL_CHANNELS_TEST
2435 #ifdef REPLAY_DETECTION
2438 #ifdef COUNTRY_STATS
2444 #ifndef MULTI_THREADED_PACKET_PROCESSING
2452 #ifndef MULTI_THREADED_PACKET_PROCESSING
2455 CAMsg::printMsg(LOG_DEBUG,
"User login: Adding to m_psocketgroupUsersRead failed!\n");
2459 CAMsg::printMsg(LOG_DEBUG,
"User login: Adding to m_psocketgroupUsersWrite failed!\n");
2464 CAMsg::printMsg(LOG_DEBUG,
"User login: Adding to m_psocketgroupUsersRead failed!\n");
2468 CAMsg::printMsg(LOG_DEBUG,
"User login: Adding to m_psocketgroupUsersWrite failed!\n");
2476 CAMsg::printMsg(LOG_INFO,
"User login: finished -- connection-ID: %Lu -- country-id: %u -- dialog: %s\n",pHashEntry->
id,pHashEntry->
countryID,pHashEntry->strDialog);
2678 if(nrOfChThread != NULL)
2680 nrOfChThread->
join();
2681 delete nrOfChThread;
2682 nrOfChThread = NULL;
2686 #ifdef LOG_PACKET_TIMES
2687 if(m_pLogPacketStats!=NULL)
2689 CAMsg::printMsg(LOG_CRIT,
"Wait for LoopLogPacketStats to terminate!\n");
2690 m_pLogPacketStats->stop();
2691 delete m_pLogPacketStats;
2693 m_pLogPacketStats=NULL;
2709 #ifdef REPLAY_DETECTION
2729 #ifdef COUNTRY_STATS
2742 #ifndef MULTI_THREADED_PACKET_PROCESSING
2745 CAMsg::printMsg(LOG_CRIT,
"Before deleting CAFirstMixChannelList()!\n");
2748 while(pHashEntry!=NULL)
2764 pMuxSocket->
close();
2780 #ifndef MULTI_THREADED_PACKET_PROCESSING
2849 CAMsg::printMsg(LOG_DEBUG,
"Set new ressources limitation parameters\n");
2850 #ifndef MULTI_THREADED_PACKET_PROCESSING
2874 DOMNode* child=nl->item(i);
2909 #ifdef REPLAY_DETECTION
2920 #ifdef COUNTRY_STATS
2921 #define COUNTRY_STATS_DB "CountryStats"
2922 #define NR_OF_COUNTRIES 254
2931 if(str[i]==
'.'||str[i]==
':'||str[i]==
'/'||str[i]==
'\\')
2941 #ifdef HAVE_MYSQL_OPT_RECONNECT
2943 mysql_options(
m_mysqlCon,MYSQL_OPT_RECONNECT,&thetrue);
2960 sprintf(query,
"CREATE TABLE IF NOT EXISTS `stats_%s` (date timestamp,id int,count int,packets_in int,packets_out int)",buff);
2964 CAMsg::printMsg(LOG_INFO,
"CountryStats DB - create table for %s failed!\n",buff);
3018 UINT32 countryID=a_countryID;
3021 UINT32 u32ip=ip[0]<<24|ip[1]<<16|ip[2]<<8|ip[3];
3023 sprintf(query,
"SELECT id FROM ip2c WHERE ip_lo<=\"%u\" and ip_hi>=\"%u\" LIMIT 1",u32ip,u32ip);
3027 CAMsg::printMsg(LOG_INFO,
"CountryStatsDB - updateCountryStats - error (%i) in finding countryid for ip %u\n",ret,u32ip);
3030 MYSQL_RES* result=mysql_store_result(
m_mysqlCon);
3033 CAMsg::printMsg(LOG_INFO,
"CountryStatsDB - updateCountryStats - error in retriving results of the query\n");
3036 MYSQL_ROW row=mysql_fetch_row(result);
3042 CAMsg::printMsg(LOG_DEBUG,
"Country ID for ip %u is %u\n",u32ip,countryID);
3047 CAMsg::printMsg(LOG_DEBUG,
"Country ID for ip %u.%u.%u.%u is %u\n",ip[0],ip[1],ip[2],ip[3],countryID);
3052 CAMsg::printMsg(LOG_DEBUG,
"DO country stats query result no result for ip %u)\n",u32ip);
3054 mysql_free_result(result);
3069 mysql_thread_init();
3082 time_t aktTime=time(NULL);
3083 strftime((
char*)aktDate,255,
"%Y%m%d%H%M%S",gmtime(&aktTime));
3085 sprintf(query,
"INSERT into `stats_%s` (date,id,count,packets_in,packets_out) VALUES (\"%s\",\"%%u\",\"%%u\",\"%%u\",\"%%u\")",buff,aktDate);
3091 char aktQuery[1024];
3096 CAMsg::printMsg(LOG_INFO,
"CountryStats DB - failed to update CountryStats DB with new values - error %i\n",ret);
#define OPTIONS_ATTRIBUTE_TNC_ID
#define OPTIONS_NODE_TNCS_TEMPLATES
#define OPTIONS_NODE_TNCS
#define OPTIONS_ATTRIBUTE_TNC_LOCALE
#define OPTIONS_ATTRIBUTE_TNC_TEMPLATE_REFID
#define OPTIONS_NODE_TNCS_TRANSLATION
THREAD_RETURN fm_loopLog(void *param)
THREAD_RETURN fm_loopDoUserLogin(void *param)
struct T_UserLoginData t_UserLoginData
THREAD_RETURN fm_loopReadFromMix(void *pParam)
THREAD_RETURN iplist_loopDoLogCountries(void *param)
THREAD_RETURN fm_loopAcceptUsers(void *param)
THREAD_RETURN fm_loopSendToMix(void *param)
How to end this thread: 0.
SINT32 isAllowedToPassRestrictions(CASocket *pNewMuxSocket)
void mysqlEscapeTableName(UINT8 *str)
Escape a string so tha it could be used as table anme.
#define TNC_RESPONSE_INVALID_REQUEST
#define TNC_RESOURCE_TEMPLATE
#define TNC_REQ_TRANSLATION
#define TNC_TEMPLATE_ROOT_ELEMENT
#define TNC_RESOURCE_CUSTOMIZED_SECT
#define KEYINFO_NODE_TNC_EXTENSION
#define KEYINFO_NODE_EXTENSIONS
#define MONITORING_FIRE_NET_EVENT(e_type)
#define BEGIN_STACK(methodName)
#define FINISH_STACK(methodName)
#define SAVE_STACK(methodName, methodPosition)
SINT32 setDOMElementAttribute(DOMNode *pElem, const char *attrName, const char *value)
SINT32 getcurrentTimeMillis(UINT64 &u64Time)
Gets the current Systemtime in milli seconds.
SINT32 getDOMElementValue(const DOMNode *const pElem, UINT8 *value, UINT32 *valuelen)
Returns the content of the text node(s) under elem as null-terminated C String.
UINT8 * readFile(const UINT8 *const name, UINT32 *size)
ONLY_LOCAL_PROXY or first.
SINT32 setDOMElementValue(DOMElement *pElem, SINT32 value)
SINT32 getcurrentTimeMicros(UINT64 &u64Time)
Gets the current Systemtime in micros seconds.
bool equals(const XMLCh *const e1, const char *const e2)
SINT32 sSleep(UINT32 sec)
Sleeps sec Seconds.
UINT8 * getTermsAndConditionsTemplateRefId(DOMNode *tcTemplateRoot)
XERCES_CPP_NAMESPACE::DOMDocument * parseDOMDocument(const UINT8 *const buff, UINT32 len)
Parses a buffer containing an XML document and returns this document.
DOMNodeList * getElementsByTagName(DOMElement *pElem, const char *const name)
SINT32 getRandom(UINT32 *val)
Gets 32 random bits.
SINT32 decryptXMLElement(DOMNode *node, CAASymCipher *pRSA)
Replaces a DOM element with a deencrypted version of this element.
XERCES_CPP_NAMESPACE::DOMDocument * createDOMDocument()
Parses a timestamp in JDBC timestamp escape format (as it comes from the BI) and outputs the value in...
DOMElement * createDOMElement(XERCES_CPP_NAMESPACE::DOMDocument *pOwnerDoc, const char *const name)
Creates a new DOMElement with the given name which belongs to the DOMDocument owernDoc.
SINT32 getDOMChildByName(const DOMNode *pNode, const char *const name, DOMElement *&child, bool deep)
SINT32 getDOMElementAttribute(const DOMNode *const elem, const char *attrName, UINT8 *value, UINT32 *len)
void logMemoryUsage()
Log information about the current memory (heap) usage.
SINT32 saveFile(const UINT8 *const name, const UINT8 *const buff, UINT32 buffSize)
SINT32 encodeXMLEncryptedKey(UINT8 *key, UINT32 keylen, UINT8 *xml, UINT32 *xmllen, CAASymCipher *pRSA)
SINT32 msSleep(UINT32 ms)
Sleeps ms milliseconds.
UINT32 diff64(const UINT64 &bigop, const UINT64 &smallop)
void setZero64(UINT64 &op1)
bool isZero64(UINT64 &op1)
#define TEMPLATE_REFID_MAXLEN
void set64(UINT64 &op1, UINT32 op2)
#define NUM_LOGIN_WORKER_TRHEADS
#define GET_NET_ERROR_STR(x)
#define MIX_CASCADE_PROTOCOL_VERSION
#define ERR_INTERN_CONNREFUSED
#define THREAD_RETURN_SUCCESS
#define FIRST_MIX_RECEIVE_SYM_KEY_FROM_JAP_TIME_OUT
#define CHANNELS_PER_CLIENT
#define MAX_READ_FROM_NEXT_MIX_QUEUE_SIZE
#define ERR_INTERN_TIMEDOUT
#define AI_LOGIN_SO_TIMEOUT
#define FM_PACKET_STATS_LOG_INTERVALL
#define LOG_COUNTRIES_INTERVALL
void cleanupTnCMixAnswer(termsAndConditionMixAnswer_t *answer)
IMPORTANT NOTE: all methods does NOT incorporate locking over the translation store and thus are NOT ...
SINT32 getPublicKeyAsDOMElement(DOMElement *&elemRoot, XERCES_CPP_NAMESPACE::DOMDocument *docOwner)
SINT32 setPublicKeyAsDOMNode(DOMNode *node)
SINT32 generateKeyPair(UINT32 size)
Generates a new random key-pair of size bits.
implementation of a per-user control-channel for the AccountingInstance.
static SINT32 init(CAFirstMix *callingMix)
Returns a reference to the Singleton instance.
static SINT32 loginProcessStatus(fmHashTableEntry *pHashEntry)
static SINT32 newSettlementTransaction()
static UINT64 unlockLogin(fmHashTableEntry *ownerRef)
release login (particularly for use in error case) this function is thread-safe.
static UINT32 getNrOfUsers()
static SINT32 finishLoginProcess(fmHashTableEntry *pHashEntry)
this method is for the corresponding CAFirstMix login thread to verify the result of the settlement.
static SINT32 encode(const UINT8 *in, UINT32 len, UINT8 *out, UINT32 *outlen)
fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff...
static SINT32 decode(const UINT8 *in, UINT32 len, UINT8 *out, UINT32 *outlen)
fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff...
CACertificate * verifyMixCert(DOMNode *mixNode)
This function parses the certificates from a <Mix>-node and tries to build a certPath to the trusted ...
UINT32 getListenerInterfaceCount()
SINT32 createSockets(bool a_bPrintMessages, CASocket **a_sockets, UINT32 a_socketsLen)
SINT32 getMixId(UINT8 *id, UINT32 len)
SINT32 getCascadeName(UINT8 *name, UINT32 len) const
UINT32 getKeepAliveRecvInterval()
CAMultiSignature * getMultiSigner()
SINT32 getCountryStatsDBConnectionLoginData(char **db_host, char **db_user, char **db_passwd)
CAListenerInterface * getListenerInterface(UINT32 nr)
CACertificate * getNextMixTestCertificate()
SINT32 setNextMixTestCertificate(CACertificate *cert)
UINT32 getKeepAliveSendInterval()
CACertStore * getTrustedCertificateStore()
UINT32 getTargetInterfaceCount()
bool verifyMixCertificates()
CAListenerInterface ** getInfoServices(UINT32 &r_size)
SINT32 getTargetInterface(CATargetInterface &oTargetInterface, UINT32 nr)
Fills a TargetInterface struct with the values which belongs to the target interface nr.
This class "dispatches" messages which it receives via proccessMixPacket() to the associated control ...
SINT32 registerControlChannel(CAAbstractControlChannel *pControlChannel)
Registers a control channel for receiving messages.
bool proccessMixPacket(const MIXPACKET *pPacket)
Data structure that stores all information about the currently open Mix channels.
fmChannelListEntry * getFirstChannelForSocket(CAMuxSocket *pMuxSocket)
Gets the first channel for a given connection.
void setDelayParameters(UINT32 unlimitTraffic, UINT32 bucketGrow, UINT32 intervall)
fmHashTableEntry * getFirst()
Gets the first connection of all connections in the list.
fmChannelListEntry * get(CAMuxSocket *pMuxSocket, HCHANNEL channelIn)
Returns the information for a given Input-Channel-ID.
fmHashTableEntry * getNext()
Gets the next entry in the connections-list.
bool forceKickout(fmHashTableEntry *pHashTableEntry, const XERCES_CPP_NAMESPACE::DOMDocument *pErrDoc)
forces a kickout for this entry if the entry is still valid and sends an errorMessage via the control...
fmChannelListEntry * getNextChannel(fmChannelListEntry *pEntry)
Gets the next channel for a given connection.
fmHashTableEntry * add(CAMuxSocket *pMuxSocket, const UINT8 peerIP[4], CAQueue *pQueueSend, UINT8 *controlChannelKeyRecv, UINT8 *controlChannelKeySent)
Adds a new TCP/IP connection (a new user) to the channel list.
SINT32 remove(CAMuxSocket *pMuxSocket)
Removes all channels, which belongs to the given connection and the connection itself from the list.
SINT32 pushTimeoutEntry(fmHashTableEntry *pHashTableEntry, bool kickoutForced=!KICKOUT_FORCED)
adds the entry to the timeout queue with mutex
CAThread * m_pthreadReadFromMix
CASocket ** m_arrSocketsIn
SINT32 updateCountryStats(const UINT8 ip[4], UINT32 a_countryID, bool bRemove)
Update the statisitics of the countries users come from.
const XMLCh * TNC_CONFIRM
friend THREAD_RETURN fm_loopSendToMix(void *)
How to end this thread: 0.
UINT32 m_nrOfTermsAndConditionsTemplates
virtual SINT32 processKeyExchange()
SINT32 doUserLogin(CAMuxSocket *pNewUSer, UINT8 perrIP[4])
termsAndConditionMixAnswer_t * handleTermsAndConditionsLogin(XERCES_CPP_NAMESPACE::DOMDocument *request)
SINT32 getLevel(SINT32 *puser, SINT32 *prisk, SINT32 *ptraffic)
SINT32 getMixedPackets(UINT64 &ppackets)
SINT32 initCountryStats(char *db_host, char *db_user, char *db_passwd)
tMixParameters * m_arMixParameters
CAThread * m_pthreadAcceptUsers
CAQueue * m_pQueueSendToMix
DOMNode * getTermsAndConditionsTemplate(UINT8 *templateRefID)
volatile UINT32 m_newConnections
friend THREAD_RETURN iplist_loopDoLogCountries(void *param)
SINT32 incUsers(LP_fmHashTableEntry pHashEntry)
volatile bool m_bRunLogCountries
CASocketGroupEpoll * m_psocketgroupUsersWrite
UINT32 m_nrOfTermsAndConditionsDefs
XERCES_CPP_NAMESPACE::DOMDocument * m_templatesOwner
static const UINT32 MAX_CONCURRENT_NEW_CONNECTIONS
CAThread * m_threadLogLoop
const XMLCh * TNC_INTERRUPT
CAThread * m_pthreadSendToMix
UINT64 m_u64LastTimestampReceived
CASocketGroupEpoll * m_psocketgroupUsersRead
CATempIPBlockList * m_pIPBlockList
tUINT32withLock * m_PacketsPerCountryOUT
SINT32 doUserLogin_internal(CAMuxSocket *pNewUSer, UINT8 perrIP[4])
Sends and receives all data neccessary for a User to "login".
friend THREAD_RETURN fm_loopAcceptUsers(void *)
SINT32 setMixParameters(const tMixParameters ¶ms)
Sets the parameters for the mix specified in the params.m_strMixID field.
friend THREAD_RETURN fm_loopReadFromMix(void *)
SINT32 sendReplayTimestampRequestsToAllMixes()
virtual SINT32 initOnce()
CAFirstMixChannelList * m_pChannelList
TermsAndConditions * getTermsAndConditions(const UINT8 *opSki)
tUINT32withLock * m_PacketsPerCountryIN
SINT32 handleTermsAndConditionsExtension(DOMElement *extensionRoot)
bool forceKickout(fmHashTableEntry *pHashTableEntry, const XERCES_CPP_NAMESPACE::DOMDocument *pErrDoc=NULL)
CAThreadPool * m_pthreadsLogin
TermsAndConditions ** m_tnCDefs
const XMLCh * TNC_REQUEST
CAQueue * m_pQueueReadFromMix
volatile UINT32 * m_CountryStats
SINT32 initMixParameters(DOMElement *elemMixes)
Initialises the MixParameters info for each mix form the <Mixes> element received from the second mix...
SINT32 deleteCountryStats()
SINT32 connectToNextMix(CASocketAddr *a_pAddrNext)
SINT32 handleKeyInfoExtensions(DOMElement *root)
XERCES_CPP_NAMESPACE::DOMDocument * m_docMixCascadeInfo
The purpose of this class is to store a list of IP-Addresses.
SINT32 insertIP(const UINT8 ip[4])
Inserts the IP-Address into the list.
SINT32 removeIP(const UINT8 ip[4])
Removes the IP-Address from the list.
static CACmdLnOptions * getOptions()
SINT32 appendCompatibilityInfo(DOMNode *a_parent)
SINT32 checkCompatibility(DOMNode *a_parent, const char *a_mixPosition)
CAInfoService * m_pInfoService
SINT32 signXML(DOMNode *a_element)
static const UINT32 TIMEOUT_MIX_CONNECTION_ESTABLISHEMENT
SINT32 addMixInfo(DOMNode *a_element, bool a_bForceFirstNode)
CAControlChannelDispatcher * m_pMuxOutControlChannelDispatcher
UINT32 m_u32KeepAliveRecvInterval
CAMultiSignature * m_pMultiSignature
virtual SINT32 initMixCascadeInfo(DOMElement *elemMixes)
This will initialize the XML Cascade Info struct XMLFirstMixToInfoService that is sent to the InfoSer...
virtual SINT32 initOnce()
UINT32 m_u32KeepAliveSendInterval
UINT64 m_u64ReferenceTime
CAReplayCtrlChannelMsgProc * m_pReplayMsgProc
static SINT32 printMsg(UINT32 typ, const char *format,...)
Writes a given message to the log.
SINT32 sign(UINT8 *in, UINT32 inlen, UINT8 *sig, UINT32 *siglen)
Method for producing a single Signature for Key Exchange.
static SINT32 verifyXML(const UINT8 *const in, UINT32 inlen, CACertificate *a_cert)
SINT32 signXML(DOMNode *a_node, bool appendCerts)
SINT32 close()
Closes the underlying socket.
SINT32 receive(MIXPACKET *pPacket)
Receives a whole MixPacket.
SINT32 connect(CASocketAddr &psa)
SINT32 setSendKey(UINT8 *key, UINT32 keyLen)
SINT32 setReceiveKey(UINT8 *key, UINT32 keyLen)
SINT32 send(MIXPACKET *pPacket)
Sends a MixPacket over the Network.
SINT32 getHashKey()
Returns a Hashkey which uniquely identifies this socket.
SINT32 receiveFully(UINT8 *buff, UINT32 len)
Receives some "plain" bytes from the underlying socket - just a convenient function....
SINT32 prepareForSend(MIXPACKET *inoutPacket)
This class implements the pool strategie of a Mix.
SINT32 pool(tPoolEntry *pPoolEntry)
This is a simple FIFO-Queue.
SINT32 add(const void *buff, UINT32 size)
Adds data to the Queue.
SINT32 getOrWait(UINT8 *pbuff, UINT32 *psize)
Gets data from the Queue or waits until some data is available, if the Queue is empty.
SINT32 get(UINT8 *pbuff, UINT32 *psize)
Gets up to psize number of bytes from the Queue.
UINT32 getSize()
Returns the size of stored data in byte.
A Control channel for the exchange of the current replay detection timestamps.
SINT32 sendGetTimestamp(const UINT8 *strMixID)
Sends upstram a request for the replay timestamp for the given mix.
This is an abstract class for representing a socket address used in CASocket, CADatagramSocket and CA...
virtual SINT32 getType() const =0
The type (family) of socket for which this address is useful.
virtual SINT32 toString(UINT8 *buff, UINT32 bufflen) const =0
Returns a string which describes this address in a human readable form.
This class represents a socket address for Internet (IP) connections.
SINT32 getIP(UINT8 buff[4]) const
Returns the IP-Numbers for this address.
SINT32 remove(CASocket &s)
bool isSignaled(CASocket &s)
SINT32 add(CASocket &s)
Adds the socket s to the socket group.
virtual SINT32 send(const UINT8 *buff, UINT32 len)
Sends some data over the network.
virtual SINT32 setKeepAlive(bool b)
Enables/disables the socket keep-alive option.
virtual SINT32 setRecvBuff(UINT32 r)
virtual SINT32 receiveFullyT(UINT8 *buff, UINT32 len, UINT32 msTimeOut)
Trys to receive all bytes.
virtual SINT32 getSendBuff()
virtual SINT32 getPeerIP(UINT8 ip[4])
virtual SINT32 setNonBlocking(bool b)
virtual SINT32 setSendBuff(SINT32 r)
Returns < 0 on error, otherwise the new sendbuffersize (which may be less than r)
virtual SINT32 accept(CASocket &s)
Accepts a new connection.
virtual SINT32 getRecvBuff()
virtual SINT32 sendFullyTimeOut(const UINT8 *buff, UINT32 len, UINT32 msTimeOut, UINT32 msTimeOutSingleSend)
Sends all data over the network.
static UINT32 countOpenSockets()
static CASymChannelCipher * createCipher(SYMCHANNELCIPHER_ALGORITHM alg)
virtual SINT32 setKey(const UINT8 *key)=0
Sets the keys for crypt1() and crypt2() to the same key.
virtual SINT32 setIVs(const UINT8 *p_iv)=0
Sets iv1 and iv2 to p_iv.
TargetType getTargetType() const
CASocketAddr * getAddr() const
The purpose of this class is storing the IPs of JAP users who tried to hack/attack the payment system...
SINT32 insertIP(const UINT8 ip[4])
inserts an IP into the blocklist
SINT32 checkIP(const UINT8 ip[4])
check whether an IP is blocked
SINT32 start(void *param, bool bDaemon=false, bool bSilent=false)
Starts the execution of the main function of this thread.
SINT32 setMainLoop(THREAD_MAIN_TYP fnc)
Sets the main function which will be executed within this thread.
SINT32 join()
Waits for the main function to finish execution.
SINT32 addRequest(THREAD_MAIN_TYP, void *args)
Adds a new request (task) to this threadpool.
static SINT32 dumpToMem(const DOMNode *node, UINT8 *buff, UINT32 *size)
Dumps the node and all childs into buff.
const termsAndConditionsTranslation_t * getTranslation(const UINT8 *locale)
returns the specific TermsAndconditions translation for the the language with the specified language ...
void addTranslation(const UINT8 *locale, DOMNode *tnc_customized, DOMNode *tnc_template)
add a language specific terms and Conditions document, which can be retrieved by *getTermsAndConditio...
@ ev_net_nextConnectionClosed
@ ev_net_keyExchangeNextSuccessful
CASymChannelCipher * pCipher
CAQueue * pControlMessageQueue
CASymChannelCipher * pSymCipher
CAControlChannelDispatcher * pControlChannelDispatcher
XERCES_CPP_NAMESPACE::DOMDocument * xmlAnswer
#define AUTH_LOGIN_NOT_FINISHED
#define AUTH_LOGIN_FAILED
#define AUTH_WAITING_FOR_FIRST_SETTLED_CC
First CC from client has not been settled yet.
struct t_queue_entry tQueueEntry
#define AUTH_LOGIN_SKIP_SETTLEMENT