[tor-bugs] #22042 [- Select a component]: HSFETCH not followed by HS_DESC_CONTENT event

Tor Bug Tracker & Wiki blackhole at torproject.org
Fri Apr 21 21:52:04 UTC 2017


#22042: HSFETCH not followed by HS_DESC_CONTENT event
--------------------------------------+---------------------------
     Reporter:  nickler               |      Owner:
         Type:  defect                |     Status:  new
     Priority:  Medium                |  Milestone:
    Component:  - Select a component  |    Version:  Tor: 0.2.9.10
     Severity:  Normal                |   Keywords:
Actual Points:                        |  Parent ID:
       Points:                        |   Reviewer:
      Sponsor:                        |
--------------------------------------+---------------------------
 Hi,

 I'm trying to periodically get a hidden service descriptor to monitor
 changes. I tried using stem with the following python script:

 {{{

 from stem.control import Controller
 import datetime
 import time

 ONION = 'expyuzz4wqqyqhjn'

 with Controller.from_port(port = 9051) as controller:
   controller.authenticate()
   while True:
       print(datetime.datetime.now())
       desc = controller.get_hidden_service_descriptor(ONION)
       time.sleep(60)
 }}}

 However, after about six iterations the get_hidden_service_descriptor
 blocks indefinitely (I waited up to 24 hours). I manually recreated what
 stem sends to the control port:

 {{{
 % nc 127.0.0.1 9051
 AUTHENTICATE
 250 OK
 SETEVENTS HS_DESC_CONTENT HS_DESC
 250 OK
 HSFETCH expyuzz4wqqyqhjn
 250 OK
 650 HS_DESC REQUESTED expyuzz4wqqyqhjn NO_AUTH
 $D0B232E732DD69F181815EE6648E9AB8A67F73BA~ididntedittheconfig
 2baufgsbt3a2jolhmvrsmd3ufdg72cyz
 650 HS_DESC RECEIVED expyuzz4wqqyqhjn NO_AUTH
 $D0B232E732DD69F181815EE6648E9AB8A67F73BA~ididntedittheconfig
 2baufgsbt3a2jolhmvrsmd3ufdg72cyz
 650+HS_DESC_CONTENT expyuzz4wqqyqhjn 2baufgsbt3a2jolhmvrsmd3ufdg72cyz
 $D0B232E732DD69F181815EE6648E9AB8A67F73BA~ididntedittheconfig
 <...>
 650 OK
 HSFETCH expyuzz4wqqyqhjn
 250 OK
 650 HS_DESC REQUESTED expyuzz4wqqyqhjn NO_AUTH
 $D05A37450AB9950181124563D3A7DBC5EE7D30BB~r3dn3ck
 2baufgsbt3a2jolhmvrsmd3ufdg72cyz
 650 HS_DESC RECEIVED expyuzz4wqqyqhjn NO_AUTH
 $D05A37450AB9950181124563D3A7DBC5EE7D30BB~r3dn3ck
 2baufgsbt3a2jolhmvrsmd3ufdg72cyz
 650+HS_DESC_CONTENT expyuzz4wqqyqhjn 2baufgsbt3a2jolhmvrsmd3ufdg72cyz
 $D05A37450AB9950181124563D3A7DBC5EE7D30BB~r3dn3ck
 <...>
 650 OK
 HSFETCH expyuzz4wqqyqhjn
 250 OK
 650 HS_DESC REQUESTED expyuzz4wqqyqhjn NO_AUTH
 $707C1B61AC72227B34487B56D04BAA3BA1179CE8~BrassHornExit04
 oalrv2mxdne6gfwikalgyl47sktjwxte
 650 HS_DESC RECEIVED expyuzz4wqqyqhjn NO_AUTH
 $707C1B61AC72227B34487B56D04BAA3BA1179CE8~BrassHornExit04
 nyuijvpn63lgfbupw5vqyfdhzbllyk7v
 650+HS_DESC_CONTENT expyuzz4wqqyqhjn oalrv2mxdne6gfwikalgyl47sktjwxte
 $707C1B61AC72227B34487B56D04BAA3BA1179CE8~BrassHornExit04
 <...>
 650 OK
 HSFETCH expyuzz4wqqyqhjn
 250 OK
 650 HS_DESC REQUESTED expyuzz4wqqyqhjn NO_AUTH
 $D06CD6EDAA93F4656E0C9F6347B26A2828D6CB25~Unnamed
 2baufgsbt3a2jolhmvrsmd3ufdg72cyz
 650 HS_DESC RECEIVED expyuzz4wqqyqhjn NO_AUTH
 $D06CD6EDAA93F4656E0C9F6347B26A2828D6CB25~Unnamed
 2baufgsbt3a2jolhmvrsmd3ufdg72cyz
 650+HS_DESC_CONTENT expyuzz4wqqyqhjn 2baufgsbt3a2jolhmvrsmd3ufdg72cyz
 $D06CD6EDAA93F4656E0C9F6347B26A2828D6CB25~Unnamed
 <...>
 650 OK
 HSFETCH expyuzz4wqqyqhjn
 250 OK
 650 HS_DESC REQUESTED expyuzz4wqqyqhjn NO_AUTH
 $7056EA2E99144613694F0264C80579AAFEA6E1CD~ozora
 oalrv2mxdne6gfwikalgyl47sktjwxte
 650 HS_DESC RECEIVED expyuzz4wqqyqhjn NO_AUTH
 $7056EA2E99144613694F0264C80579AAFEA6E1CD~ozora
 2baufgsbt3a2jolhmvrsmd3ufdg72cyz
 650+HS_DESC_CONTENT expyuzz4wqqyqhjn oalrv2mxdne6gfwikalgyl47sktjwxte
 $7056EA2E99144613694F0264C80579AAFEA6E1CD~ozora
 <...>
 650 OK
 HSFETCH expyuzz4wqqyqhjn
 250 OK
 650 HS_DESC REQUESTED expyuzz4wqqyqhjn NO_AUTH
 $7044955A4D7B04CF70011D73B467B13CE5E69D41~L29Ah
 oalrv2mxdne6gfwikalgyl47sktjwxte
 650 HS_DESC RECEIVED expyuzz4wqqyqhjn NO_AUTH
 $7044955A4D7B04CF70011D73B467B13CE5E69D41~L29Ah
 2baufgsbt3a2jolhmvrsmd3ufdg72cyz
 650+HS_DESC_CONTENT expyuzz4wqqyqhjn oalrv2mxdne6gfwikalgyl47sktjwxte
 $7044955A4D7B04CF70011D73B467B13CE5E69D41~L29Ah
 <...>
 650 OK
 HSFETCH expyuzz4wqqyqhjn
 250 OK
 }}}

 No HS_DESC or HS_DESC_CONTENT is received after the last HSFETCH (I waited
 about an hour). The control port spec
 (https://gitweb.torproject.org/torspec.git/tree/control-spec.txt) states
 that "On success, Tor replies "250 OK" then Tor MUST eventually follow
 this with both a HS_DESC and HS_DESC_CONTENT events with the results.".

 I guess that stem blocks because it waits for the event. If I send another
 HSFETCH expyuzz4wqqyqhjn after a couple of minutes, the corresponding
 events are emitted just fine. Also I noticed that when the sleep in the
 above python script is increased to 10 minutes,
 get_hidden_service_descriptor continues to return a result quickly.

--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/22042>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online


More information about the tor-bugs mailing list