* DatabaseLookupMessage: Change format for encrypted reply request

to allow multiple bundled reply tags
This commit is contained in:
zzz
2013-06-05 16:44:59 +00:00
parent 4a65676738
commit b7dc8f425e
3 changed files with 17 additions and 2 deletions

View File

@@ -311,6 +311,8 @@ public class DatabaseLookupMessage extends FastI2NPMessageImpl {
System.arraycopy(data, curIndex, rk, 0, SessionKey.KEYSIZE_BYTES);
_replyKey = new SessionKey(rk);
curIndex += SessionKey.KEYSIZE_BYTES;
// number of tags, assume always 1 for now
curIndex++;
byte[] rt = new byte[SessionTag.BYTE_LENGTH];
System.arraycopy(data, curIndex, rt, 0, SessionTag.BYTE_LENGTH);
_replyTag = new SessionTag(rt);
@@ -328,7 +330,8 @@ public class DatabaseLookupMessage extends FastI2NPMessageImpl {
if (_dontIncludePeers != null)
totalLength += Hash.HASH_LENGTH * _dontIncludePeers.size();
if (_replyKey != null)
totalLength += SessionKey.KEYSIZE_BYTES + SessionTag.BYTE_LENGTH;
// number of tags, assume always 1 for now
totalLength += SessionKey.KEYSIZE_BYTES + 1 + SessionTag.BYTE_LENGTH;
return totalLength;
}
@@ -372,6 +375,8 @@ public class DatabaseLookupMessage extends FastI2NPMessageImpl {
if (_replyKey != null) {
System.arraycopy(_replyKey.getData(), 0, out, curIndex, SessionKey.KEYSIZE_BYTES);
curIndex += SessionKey.KEYSIZE_BYTES;
// number of tags, always 1 for now
out[curIndex++] = 1;
System.arraycopy(_replyTag.getData(), 0, out, curIndex, SessionTag.BYTE_LENGTH);
curIndex += SessionTag.BYTE_LENGTH;
}

View File

@@ -18,7 +18,7 @@ public class RouterVersion {
/** deprecated */
public final static String ID = "Monotone";
public final static String VERSION = CoreVersion.VERSION;
public final static long BUILD = 4;
public final static long BUILD = 5;
/** for example "-test" */
public final static String EXTRA = "";