fill clear text buffer of BuildRequestRecord

This commit is contained in:
orignal 2015-01-03 23:13:07 -05:00
parent 7a387b9a9f
commit ecf709cbba
4 changed files with 46 additions and 11 deletions

View file

@ -48,16 +48,9 @@ namespace tunnel
while (hop)
{
int idx = recordIndicies[i];
EncryptBuildRequestRecord (*hop->router,
CreateBuildRequestRecord (hop->router->GetIdentHash (),
hop->tunnelID,
hop->nextRouter->GetIdentHash (),
hop->nextTunnelID,
hop->layerKey, hop->ivKey,
hop->replyKey, hop->replyIV,
hop->next ? rnd.GenerateWord32 () : replyMsgID, // we set replyMsgID for last hop only
hop->isGateway, hop->isEndpoint),
records + idx*TUNNEL_BUILD_RECORD_SIZE);
uint8_t clearText[BUILD_REQUEST_RECORD_CLEAR_TEXT_SIZE];
hop->CreateBuildRequestRecord (clearText, hop->next ? rnd.GenerateWord32 () : replyMsgID); // we set replyMsgID for last hop only
EncryptBuildRequestRecord (*hop->router, clearText, records + idx*TUNNEL_BUILD_RECORD_SIZE);
hop->recordIndex = idx;
i++;
hop = hop->next;