Message Creator
![]() | MessageCreator::AddLocalCertifs ( GMessage *callBackOnionInfo) Adds local certificates to the certificates that are used for onion creation |
![]() | MessageCreator::AnnotateWith4ByteLength (GMessage *onion, char **onionBottomStream, Size *onionBottomStreamLen) Add Size integer as a header denoting the lenght of data |
![]() | MessageCreator::CreateChunk (GMessage * chunkProperties) Creates a chunk |
![]() | MessageCreator::CreateOnion (GMessage *onionProperties) Creates the onion with owner identification in the bottom |
![]() | MessageCreator::CreateOnionBottom ( char *xOrigin, GMessage *symKeys, GMessage **pubKeyInfo) Creates an onion bottom with Six's identification (or Mix's sometimes) |
![]() | MessageCreator::CreateOnionFromMixCertificate ( GMessage *onionProperties) Creates the onion with Mix's identification in the bottom |
![]() | MessageCreator::MakeMoreOnionLayers (GMessage *properties, GMessage *callBackOnionInfo, GMessage *onion) Add some peels on the top of given onion |
![]() | MessageCreator::MakeRecipientGMessage (GMessage *mixCertif, GMessage *symKey) Makes GMessage with recipient's identification |
![]() | MessageCreator::MessageCreator (ConfigFile *mcConfigFile, LogFile * messageCreatorLogFile, CertificateRepository * certificateRepository, Cipherer * cipherer, KeyManager * keyManager) Message Creator constructor |
![]() | MessageCreator::PaddOnionRestOfPath (char *restOfPath, Size restOfPathLen, Size fixedSize) Padd the rest of path field to the original length |
![]() | MessageCreator::ReturnCallBackOnionInfo (GMessage *onionProperties, GMessage **callBackOnionInfo) Returns GMessage full of useful stuff for creating onions or adding new peels onto the top of them |
![]() | MessageCreator::ReturnGMsgFullOfMixCertifs (int tupleWidth, Size hopCount, GMessage **certificates) Returns Mixs' certificates |
![]() | MessageCreator::~MessageCreator () Message Creator destructor |
![]() | methods
|
![]() | attributes
|
![]() | methods2
|
attributes
Message Creator. Specializes in creation of messages, chunks onions and similar things. Understands structure of onions and messages.
Cipherer* cipherer
CertificateRepository* certificateRepository
GMessage* CreateChunk(GMessage *message)
GMessage* CreateOnion(GMessage *request)
GMessage* CreateOnionFromMixCertificate(GMessage *request)
GMessage* CreateOnionBottom( char *xOrigin, GMessage *symKeys, GMessage **pubKeyInfo)
GMessage* MakeRecipientGMessage( GMessage *mixCertif, GMessage *SymKey)
void AnnotateWith4ByteLength( GMessage *onion, char **onionBottomStream, Size *onionBottomStreamLen)
Err MakeMoreOnionLayers( GMessage *properties, GMessage *callBackOnionInfo, GMessage *onion)
Err ReturnCallBackOnionInfo( GMessage *onionProperties, GMessage **callBackOnionInfo)
char* PaddOnionRestOfPath(char *restOfPath, Size restOfPathLen, Size requestedLen)
We add layers in a loop, in each loop we do:
Note: if onion is just an onionBottom, we add in the first step a symetric
key that is never used.. This is just that we didn't want to add any
additional if, the best programmers are lazy programmers :-).
or
void MessageCreator::AnnotateWith4ByteLength(GMessage *onion, char **onionBottomStream, Size *onionBottomStreamLen)
onionBottomStream - The stream that is returned.
onionBottomStreamLen - Size of returned stream.
GMessage* MessageCreator::CreateChunk(GMessage * chunkProperties)
GM_RECIPIENT_1 - see CreateOnion() above for discussion on
on recipients in a peel
GM_RECIPIENT_2
GM_CHUNK
GM_DEBUG - some string, for debugging purpose
GM_PROTOCOL_VERSION - Mix-Mix protocol identification
GM_DATA - encrypted data
GM_REST_OF_PATH - rest of path
GM_ONION - chunk's recipient idenfification
GM_ADD_HOPS - how many peels to add on the top of the onion
GM_DATA - the data thas are to be transmitted inside
the chunk, we are not interested in its structure
here.
GMessage* MessageCreator::CreateOnion(GMessage *onionProperties)
GM_HOP_COUNT - how many peels we are to create
GM_ORIGIN - whose idenfification will be in the very bottom (eg.
eso_johny, joes_acs etc., the important fact is
that this string identifies the Six above the final
Mix, so is is not the Internet address)
GMessage* MessageCreator::CreateOnionBottom( char *xOrigin, GMessage *symKeys, GMessage **pubKeyInfo)
GM_FINAL_STOP - a nonempty field, identifies
that the peel is tha last one
GM_RECIPIENT_1
GM_ADDRESS - a name of the recipient
GM_PRIVATE_KEY_INFO - private key for data decryption
GM_SYMETRIC_DATA_KEY_INFOS - symetric keys for data decryption
symKeys - Symetric keys we have to insert into the bottom.
pubKeyInfo - Symetric keys we have to insert into the bottom.
GMessage* MessageCreator::CreateOnionFromMixCertificate( GMessage *onionProperties)
GM_DESTINATION - which Mix object will get the answer
GM_MIX_CERTIFICATE - local identification of Mix
M_HOP_COUNT - how many peels to create
Err MessageCreator::MakeMoreOnionLayers(GMessage *properties, GMessage *callBackOnionInfo, GMessage *onion)
GM_RECIPIENT_1 - see MakeRecipientGMessage()
GM_RECIPIENT_2
GM_REST_OF_PATH - is an encrypted GMessage
<
GM_SYMETRIC_DATA_KEY_INFOS - used for encryption in particular
peels
GM_MIX_CERTIFICATES - used for creation recipients'
GMessages in particular peels
properties - Contains:
GM_ADD_HOPS - when we create a chunk
GM_HOP_COUNT - when we create a onion
onion - Onion on which we have to add additional peels.
GMessage* MessageCreator::MakeRecipientGMessage(GMessage *mixCertif, GMessage *symKey)
GM_PUBLIC_KEY_INFO
GM_SYMETRIC_PATH_KEY_INFO
GM_ADDRESS
GM_PORT
symKey - This symKey is used somewhere else for path encryption.
For recipient to be able to use it, we encrypt the
symetric key with recipient's public key.
MessageCreator::MessageCreator(ConfigFile *mcConfigFile, LogFile * messageCreatorLogFile, CertificateRepository * certificateRepository, Cipherer * cipherer, KeyManager * keyManager)
messageCreatorLogFile - Log file.
certificateRepository - Certificate repository object.
char* MessageCreator::PaddOnionRestOfPath(char *restOfPath, Size restOfPathLen, Size fixedSize)
restOfPathLen - Rest of path length.
Err MessageCreator::ReturnCallBackOnionInfo(GMessage *onionProperties, GMessage **callBackOnionInfo)
GM_SYMETRIC_DATA_KEY_INFOS
GM_MIX_CERTIFICATES
GM_HOP_COUNT
callBackOnionInfo - Returned parameter.
Err MessageCreator::ReturnGMsgFullOfMixCertifs(int tupleWidth, Size hopCount, GMessage **certificates)
GM_MIX_CERTIFICATE_COUNT
GM_MIX_CERTIFICATE_TUPLE_1
GM_MIX_CERTIFICATE_1
GM_MIX_CERTIFICATE_2
...
...
GM_MIX_CERTIFICATE_TUPLE-"Hop-Count"
hopCount - How many certificates' tuples to return.
certificates - Returned certificates.
MessageCreator::~MessageCreator()
alphabetic index hierarchy of classes
generated by doc++