Skip to content

Commit

Permalink
Rebase and minor fixups
Browse files Browse the repository at this point in the history
Signed-off-by: Saibato <saibato.naga@pm.me>
  • Loading branch information
Saibato committed Oct 15, 2019
1 parent 60b5722 commit 9417bcf
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion common/wireaddr.c
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,7 @@ bool parse_wireaddr_internal(const char *arg, struct wireaddr_internal *addr,
if (strstarts(arg, "statictor:")) {
addr->itype = ADDR_INTERNAL_STATICTOR;
memset(&(addr->blob[0]), 0, sizeof(addr->blob));
strncpy(&(addr->blob[0]), tal_fmt(tmpctx, TOR_UNIQUE_STRING), strlen(TOR_UNIQUE_STRING));
strncpy(&(addr->blob[0]), tal_fmt(tmpctx, STATIC_TOR_MAGIC_STRING), strlen(STATIC_TOR_MAGIC_STRING));
return parse_wireaddr( arg + strlen("statictor:"),
&addr->u.torservice, 9151,
dns_ok ? NULL : &needed_dns,
Expand Down
2 changes: 1 addition & 1 deletion common/wireaddr.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ struct sockaddr_un;
#define TOR_V3_ADDRLEN 35
#define LARGEST_ADDRLEN TOR_V3_ADDRLEN
#define TOR_V3_BLOBLEN 64
#define TOR_UNIQUE_STRING "gen-default-toraddress"
#define STATIC_TOR_MAGIC_STRING "gen-default-toraddress"

enum wire_addr_type {
ADDR_TYPE_IPV4 = 1,
Expand Down
4 changes: 2 additions & 2 deletions connectd/connectd.c
Original file line number Diff line number Diff line change
Expand Up @@ -1156,10 +1156,10 @@ static struct wireaddr_internal *setup_listeners(const tal_t *ctx,
blob = proposed_wireaddr[i].blob;

if (pubkey_from_node_id(&pb, &daemon->id)) {
if (strstr(proposed_wireaddr[i].blob, TOR_UNIQUE_STRING)) {
if (strstr(proposed_wireaddr[i].blob, STATIC_TOR_MAGIC_STRING)) {
if (sodium_mlock(&random, sizeof(random)) != 0)
status_failed(STATUS_FAIL_INTERNAL_ERROR,
"Could not lock the random scalar key memory.");
"Could not lock the random prf key memory.");
randombytes_buf((void * const)&random, 32);
/* generate static tor node address, take first 32 bytes from secret of node_id plus 32 random bytes from sodiom */
struct sha256 sha;
Expand Down
2 changes: 1 addition & 1 deletion doc/lightningd-config.5.md
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ precisely control where to bind and what to announce with the
*bind-addr* and *announce-addr* options. These will **disable** the
*autolisten* logic, so you must specifiy exactly what you want!

**addr**=*\[IPADDRESS\[:PORT\]\]|autotor:TORIPADDRESS\[:TORPORT\]|statictor:TORIPADDRESS\[:TORPORT\][:torblob:[blob]]*
**addr**=*\[IPADDRESS\[:PORT\]\]|autotor:TORIPADDRESS\[:TORPORT\]|statictor:TORIPADDRESS\[:TORPORT\]\[:torblob:\[blob\]\]*

Set an IP address (v4 or v6) or automatic Tor address to listen on and
(maybe) announce as our node address.
Expand Down
2 changes: 1 addition & 1 deletion tests/test_gossip.py
Original file line number Diff line number Diff line change
Expand Up @@ -1591,7 +1591,7 @@ def test_gossip_ratelimit(node_factory):
wait_for(lambda: [c['fee_per_millionth'] for c in l3.rpc.listchannels()['channels']] == [1006])


@unittest.skipIf(False, "needs a running Tor service instance at port 9151 or 9051")
@unittest.skipIf(True, "needs a running Tor service instance at port 9151 or 9051")
def test_statictor_onions(node_factory):
""" First basic tests ;-)
Assume that tor is configured and just test
Expand Down

0 comments on commit 9417bcf

Please sign in to comment.