I2NP BRR: Minor cleanup and javadoc note

This commit is contained in:
zzz
2020-09-08 13:26:33 +00:00
parent 8a10c3a097
commit 72e4b16c1a
2 changed files with 2 additions and 2 deletions

View File

@ -20,7 +20,7 @@ import net.i2p.data.SessionKey;
* Cleartext: * Cleartext:
* <pre> * <pre>
* bytes 0-3: tunnel ID to receive messages as * bytes 0-3: tunnel ID to receive messages as
* bytes 4-35: local router identity hash * bytes 4-35: local router identity hash (Unused and no accessor here)
* bytes 36-39: next tunnel ID * bytes 36-39: next tunnel ID
* bytes 40-71: next router identity hash * bytes 40-71: next router identity hash
* bytes 72-103: AES-256 tunnel layer key * bytes 72-103: AES-256 tunnel layer key

View File

@ -34,7 +34,7 @@ public class BuildResponseRecord {
//Log log = ctx.logManager().getLog(BuildResponseRecord.class); //Log log = ctx.logManager().getLog(BuildResponseRecord.class);
byte rv[] = new byte[TunnelBuildReplyMessage.RECORD_SIZE]; byte rv[] = new byte[TunnelBuildReplyMessage.RECORD_SIZE];
ctx.random().nextBytes(rv, Hash.HASH_LENGTH, TunnelBuildReplyMessage.RECORD_SIZE - Hash.HASH_LENGTH - 1); ctx.random().nextBytes(rv, Hash.HASH_LENGTH, TunnelBuildReplyMessage.RECORD_SIZE - Hash.HASH_LENGTH - 1);
DataHelper.toLong(rv, TunnelBuildMessage.RECORD_SIZE-1, 1, status); rv[TunnelBuildMessage.RECORD_SIZE-1] = (byte) status;
// rv = AES(SHA256(padding+status) + padding + status, replyKey, replyIV) // rv = AES(SHA256(padding+status) + padding + status, replyKey, replyIV)
ctx.sha().calculateHash(rv, Hash.HASH_LENGTH, rv.length - Hash.HASH_LENGTH, rv, 0); ctx.sha().calculateHash(rv, Hash.HASH_LENGTH, rv.length - Hash.HASH_LENGTH, rv, 0);
//if (log.shouldLog(Log.DEBUG)) //if (log.shouldLog(Log.DEBUG))