|
|
@ -6,7 +6,7 @@ |
|
|
|
#include <cryptopp/sha.h> |
|
|
|
#include <cryptopp/sha.h> |
|
|
|
#include <cryptopp/dsa.h> |
|
|
|
#include <cryptopp/dsa.h> |
|
|
|
#include "CryptoConst.h" |
|
|
|
#include "CryptoConst.h" |
|
|
|
#include "base64.h" |
|
|
|
#include "util/base64.h" |
|
|
|
#include "util/Timestamp.h" |
|
|
|
#include "util/Timestamp.h" |
|
|
|
#include "Log.h" |
|
|
|
#include "Log.h" |
|
|
|
#include "RouterInfo.h" |
|
|
|
#include "RouterInfo.h" |
|
|
@ -176,7 +176,7 @@ namespace data |
|
|
|
else if (!strcmp (key, "mtu")) |
|
|
|
else if (!strcmp (key, "mtu")) |
|
|
|
address.mtu = boost::lexical_cast<int>(value); |
|
|
|
address.mtu = boost::lexical_cast<int>(value); |
|
|
|
else if (!strcmp (key, "key")) |
|
|
|
else if (!strcmp (key, "key")) |
|
|
|
Base64ToByteStream (value, strlen (value), address.key, 32); |
|
|
|
i2p::util::Base64ToByteStream (value, strlen (value), address.key, 32); |
|
|
|
else if (!strcmp (key, "caps")) |
|
|
|
else if (!strcmp (key, "caps")) |
|
|
|
ExtractCaps (value); |
|
|
|
ExtractCaps (value); |
|
|
|
else if (key[0] == 'i') |
|
|
|
else if (key[0] == 'i') |
|
|
@ -199,7 +199,7 @@ namespace data |
|
|
|
else if (!strcmp (key, "itag")) |
|
|
|
else if (!strcmp (key, "itag")) |
|
|
|
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); |
|
|
|
i2p::util::Base64ToByteStream (value, strlen (value), introducer.iKey, 32); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
if (isValidAddress) |
|
|
|
if (isValidAddress) |
|
|
@ -344,7 +344,7 @@ namespace data |
|
|
|
WriteString ("ikey" + boost::lexical_cast<std::string>(i), properties); |
|
|
|
WriteString ("ikey" + boost::lexical_cast<std::string>(i), properties); |
|
|
|
properties << '='; |
|
|
|
properties << '='; |
|
|
|
char value[64]; |
|
|
|
char value[64]; |
|
|
|
size_t l = ByteStreamToBase64 (introducer.iKey, 32, value, 64); |
|
|
|
size_t l = i2p::util::ByteStreamToBase64 (introducer.iKey, 32, value, 64); |
|
|
|
value[l] = 0; |
|
|
|
value[l] = 0; |
|
|
|
WriteString (value, properties); |
|
|
|
WriteString (value, properties); |
|
|
|
properties << ';'; |
|
|
|
properties << ';'; |
|
|
@ -373,7 +373,7 @@ namespace data |
|
|
|
WriteString ("key", properties); |
|
|
|
WriteString ("key", properties); |
|
|
|
properties << '='; |
|
|
|
properties << '='; |
|
|
|
char value[64]; |
|
|
|
char value[64]; |
|
|
|
size_t l = ByteStreamToBase64 (address.key, 32, value, 64); |
|
|
|
size_t l = i2p::util::ByteStreamToBase64 (address.key, 32, value, 64); |
|
|
|
value[l] = 0; |
|
|
|
value[l] = 0; |
|
|
|
WriteString (value, properties); |
|
|
|
WriteString (value, properties); |
|
|
|
properties << ';'; |
|
|
|
properties << ';'; |
|
|
|