|
|
@ -133,7 +133,7 @@ namespace data |
|
|
|
{ |
|
|
|
{ |
|
|
|
// introducers
|
|
|
|
// introducers
|
|
|
|
size_t l = strlen(key); |
|
|
|
size_t l = strlen(key); |
|
|
|
unsigned char index = key[l-1]; // TODO:
|
|
|
|
unsigned char index = key[l-1] - '0'; // TODO:
|
|
|
|
key[l-1] = 0; |
|
|
|
key[l-1] = 0; |
|
|
|
if (index >= address.introducers.size ()) |
|
|
|
if (index >= address.introducers.size ()) |
|
|
|
address.introducers.resize (index + 1); |
|
|
|
address.introducers.resize (index + 1); |
|
|
@ -214,12 +214,10 @@ namespace data |
|
|
|
else if (address.transportStyle == eTransportSSU) |
|
|
|
else if (address.transportStyle == eTransportSSU) |
|
|
|
{ |
|
|
|
{ |
|
|
|
WriteString ("SSU", s); |
|
|
|
WriteString ("SSU", s); |
|
|
|
// wtite intro key
|
|
|
|
// caps
|
|
|
|
WriteString ("key", properties); |
|
|
|
WriteString ("caps", properties); |
|
|
|
properties << '='; |
|
|
|
properties << '='; |
|
|
|
char value[64]; |
|
|
|
WriteString ("BC", properties); // TODO:
|
|
|
|
ByteStreamToBase64 (address.key, 32, value, 64); |
|
|
|
|
|
|
|
WriteString (value, properties); |
|
|
|
|
|
|
|
properties << ';'; |
|
|
|
properties << ';'; |
|
|
|
} |
|
|
|
} |
|
|
|
else |
|
|
|
else |
|
|
@ -229,6 +227,17 @@ namespace data |
|
|
|
properties << '='; |
|
|
|
properties << '='; |
|
|
|
WriteString (address.host.to_string (), properties); |
|
|
|
WriteString (address.host.to_string (), properties); |
|
|
|
properties << ';'; |
|
|
|
properties << ';'; |
|
|
|
|
|
|
|
if (address.transportStyle == eTransportSSU) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
// wtite intro key
|
|
|
|
|
|
|
|
WriteString ("key", properties); |
|
|
|
|
|
|
|
properties << '='; |
|
|
|
|
|
|
|
char value[64]; |
|
|
|
|
|
|
|
size_t l = ByteStreamToBase64 (address.key, 32, value, 64); |
|
|
|
|
|
|
|
value[l] = 0; |
|
|
|
|
|
|
|
WriteString (value, properties); |
|
|
|
|
|
|
|
properties << ';'; |
|
|
|
|
|
|
|
} |
|
|
|
WriteString ("port", properties); |
|
|
|
WriteString ("port", properties); |
|
|
|
properties << '='; |
|
|
|
properties << '='; |
|
|
|
WriteString (boost::lexical_cast<std::string>(address.port), properties); |
|
|
|
WriteString (boost::lexical_cast<std::string>(address.port), properties); |
|
|
|