<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div></div><div><br></div><div>On 17 Feb 2018, at 06:06, iwakeh <<a href="mailto:iwakeh@torproject.org">iwakeh@torproject.org</a>> wrote:<br><br></div><blockquote type="cite"><div><span>Hi!</span><br><span></span><br><span>On 02/16/2018 05:07 PM, Katharina Haselhorst wrote:</span><br><blockquote type="cite"><span>Hello,</span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span>This is a question to the metrics-lib team:</span><br></blockquote><blockquote type="cite"><span>Is there a reason why there is no "hidden-service-dir" information in ServerDescriptor? </span><br></blockquote><span></span><br><span>You might be looking for getHiddenServiceDirVersions in RelayServerDescriptor (see [0])?</span><br></div></blockquote><div><br></div><div><pre style="word-wrap: break-word;"><font face="UICTFontTextStyleTallBody"><span style="white-space: normal; background-color: rgba(255, 255, 255, 0);">Most relays don't advertise any VersionNums for this field, so it won't </span></font><span style="white-space: normal; background-color: rgba(255, 255, 255, 0); font-family: UICTFontTextStyleTallBody;">tell you if the relay supports v2 or v3 HSDir. It just looks like this:</span></pre><pre style="word-wrap: break-word;"><font face="UICTFontTextStyleTallBody"><span style="white-space: normal; background-color: rgba(255, 255, 255, 0);">hidden-service-dir</span></font></pre><pre style="word-wrap: break-word;"><font face="UICTFontTextStyleTallBody"><span style="white-space: normal; background-color: rgba(255, 255, 255, 0);"><br></span></font></pre><pre style="word-wrap: break-word;"><font face="UICTFontTextStyleTallBody"><span style="white-space: normal;">And the dir-spec gives an incorrect default version of "2", when the default is "2 and 3" for some tor versions. I have opened a ticket for this spec bug:</span></font></pre><pre style="word-wrap: break-word;"><font color="#000000" face="UICTFontTextStyleTallBody" style="white-space: normal; background-color: rgba(255, 255, 255, 0);"><a href="https://trac.torproject.org/projects/tor/ticket/25284#comment:1" style="white-space: normal; background-color: rgba(255, 255, 255, 0);">https://trac.torproject.org/projects/tor/ticket/25284</a></font></pre><pre style="word-wrap: break-word;"><br></pre><pre style="word-wrap: break-word;"><font face="UICTFontTextStyleTallBody"><span style="white-space: normal;">If you want to know HSDir version, look at the protover field instead:</span></font></pre></div><div><pre style="word-wrap: break-word;"><font face="UICTFontTextStyleTallBody"><span style="white-space: normal; background-color: rgba(255, 255, 255, 0);">proto Cons=1-2 Desc=1-2 DirCache=1-2 HSDir=1-2 HSIntro=3-4 HSRend=1-2 Link=1-4 LinkAuth=1,3 Microdesc=1-2 Relay=1-2</span></font></pre><pre style="word-wrap: break-word;"><font face="UICTFontTextStyleTallBody"><span style="white-space: normal;">Which is available using getProtocols() [1]</span></font></pre><pre style="word-wrap: break-word;"><font face="UICTFontTextStyleTallBody"><span style="white-space: normal;">The HSDir protovers are defined in the tor-spec [2]. 1 is HSv2, and 2 is HSv3.</span></font></pre><pre style="word-wrap: break-word;"><font face="UICTFontTextStyleTallBody"><span style="white-space: normal;">T</span></font></pre><pre style="word-wrap: break-word;"><font face="UICTFontTextStyleTallBody"><span style="white-space: normal;">[1] </span></font><a href="https://metrics.torproject.org/metrics-lib/org/torproject/descriptor/ServerDescriptor.html#getProtocols--">https://metrics.torproject.org/metrics-lib/org/torproject/descriptor/ServerDescriptor.html#getProtocols--</a></pre><pre style="word-wrap: break-word;"><font face="UICTFontTextStyleTallBody"><span style="white-space: normal;">[2] </span></font><a href="https://gitweb.torproject.org/torspec.git/tree/tor-spec.txt#n1926">https://gitweb.torproject.org/torspec.git/tree/tor-spec.txt#n1926</a></pre></div><blockquote type="cite"><div><span>[0] <a href="https://metrics.torproject.org/metrics-lib/org/torproject/descriptor/RelayServerDescriptor.html">https://metrics.torproject.org/metrics-lib/org/torproject/descriptor/RelayServerDescriptor.html</a></span><br><span></span><br><span></span><br><blockquote type="cite"><span>The dir-spec (<a href="https://gitweb.torproject.org/torspec.git/tree/dir-spec.txt">https://gitweb.torproject.org/torspec.git/tree/dir-spec.txt</a>) does not list it as obsolete, so it seams</span><br></blockquote><blockquote type="cite"><span>that this field containts relevant information.</span><br></blockquote><blockquote type="cite"><span>Although it is of course possible to parse the raw data and extract the information, this is (as the api indicates) an expensive operation: I would need to ask gor the raw descriptor bytes which copies the relevant data into a new array...</span></blockquote><blockquote type="cite"><span></span></blockquote></div></blockquote></body></html>