mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-01-22 12:24:19 +00:00
handle iexp
This commit is contained in:
parent
3219de235c
commit
a4e6d8120b
@ -264,6 +264,8 @@ namespace data
|
|||||||
introducer.iTag = boost::lexical_cast<uint32_t>(value);
|
introducer.iTag = boost::lexical_cast<uint32_t>(value);
|
||||||
else if (!strcmp (key, "ikey"))
|
else if (!strcmp (key, "ikey"))
|
||||||
Base64ToByteStream (value, strlen (value), introducer.iKey, 32);
|
Base64ToByteStream (value, strlen (value), introducer.iKey, 32);
|
||||||
|
else if (!strcmp (key, "iexp"))
|
||||||
|
introducer.iExp = boost::lexical_cast<uint32_t>(value);
|
||||||
}
|
}
|
||||||
if (!s) return;
|
if (!s) return;
|
||||||
}
|
}
|
||||||
@ -478,6 +480,18 @@ namespace data
|
|||||||
properties << ';';
|
properties << ';';
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
i = 0;
|
||||||
|
for (const auto& introducer: address.ssu->introducers)
|
||||||
|
{
|
||||||
|
if (introducer.iExp) // expiration is specified
|
||||||
|
{
|
||||||
|
WriteString ("iexp" + boost::lexical_cast<std::string>(i), properties);
|
||||||
|
properties << '=';
|
||||||
|
WriteString (boost::lexical_cast<std::string>(introducer.iExp), properties);
|
||||||
|
properties << ';';
|
||||||
|
}
|
||||||
|
i++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// write intro key
|
// write intro key
|
||||||
WriteString ("key", properties);
|
WriteString ("key", properties);
|
||||||
|
@ -73,10 +73,12 @@ namespace data
|
|||||||
typedef Tag<32> IntroKey; // should be castable to MacKey and AESKey
|
typedef Tag<32> IntroKey; // should be castable to MacKey and AESKey
|
||||||
struct Introducer
|
struct Introducer
|
||||||
{
|
{
|
||||||
|
Introducer (): iExp (0) {};
|
||||||
boost::asio::ip::address iHost;
|
boost::asio::ip::address iHost;
|
||||||
int iPort;
|
int iPort;
|
||||||
IntroKey iKey;
|
IntroKey iKey;
|
||||||
uint32_t iTag;
|
uint32_t iTag;
|
||||||
|
uint32_t iExp;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct SSUExt
|
struct SSUExt
|
||||||
|
Loading…
x
Reference in New Issue
Block a user