mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-01-08 18:47:52 +00:00
make sure tunnelID is non-zero
This commit is contained in:
parent
ca1fa11cb1
commit
e58aaa3f32
@ -35,6 +35,7 @@ namespace tunnel
|
|||||||
RAND_bytes (replyKey, 32);
|
RAND_bytes (replyKey, 32);
|
||||||
RAND_bytes (replyIV, 16);
|
RAND_bytes (replyIV, 16);
|
||||||
RAND_bytes ((uint8_t *)&tunnelID, 4);
|
RAND_bytes ((uint8_t *)&tunnelID, 4);
|
||||||
|
if (!tunnelID) tunnelID = 1; // tunnelID can't be zero
|
||||||
isGateway = true;
|
isGateway = true;
|
||||||
isEndpoint = true;
|
isEndpoint = true;
|
||||||
ident = r;
|
ident = r;
|
||||||
@ -50,6 +51,7 @@ namespace tunnel
|
|||||||
nextIdent = ident;
|
nextIdent = ident;
|
||||||
isEndpoint = false;
|
isEndpoint = false;
|
||||||
RAND_bytes ((uint8_t *)&nextTunnelID, 4);
|
RAND_bytes ((uint8_t *)&nextTunnelID, 4);
|
||||||
|
if (!nextTunnelID) nextTunnelID = 1; // tunnelID can't be zero
|
||||||
}
|
}
|
||||||
|
|
||||||
void SetReplyHop (uint32_t replyTunnelID, const i2p::data::IdentHash& replyIdent)
|
void SetReplyHop (uint32_t replyTunnelID, const i2p::data::IdentHash& replyIdent)
|
||||||
|
Loading…
Reference in New Issue
Block a user