fix off by ones

This commit is contained in:
Jeff Becker 2016-07-15 12:49:45 -04:00
parent 24aff15752
commit 75fc8202ab
No known key found for this signature in database
GPG key ID: AB950234D6EA286B
3 changed files with 17 additions and 11 deletions

View file

@ -165,7 +165,7 @@ namespace i2p
buf += 32;
memcpy (buf, replyTunnel->GetNextIdentHash (), 32); // reply tunnel GW
buf += 32;
*buf = DATABASE_LOOKUP_DELIVERY_FLAG | DATABASE_LOOKUP_ENCYPTION_FLAG | DATABASE_LOOKUP_TYPE_LEASESET_LOOKUP; // flags
*buf = DATABASE_LOOKUP_DELIVERY_FLAG | DATABASE_LOOKUP_ENCRYPTION_FLAG | DATABASE_LOOKUP_TYPE_LEASESET_LOOKUP; // flags
htobe32buf (buf + 1, replyTunnel->GetNextTunnelID ()); // reply tunnel ID
buf += 5;
@ -182,7 +182,7 @@ namespace i2p
}
// encryption
memcpy (buf, replyKey, 32);
buf[32] = 1; // 1 tag
buf[32] = (uint8_t) 1; // 1 tag
memcpy (buf + 33, replyTag, 32);
buf += 65;