Opened 5 years ago

Last modified 4 months ago

#8323 new enhancement

Missing 'GETINFO md/all'

Reported by: atagar Owned by:
Priority: High Milestone: Tor: unspecified
Component: Core Tor/Tor Version:
Severity: Normal Keywords: tor-client tor-control microdesc
Cc: Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

Hi Nick. The control spec has GETINFO options to fetch a microdescriptor via its fingerprint or nickname ('md/id/*' and 'md/name/*') but no method for getting them all (like 'ns/all' or 'desc/all-recent').

Processing all descriptors is a pretty common need, hence the priority (feel free to lower it if appropriate). In the meantime I'll hack around this in stem by having controller read microdescriptors from the data directory.

Child Tickets

Change History (8)

comment:1 Changed 5 years ago by nickm

Keywords: tor-client added
Milestone: Tor: 0.2.5.x-final

I'll leave this as major. Timing makes it 0.2.5.

I'm assuming it's not a problem for you that microdescriptors don't tell you which microdescriptor they are unless you compute their SHA256 themselves? That is, unless you know the corresponding entry from the consensus networkstatus, you won't know which microdesc is which node.

comment:2 Changed 5 years ago by atagar

I'm assuming it's not a problem for you that microdescriptors don't tell you which microdescriptor they are unless you compute their SHA256 themselves?

It's not ideal. I was a bit sad yesterday when I realized that they lack the fingerprint since it changes simple tasks like 'tell me all of the exits' from...

for desc in controller.get_microdescriptors():
  if desc.exit_policy.is_exiting_allowed():
    print "%s is an exit" % desc.fingerprint

... to...

exit_onion_keys = set()

for desc in controller.get_microdescriptors():
  if desc.exit_policy.is_exiting_allowed():
    exit_onion_keys.add(desc.onion_key)

for desc in controller.get_network_statuses():
  if desc.digest in exit_onion_keys:
    print "%s is an exit" % desc.fingerprint

But not the end of the world. :)

comment:3 Changed 5 years ago by nickm

FWIW, that's almost right, but the thing that you have in the networkstatus is not a digest of the onion key, but rather a digest of the microdescriptor. So you have to do something like :

for desc in controller.get_microdescriptors():
  if desc.exit_policy.is_exiting_allowed():
    exit_digests.add(sha256(str(desc.text))) # or whatever this is called

for desc in controller.get_network_statuses():
  if desc.digest in exit_digests:
    print "%s is an exit" % desc.fingerprint

comment:4 Changed 4 years ago by nickm

Milestone: Tor: 0.2.5.x-finalTor: 0.2.???

comment:5 Changed 10 months ago by teor

Milestone: Tor: 0.2.???Tor: 0.3.???

Milestone renamed

comment:6 Changed 9 months ago by nickm

Keywords: tor-03-unspecified-201612 added
Milestone: Tor: 0.3.???Tor: unspecified

Finally admitting that 0.3.??? was a euphemism for Tor: unspecified all along.

comment:7 Changed 4 months ago by nickm

Keywords: tor-03-unspecified-201612 removed

Remove an old triaging keyword.

comment:8 Changed 4 months ago by nickm

Keywords: tor-control microdesc added
Severity: Normal
Type: defectenhancement
Note: See TracTickets for help on using tickets.