|
Mixes for Privacy and Anonymity in the Internet
|
Public Member Functions | |
| ~CAMsg () | |
Static Public Member Functions | |
| static SINT32 | init () |
| static SINT32 | cleanup () |
| static SINT32 | setLogOptions (UINT32 options) |
| static SINT32 | setLogLevel (UINT32 a_logLevel) |
| static SINT32 | setMaxLogFileSize (UINT64 size) |
| static SINT32 | printMsg (UINT32 typ, const char *format,...) |
| static SINT32 | openEncryptedLog () |
| Open a log, where the logged messages are store encrypted. | |
| static SINT32 | closeEncryptedLog () |
Private Member Functions | |
| CAMsg () | |
| SINT32 | openLog (UINT32 type) |
| SINT32 | closeLog () |
| SINT32 | rotateLog () |
| char * | createLogFileMessage (UINT32 opt) |
| char * | createLogDirMessage (UINT32 opt) |
Private Attributes | |
| SINT64 | m_maxLogFileSize |
| UINT32 | m_NrOfWrites |
| UINT32 | m_uLogType |
| UINT32 | m_logLevel |
| UINT32 | m_lastLogFileNumber |
| bool | m_alreadyOpened |
| int | m_hFileEncrypted |
| int | m_hFileInfo |
| char * | m_strMsgBuff |
| char * | m_strLogFile |
| char * | m_strLogDir |
| CAMutex * | m_pcsPrint |
| t_LogEncCipher * | m_pCipher |
Static Private Attributes | |
| static CAMsg * | pMsg = NULL |
| static const char *const | m_strMsgTypes [6] = {", error ] ",", critical] ",", info ] ",", debug ] ",", special ] ",", warning ] "} |
| CAMsg::CAMsg | ( | ) | [private] |
References m_alreadyOpened, m_hFileEncrypted, m_hFileInfo, m_lastLogFileNumber, m_logLevel, m_maxLogFileSize, m_pCipher, m_pcsPrint, m_strLogFile, m_strMsgBuff, m_uLogType, MAX_MSG_SIZE, MSG_STDOUT, setZero64(), and STRMSGTYPES_SIZE.
Referenced by init().
| CAMsg::~CAMsg | ( | ) |
References closeEncryptedLog(), closeLog(), m_pcsPrint, m_strLogFile, and m_strMsgBuff.
| static SINT32 CAMsg::cleanup | ( | ) | [static] |
References closeLog(), E_SUCCESS, and pMsg.
Referenced by main().
| SINT32 CAMsg::closeEncryptedLog | ( | ) | [static] |
References E_SUCCESS, m_hFileEncrypted, m_pCipher, and pMsg.
Referenced by ~CAMsg().
| SINT32 CAMsg::closeLog | ( | ) | [private] |
References E_SUCCESS, m_hFileInfo, m_uLogType, MSG_COMPRESSED_FILE, MSG_FILE, MSG_LOG, and pMsg.
Referenced by cleanup(), printMsg(), setLogOptions(), and ~CAMsg().
| char * CAMsg::createLogDirMessage | ( | UINT32 | opt | ) | [private] |
References m_strLogDir, MSG_COMPRESSED_FILE, MSG_FILE, and pMsg.
Referenced by setLogOptions().
| char * CAMsg::createLogFileMessage | ( | UINT32 | opt | ) | [private] |
References m_strLogFile, MSG_COMPRESSED_FILE, MSG_FILE, and pMsg.
Referenced by setLogOptions().
| static SINT32 CAMsg::init | ( | ) | [static] |
| SINT32 CAMsg::openEncryptedLog | ( | ) | [static] |
Open a log, where the logged messages are store encrypted.
The file format is as follows: NEWLINE "----Start of EncryptionKey----" NEWLINE 128 random bytes (BASE64 encoded of RSA encrpyted block) which are used as sym key (16 bytes starting form 50. byte) and IV (next 16 bytes) NEWLINE "-----End of EncryptionKey-----" NEWLINE encrpyted messages
The message is encrypted using AES-128-OFB.
References E_SUCCESS, E_UNKNOWN, CABase64::encode(), CAASymCipher::encrypt(), FILENAME_ENCRYPTEDLOG, CACmdLnOptions::getLogEncryptionKey(), CALibProxytest::getOptions(), getRandom(), S_LOGENCCIPHER::iv, S_LOGENCCIPHER::iv_off, m_hFileEncrypted, m_pCipher, S_LOGENCCIPHER::oKey, pMsg, and CAASymCipher::setPublicKey().
Referenced by CACmdLnOptions::initLogging().
| SINT32 CAMsg::openLog | ( | UINT32 | type | ) | [private] |
References E_FILE_OPEN, E_SUCCESS, E_UNKNOWN, FILENAME_INFOLOG, FILENAME_INFOLOG_GZ, GET_NET_ERROR, CALibProxytest::getOptions(), m_alreadyOpened, m_hFileInfo, m_NrOfWrites, m_strLogDir, m_strLogFile, MSG_COMPRESSED_FILE, MSG_FILE, MSG_LOG, rotateLog(), SET_NET_ERROR, and setMaxLogFileSize().
Referenced by printMsg(), and setLogOptions().
| SINT32 CAMsg::printMsg | ( | UINT32 | typ, |
| const char * | format, | ||
| ... | |||
| ) | [static] |
References closeLog(), E_SUCCESS, E_UNKNOWN, filesize64(), isGreater64(), isZero64(), S_LOGENCCIPHER::iv, S_LOGENCCIPHER::iv_off, CAMutex::lock(), LOG_ENCRYPTED, m_hFileEncrypted, m_hFileInfo, m_logLevel, m_maxLogFileSize, m_NrOfWrites, m_pCipher, m_pcsPrint, m_strMsgBuff, m_strMsgTypes, m_uLogType, MAX_MSG_SIZE, MSG_COMPRESSED_FILE, MSG_FILE, MSG_LOG, MSG_STDOUT, S_LOGENCCIPHER::oKey, openLog(), pMsg, STRMSGTYPES_SIZE, and CAMutex::unlock().
Referenced by CAAccountingDBInterface::__checkCountAllQuery(), CAAccountingDBInterface::__clearAccountStatus(), CAAccountingInstance::__commitSettlementToDatabase(), CAAccountingDBInterface::__deleteCC(), CAAccountingDBInterface::__getAccountStatus(), CAAccountingDBInterface::__getCostConfirmation(), CAAccountingDBInterface::__getPrepaidAmount(), CAAccountingDBInterface::__getUnsettledCostConfirmations(), CAAccountingInstance::__handleSettleResult(), CAAccountingInstance::__newSettlementTransaction(), CAAccountingDBInterface::__storeAccountStatus(), CAAccountingDBInterface::__storeCostConfirmation(), CAAccountingDBInterface::__storePrepaidAmount(), CASocket::accept(), CAQueue::add(), CAFirstMixChannelList::addChannel(), CACmdLnOptions::addMixIdToMixInfo(), CAThreadPool::addRequest(), TermsAndConditions::addTranslation(), CACmdLnOptions::appendMixInfo_internal(), CAMix::appendTermsAndConditionsExtension(), CAAccountingControlChannel::CAAccountingControlChannel(), CAAccountingInstance::CAAccountingInstance(), CAAccountingSettleThread::CAAccountingSettleThread(), CAReplayControlChannel::CAReplayControlChannel(), CAReplayCtrlChannelMsgProc::CAReplayCtrlChannelMsgProc(), CAAccountingInstance::cascadeMatchesCC(), CAMix::checkCompatibility(), CAAccountingDBInterface::checkConnectionStatus(), checkSizesOfBaseTypes(), CALastMix::clean(), CAFirstMix::clean(), CALibProxytest::cleanup(), cleanup(), CAAccountingDBInterface::cleanup(), CAAccountingInstance::cleanupTableEntry(), CATempIPBlockList::cleanupThreadMainLoop(), CASocket::close(), CAFirstMixA::closeConnection(), CASocket::connect(), CAMiddleMix::connectToNextMix(), CAFirstMix::connectToNextMix(), CASocket::create(), CACmdLnOptions::createSockets(), CATLSClientSocket::doTLSConnect(), CAFirstMix::doUserLogin_internal(), CAAccountingInstance::finishLoginProcess(), fm_loopAcceptUsers(), fm_loopReadFromMix(), fm_loopSendToMix(), CAAccountingDBInterface::getConnection(), CAXMLPriceCert::getInstance(), CACmdLnOptions::getMixXml(), CAAccountingInstance::getNrOfUsers(), CAInfoService::getPaymentInstance(), CAAccountingInstance::getPrepaidBytes(), CACertificate::getRawSubjectKeyIdentifier(), CACertificate::getSubjectKeyIdentifier(), CASignature::getVerifyKey(), CAAccountingInstance::handleAccountCertificate_internal(), CAAccountingInstance::handleChallengeResponse_internal(), CAAccountingInstance::handleCostConfirmation_internal(), CAAccountingInstance::handleJapPacket_internal(), CAFirstMix::handleTermsAndConditionsExtension(), CAFirstMix::handleTermsAndConditionsLogin(), CAInfoService::InfoLoop(), CALocalProxy::init(), CAMiddleMix::init(), CALastMix::init(), CAAccountingDBInterface::init(), CAFirstMix::init(), CAAccountingBIInterface::initBIConnection(), CAFirstMix::initCountryStats(), CAAccountingDBInterface::initDBConnection(), CACmdLnOptions::initLogging(), CAMix::initMixCascadeInfo(), CALocalProxy::initOnce(), CAMiddleMix::initOnce(), CALastMix::initOnce(), CAMix::initOnce(), CAFirstMix::initOnce(), CAIPList::insertIP(), integrateDOMNode(), CACmdLnOptions::invokeOptionSetters(), iplist_loopDoLogCountries(), isAllowedToPassRestrictions(), CACertificate::isValid(), CAThread::join(), CASocket::listen(), lm_loopLog(), lm_loopReadFromMix(), lm_loopSendToMix(), logMemoryUsage(), CALastMixA::loop(), CAFirstMixB::loop(), CAFirstMixA::loop(), CALastMixB::loop(), CALocalProxy::loop(), CAMiddleMix::loop(), main(), CAAccountingSettleThread::mainLoop(), CAAccountingInstance::makeInitialCCRequest(), CADatabase::measurePerformance(), CAReplayDatabase::measurePerformance(), mm_loopReadFromMixAfter(), mm_loopReadFromMixBefore(), mm_loopSendToMixAfter(), mm_loopSendToMixBefore(), CADatabase::nextClock(), CAReplayDatabase::nextClock(), CACmdLnOptions::parse(), CAHttpClient::parseHTTPHeader(), CAFirstMixChannelList::popTimeoutEntry_internal(), CAAccountingInstance::prepareCCRequest(), CAReplayCtrlChannelMsgProc::proccessGotTimestamp(), CASyncControlChannel::proccessMessage(), CASyncControlChannel::proccessMessageComplete(), CAChain::processDownstream(), CAAccountingInstance::processJapMessage(), CALocalProxy::processKeyExchange(), CAMiddleMix::processKeyExchange(), CALastMix::processKeyExchange(), CAFirstMix::processKeyExchange(), CAAccountingInstance::processThread(), CACmdLnOptions::processXmlConfiguration(), CAReplayControlChannel::processXMLMessage(), CAAccountingControlChannel::processXMLMessage(), CAReplayCtrlChannelMsgProc::propagateCurrentReplayTimestamp(), CACmdLnOptions::readXmlConfiguration(), CATLSClientSocket::receive(), CASocket::receive(), CAMuxSocket::receive(), CALastMix::reconfigure(), CAFirstMix::reconfigure(), CALastMixB::reconfigureMix(), Hashtable::rehash(), CAAccountingDBInterface::releaseConnection(), CACertificate::removeColons(), CAFirstMixChannelList::removeFromTimeoutList(), CAIPList::removeIP(), CAAccountingInstance::returnKickout(), CAAccountingInstance::returnPrepareKickout(), CASocketGroup::select(), CATLSClientSocket::send(), CASocket::send(), CAMuxSocket::send(), CAAccountingInstance::sendAILoginConfirmation(), CAInfoService::sendCascadeHelo(), CAAccountingInstance::sendCCRequest(), CASocket::sendFully(), CASocket::sendFullyTimeOut(), CAHttpClient::sendGetRequest(), CAAccountingInstance::sendInitialCCRequest(), CAControlChannelDispatcher::sendMessages(), CAInfoService::sendMixHelo(), CAHttpClient::sendPostRequest(), CAInfoService::sendStatus(), CASocket::sendTimeOut(), CACmdLnOptions::setAccountingDatabase(), CAFirstMixChannelList::setDelayParameters(), CACmdLnOptions::setDynamicMix(), CASocket::setKeepAlive(), CAFirstMixChannelList::setKickoutForced_internal(), CACmdLnOptions::setListenerInterfaces(), CACmdLnOptions::setLoggingOptions(), setLogOptions(), CACmdLnOptions::setMixCertificateVerification(), CACmdLnOptions::setNextMix(), CACmdLnOptions::setNextMixCertificate(), CACmdLnOptions::setNrOfFileDescriptors(), CACmdLnOptions::setOwnCertificate(), CACmdLnOptions::setPaymentInstance(), CAAccountingBIInterface::setPIServerConfiguration(), CACmdLnOptions::setPrepaidInterval(), CACmdLnOptions::setPrevMix(), CACmdLnOptions::setPriceCertificate(), CACmdLnOptions::setRessourceOptions(), CACmdLnOptions::setServerMonitoring(), CASignature::setSignKey(), CACmdLnOptions::setTargetInterfaces(), CALastMix::setTargets(), CACmdLnOptions::setTermsAndConditions(), CACmdLnOptions::setTermsAndConditionsList(), CACmdLnOptions::setTermsAndConditionsTemplates(), CAAccountingBIInterface::settle(), CAAccountingBIInterface::settleAll(), CAAccountingInstance::settlementTransaction(), CACmdLnOptions::setTrustedRootCertificates(), CACmdLnOptions::setUserID(), CAXMLBI::setValues(), CAXMLErrorMessage::setValues(), CAXMLPriceCert::setValues(), CASignature::setVerifyKey(), CAFirstMixA::shutDown(), signal_interrupt(), signal_segv(), signal_term(), CAMultiSignature::signXML(), SIGUSR1_handler(), SIGUSR2_handler(), CALocalProxy::start(), CAMix::start(), CAInfoService::start(), CAThread::start(), CAAccountingBIInterface::terminateBIConnection(), threadReConfigure(), CAXMLPriceCert::toXmlElement(), CAFirstMix::updateCountryStats(), CACertificate::verify(), CACertStore::verifyMixCert(), CAMultiSignature::verifyXML(), CAAccountingControlChannel::~CAAccountingControlChannel(), CAAccountingInstance::~CAAccountingInstance(), CAChain::~CAChain(), CAReplayCtrlChannelMsgProc::~CAReplayCtrlChannelMsgProc(), and CATempIPBlockList::~CATempIPBlockList().
| SINT32 CAMsg::rotateLog | ( | ) | [private] |
References E_SUCCESS, CACmdLnOptions::getMaxLogFiles(), CALibProxytest::getOptions(), m_lastLogFileNumber, m_strLogFile, m_uLogType, MSG_COMPRESSED_FILE, MSG_FILE, and pMsg.
Referenced by openLog().
| SINT32 CAMsg::setLogLevel | ( | UINT32 | a_logLevel | ) | [static] |
References E_SUCCESS, E_UNKNOWN, m_logLevel, and pMsg.
Referenced by CACmdLnOptions::initLogging().
| SINT32 CAMsg::setLogOptions | ( | UINT32 | options | ) | [static] |
References closeLog(), createLogDirMessage(), createLogFileMessage(), E_FILE_OPEN, E_SUCCESS, GET_NET_ERROR, GET_NET_ERROR_STR, m_uLogType, MSG_COMPRESSED_FILE, MSG_FILE, MSG_LOG, openLog(), pMsg, and printMsg().
Referenced by CACmdLnOptions::initLogging().
| static SINT32 CAMsg::setMaxLogFileSize | ( | UINT64 | size | ) | [static] |
bool CAMsg::m_alreadyOpened [private] |
int CAMsg::m_hFileEncrypted [private] |
Referenced by CAMsg(), closeEncryptedLog(), openEncryptedLog(), and printMsg().
int CAMsg::m_hFileInfo [private] |
Referenced by CAMsg(), closeLog(), openLog(), and printMsg().
UINT32 CAMsg::m_lastLogFileNumber [private] |
Referenced by CAMsg(), and rotateLog().
UINT32 CAMsg::m_logLevel [private] |
Referenced by CAMsg(), printMsg(), and setLogLevel().
SINT64 CAMsg::m_maxLogFileSize [private] |
Referenced by CAMsg(), printMsg(), and setMaxLogFileSize().
UINT32 CAMsg::m_NrOfWrites [private] |
Referenced by openLog(), and printMsg().
t_LogEncCipher* CAMsg::m_pCipher [private] |
Referenced by CAMsg(), closeEncryptedLog(), openEncryptedLog(), and printMsg().
CAMutex* CAMsg::m_pcsPrint [private] |
Referenced by CAMsg(), printMsg(), and ~CAMsg().
char* CAMsg::m_strLogDir [private] |
Referenced by createLogDirMessage(), and openLog().
char* CAMsg::m_strLogFile [private] |
Referenced by CAMsg(), createLogFileMessage(), openLog(), rotateLog(), and ~CAMsg().
char* CAMsg::m_strMsgBuff [private] |
Referenced by CAMsg(), printMsg(), and ~CAMsg().
const char *const CAMsg::m_strMsgTypes = {", error ] ",", critical] ",", info ] ",", debug ] ",", special ] ",", warning ] "} [static, private] |
Referenced by printMsg().
UINT32 CAMsg::m_uLogType [private] |
Referenced by CAMsg(), closeLog(), printMsg(), rotateLog(), and setLogOptions().
CAMsg * CAMsg::pMsg = NULL [static, private] |
1.7.6.1