Mixes for Privacy and Anonymity in the Internet
|
This class "dispatches" messages which it receives via proccessMixPacket() to the associated control channel. More...
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.
CAControlChannelDispatcher::CAControlChannelDispatcher | ( | CAQueue * | pSendQueue, |
UINT8 * | keyRecv, | ||
UINT8 * | keySent | ||
) |
Constructs a new dispatcher.
pSendQueue | send queue in which the mix packets will be puted, if a control channel sends a message |
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.
CAControlChannelDispatcher::~CAControlChannelDispatcher | ( | ) |
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.
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.
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
References E_SUCCESS, CAMutex::lock(), m_nEncMsgCounter, m_pcsEnc, m_pEncMsgIV, m_pGCMCtxEnc, and CAMutex::unlock().
Referenced by CAAbstractControlChannel::sendXMLMessage().
bool CAControlChannelDispatcher::isKeySet | ( | ) |
Temp workaorund function - to be removed soon...
References m_pGCMCtxEnc.
Referenced by CASyncControlChannel::proccessMessage().
bool CAControlChannelDispatcher::proccessMixPacket | ( | const MIXPACKET * | pPacket | ) |
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.
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().
References E_SUCCESS, E_UNKNOWN, CAMutex::lock(), m_arControlChannels, m_pcsRegisterChannel, and CAMutex::unlock().
Referenced by CAReplayCtrlChannelMsgProc::~CAReplayCtrlChannelMsgProc().
|
private |
|
private |
Referenced by CAControlChannelDispatcher(), and decryptMessage().
|
private |
Referenced by CAControlChannelDispatcher(), and encryptMessage().
|
private |
Referenced by CAControlChannelDispatcher(), decryptMessage(), and ~CAControlChannelDispatcher().
|
private |
Referenced by CAControlChannelDispatcher(), encryptMessage(), and ~CAControlChannelDispatcher().
|
private |
|
private |
Referenced by CAControlChannelDispatcher(), sendMessages(), and ~CAControlChannelDispatcher().
|
private |
Referenced by CAControlChannelDispatcher(), decryptMessage(), and ~CAControlChannelDispatcher().
|
private |
Referenced by CAControlChannelDispatcher(), encryptMessage(), and ~CAControlChannelDispatcher().
|
private |
Referenced by CAControlChannelDispatcher(), decryptMessage(), and ~CAControlChannelDispatcher().
|
private |
Referenced by CAControlChannelDispatcher(), encryptMessage(), isKeySet(), and ~CAControlChannelDispatcher().
|
private |
Referenced by CAControlChannelDispatcher(), and sendMessages().
|
private |
Referenced by CAControlChannelDispatcher(), sendMessages(), and ~CAControlChannelDispatcher().
|
private |
Referenced by CAControlChannelDispatcher(), and sendMessages().