Mixe for Privacy and Anonymity in the Internet
|
This class "dispatches" messages which it receives via proccessMixPacket() to the associated control channel. More...
#include <CAControlChannelDispatcher.hpp>
Public Member Functions | |
CAControlChannelDispatcher (CAQueue *pSendQueue, UINT8 *keyRecv, UINT8 *keySent) | |
Constructs a new dispatcher. More... | |
~CAControlChannelDispatcher () | |
void | deleteAllControlChannels (void) |
Deregisters all control channels and calls delete on every registered control channel object. More... | |
SINT32 | registerControlChannel (CAAbstractControlChannel *pControlChannel) |
Registers a control channel for receiving messages. More... | |
SINT32 | removeControlChannel (UINT32 id) |
bool | proccessMixPacket (const MIXPACKET *pPacket) |
SINT32 | sendMessages (UINT32 id, const UINT8 *msg, UINT32 msglen) |
SINT32 | encryptMessage (const UINT8 *in, UINT32 inlen, UINT8 *out, UINT32 *outlen) |
Encrypts a control channel message. More... | |
SINT32 | decryptMessage (const UINT8 *in, UINT32 inlen, UINT8 *out, UINT32 *outlen) |
Decrypts a control channel message, which has to be of form: cipher text auth tag - 16 bytes. More... | |
bool | isKeySet () |
Temp workaorund function - to be removed soon... More... | |
Private Attributes | |
CAQueue * | m_pSendQueue |
MIXPACKET * | m_pMixPacket |
CAAbstractControlChannel ** | m_arControlChannels |
tQueueEntry * | m_pQueueEntry |
CAMutex * | m_pcsSendMsg |
CAMutex * | m_pcsRegisterChannel |
CAMutex * | m_pcsEnc |
CAMutex * | m_pcsDec |
gcm_ctx_64k * | m_pGCMCtxEnc |
gcm_ctx_64k * | m_pGCMCtxDec |
UINT32 | m_nEncMsgCounter |
UINT32 * | m_pEncMsgIV |
UINT32 | m_nDecMsgCounter |
UINT8 * | m_pDecMsgIV |
This class "dispatches" messages which it receives via proccessMixPacket() to the associated control channel.
Definition at line 38 of file CAControlChannelDispatcher.hpp.
|
inline |
Constructs a new dispatcher.
pSendQueue | send queue in which the mix packets will be puted, if a control channel sends a message |
Definition at line 45 of file CAControlChannelDispatcher.hpp.
References m_arControlChannels, m_nDecMsgCounter, m_nEncMsgCounter, m_pcsDec, m_pcsEnc, m_pcsRegisterChannel, m_pcsSendMsg, m_pDecMsgIV, m_pEncMsgIV, m_pGCMCtxDec, m_pGCMCtxEnc, m_pMixPacket, m_pQueueEntry, m_pSendQueue, and t_queue_entry::packet.
|
inline |
Definition at line 76 of file CAControlChannelDispatcher.hpp.
References m_arControlChannels, m_pcsDec, m_pcsEnc, m_pcsRegisterChannel, m_pcsSendMsg, m_pDecMsgIV, m_pEncMsgIV, m_pGCMCtxDec, m_pGCMCtxEnc, and m_pQueueEntry.
SINT32 CAControlChannelDispatcher::decryptMessage | ( | const UINT8 * | in, |
UINT32 | inlen, | ||
UINT8 * | out, | ||
UINT32 * | outlen | ||
) |
Decrypts a control channel message, which has to be of form: cipher text auth tag - 16 bytes.
Definition at line 108 of file CAControlChannelDispatcher.cpp.
References E_SUCCESS, CAMutex::lock(), m_nDecMsgCounter, m_pcsDec, m_pDecMsgIV, m_pGCMCtxDec, and CAMutex::unlock().
Referenced by CASyncControlChannel::proccessMessage().
void CAControlChannelDispatcher::deleteAllControlChannels | ( | void | ) |
Deregisters all control channels and calls delete on every registered control channel object.
Definition at line 57 of file CAControlChannelDispatcher.cpp.
References CAMutex::lock(), m_arControlChannels, m_pcsRegisterChannel, and CAMutex::unlock().
Referenced by CAFirstMixChannelList::remove().
SINT32 CAControlChannelDispatcher::encryptMessage | ( | const UINT8 * | in, |
UINT32 | inlen, | ||
UINT8 * | out, | ||
UINT32 * | outlen | ||
) |
Encrypts a control channel message.
The output format is: cipher text auth tag - 16 bytes
Definition at line 89 of file CAControlChannelDispatcher.cpp.
References E_SUCCESS, CAMutex::lock(), m_nEncMsgCounter, m_pcsEnc, m_pEncMsgIV, m_pGCMCtxEnc, and CAMutex::unlock().
Referenced by CAAbstractControlChannel::sendXMLMessage().
|
inline |
Temp workaorund function - to be removed soon...
Definition at line 116 of file CAControlChannelDispatcher.hpp.
References m_pGCMCtxEnc.
Referenced by CASyncControlChannel::proccessMessage().
bool CAControlChannelDispatcher::proccessMixPacket | ( | const MIXPACKET * | pPacket | ) |
Definition at line 68 of file CAControlChannelDispatcher.cpp.
References t_MixPacket::channel, t_MixPacket::data, E_SUCCESS, t_MixPacket::flags, CAMutex::lock(), m_arControlChannels, m_pcsRegisterChannel, CAAbstractControlChannel::proccessMessage(), and CAMutex::unlock().
Referenced by CAFirstMix::doUserLogin_internal(), CAFirstMixA::loop(), CALastMixA::loop(), CAFirstMixB::loop(), and CALastMixB::loop().
SINT32 CAControlChannelDispatcher::registerControlChannel | ( | CAAbstractControlChannel * | pControlChannel | ) |
Registers a control channel for receiving messages.
Definition at line 34 of file CAControlChannelDispatcher.cpp.
References E_SUCCESS, E_UNKNOWN, CAAbstractControlChannel::getID(), CAMutex::lock(), m_arControlChannels, m_pcsRegisterChannel, CAAbstractControlChannel::setDispatcher(), and CAMutex::unlock().
Referenced by CAReplayCtrlChannelMsgProc::CAReplayCtrlChannelMsgProc(), and CAFirstMix::doUserLogin_internal().
Definition at line 45 of file CAControlChannelDispatcher.cpp.
References E_SUCCESS, E_UNKNOWN, CAMutex::lock(), m_arControlChannels, m_pcsRegisterChannel, and CAMutex::unlock().
Referenced by CAReplayCtrlChannelMsgProc::~CAReplayCtrlChannelMsgProc().
Definition at line 128 of file CAControlChannelDispatcher.cpp.
References CAQueue::add(), t_MixPacket::channel, t_MixPacket::data, DATA_SIZE, E_SUCCESS, E_UNKNOWN, t_MixPacket::flags, CAMutex::lock(), m_pcsSendMsg, m_pMixPacket, m_pQueueEntry, m_pSendQueue, CAMsg::printMsg(), and CAMutex::unlock().
Referenced by CAAbstractControlChannel::sendXMLMessage().
|
private |
Definition at line 124 of file CAControlChannelDispatcher.hpp.
Referenced by CAControlChannelDispatcher(), deleteAllControlChannels(), proccessMixPacket(), registerControlChannel(), removeControlChannel(), and ~CAControlChannelDispatcher().
|
private |
Definition at line 135 of file CAControlChannelDispatcher.hpp.
Referenced by CAControlChannelDispatcher(), and decryptMessage().
|
private |
Definition at line 133 of file CAControlChannelDispatcher.hpp.
Referenced by CAControlChannelDispatcher(), and encryptMessage().
|
private |
Definition at line 129 of file CAControlChannelDispatcher.hpp.
Referenced by CAControlChannelDispatcher(), decryptMessage(), and ~CAControlChannelDispatcher().
|
private |
Definition at line 128 of file CAControlChannelDispatcher.hpp.
Referenced by CAControlChannelDispatcher(), encryptMessage(), and ~CAControlChannelDispatcher().
|
private |
Definition at line 127 of file CAControlChannelDispatcher.hpp.
Referenced by CAControlChannelDispatcher(), deleteAllControlChannels(), proccessMixPacket(), registerControlChannel(), removeControlChannel(), and ~CAControlChannelDispatcher().
|
private |
Definition at line 126 of file CAControlChannelDispatcher.hpp.
Referenced by CAControlChannelDispatcher(), sendMessages(), and ~CAControlChannelDispatcher().
|
private |
Definition at line 136 of file CAControlChannelDispatcher.hpp.
Referenced by CAControlChannelDispatcher(), decryptMessage(), and ~CAControlChannelDispatcher().
|
private |
Definition at line 134 of file CAControlChannelDispatcher.hpp.
Referenced by CAControlChannelDispatcher(), encryptMessage(), and ~CAControlChannelDispatcher().
|
private |
Definition at line 132 of file CAControlChannelDispatcher.hpp.
Referenced by CAControlChannelDispatcher(), decryptMessage(), and ~CAControlChannelDispatcher().
|
private |
Definition at line 131 of file CAControlChannelDispatcher.hpp.
Referenced by CAControlChannelDispatcher(), encryptMessage(), isKeySet(), and ~CAControlChannelDispatcher().
|
private |
Definition at line 123 of file CAControlChannelDispatcher.hpp.
Referenced by CAControlChannelDispatcher(), and sendMessages().
|
private |
Definition at line 125 of file CAControlChannelDispatcher.hpp.
Referenced by CAControlChannelDispatcher(), sendMessages(), and ~CAControlChannelDispatcher().
|
private |
Definition at line 122 of file CAControlChannelDispatcher.hpp.
Referenced by CAControlChannelDispatcher(), and sendMessages().