From d41f930f6934f5cf4ad8a1cf510a3613aa102021 Mon Sep 17 00:00:00 2001 From: orignal Date: Sun, 10 Jan 2016 16:40:28 -0500 Subject: [PATCH] fixed unintialized reply key --- TunnelConfig.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/TunnelConfig.h b/TunnelConfig.h index 1628b4b4..826979c8 100644 --- a/TunnelConfig.h +++ b/TunnelConfig.h @@ -33,6 +33,7 @@ namespace tunnel { RAND_bytes (layerKey, 32); RAND_bytes (ivKey, 32); + RAND_bytes (replyKey, 32); RAND_bytes (replyIV, 16); RAND_bytes ((uint8_t *)&tunnelID, 4); isGateway = true; @@ -100,7 +101,7 @@ namespace tunnel clearText[BUILD_REQUEST_RECORD_FLAG_OFFSET] = flag; htobe32buf (clearText + BUILD_REQUEST_RECORD_REQUEST_TIME_OFFSET, i2p::util::GetHoursSinceEpoch ()); htobe32buf (clearText + BUILD_REQUEST_RECORD_SEND_MSG_ID_OFFSET, replyMsgID); - // TODO: fill padding + RAND_bytes (clearText + BUILD_REQUEST_RECORD_PADDING_OFFSET, BUILD_REQUEST_RECORD_CLEAR_TEXT_SIZE - BUILD_REQUEST_RECORD_PADDING_OFFSET); i2p::crypto::ElGamalEncryption elGamalEncryption (ident->GetEncryptionPublicKey ()); elGamalEncryption.Encrypt (clearText, BUILD_REQUEST_RECORD_CLEAR_TEXT_SIZE, record + BUILD_REQUEST_RECORD_ENCRYPTED_OFFSET); memcpy (record + BUILD_REQUEST_RECORD_TO_PEER_OFFSET, (const uint8_t *)ident->GetIdentHash (), 16);