i2ptunnel: New CLI BlindingInfo test

I2CP: Fix BlindingInfo serialization
This commit is contained in:
zzz
2019-09-17 17:30:42 +00:00
parent 0d325d5a28
commit f9a2193e2f
2 changed files with 118 additions and 2 deletions

View File

@ -337,6 +337,8 @@ public class BlindingInfoMessage extends I2CPMessageImpl {
try {
_sessionId.writeBytes(os);
byte flags = (byte) _authType;
if (_privkey != null)
flags |= FLAG_AUTH;
if (_secret != null)
flags |= FLAG_SECRET;
os.write(flags);
@ -349,10 +351,13 @@ public class BlindingInfoMessage extends I2CPMessageImpl {
DataHelper.writeString(os, _host);
} else if (_endpointType == TYPE_DEST) {
_dest.writeBytes(os);
} else {
} else { // TYPE_KEY
DataHelper.writeLong(os, 2, _pubkey.getType().getCode());
os.write(_pubkey.getData());
}
if (_privkey != null) {
DataHelper.writeLong(os, 2, _privkey.getType().getCode());
os.write(_privkey.getData());
DataHelper.writeString(os, _host);
}
if (_secret != null)
DataHelper.writeString(os, _secret);