Mixes for Privacy and Anonymity in the Internet
Public Member Functions | Private Attributes
CAControlChannelDispatcher Class Reference

This class "dispatches" messages which it receives via proccessMixPacket() to the associated control channel. More...

List of all members.

Public Member Functions

 CAControlChannelDispatcher (CAQueue *pSendQueue, UINT8 *keyRecv, UINT8 *keySent)
 Constructs a new dispatcher.
 ~CAControlChannelDispatcher ()
void deleteAllControlChannels (void)
 Deregisters all control channels and calls delete on every registered control channel object.
SINT32 registerControlChannel (CAAbstractControlChannel *pControlChannel)
 Registers a control channel for receiving messages.
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.
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.
bool isKeySet ()
 Temp workaorund function - to be removed soon...

Private Attributes

CAQueuem_pSendQueue
MIXPACKETm_pMixPacket
CAAbstractControlChannel ** m_arControlChannels
tQueueEntrym_pQueueEntry
CAMutexm_pcsSendMsg
CAMutexm_pcsRegisterChannel
CAMutexm_pcsEnc
CAMutexm_pcsDec
gcm_ctx_64k * m_pGCMCtxEnc
gcm_ctx_64k * m_pGCMCtxDec
UINT32 m_nEncMsgCounter
UINT32m_pEncMsgIV
UINT32 m_nDecMsgCounter
UINT8m_pDecMsgIV

Detailed Description

This class "dispatches" messages which it receives via proccessMixPacket() to the associated control channel.


Constructor & Destructor Documentation

CAControlChannelDispatcher::CAControlChannelDispatcher ( CAQueue pSendQueue,
UINT8 keyRecv,
UINT8 keySent 
)

Constructs a new dispatcher.

Parameters:
pSendQueuesend 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.


Member Function Documentation

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().

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().

Temp workaorund function - to be removed soon...

References m_pGCMCtxEnc.

Referenced by CASyncControlChannel::proccessMessage().

SINT32 CAControlChannelDispatcher::sendMessages ( UINT32  id,
const UINT8 msg,
UINT32  msglen 
)

Member Data Documentation