Retain hidserv- lines in sanitized bridge extra-info descriptors
CollecTor logs recently started containing lines like this:
2016-11-18 09:09:01,897 WARN o.t.c.b.SanitizedBridgesWriter:1214 Unrecognized line 'hidserv-stats-end 2016-11-17 22:50:24 (86400 s)'. Skipping.
The reason is that we don't have code in SanitizedBridgesWriter#sanitizeAndStoreExtraInfoDescriptor()
to handle hidserv-
lines, and the default is to skip descriptors with unknown lines.
There's nothing particular sensitive in these lines that would reveal the bridge IP address or location. We should simply copy them over like the other statistics lines.
Patch:
diff --git a/src/main/java/org/torproject/collector/bridgedescs/SanitizedBridgesWriter.java b/src/main/java/org/torproject/collector/bridgedescs/SanitizedBridgesWriter.java
index 5e101eb..c54d83e 100644
--- a/src/main/java/org/torproject/collector/bridgedescs/SanitizedBridgesWriter.java
+++ b/src/main/java/org/torproject/collector/bridgedescs/SanitizedBridgesWriter.java
@@ -1192,7 +1192,8 @@ public class SanitizedBridgesWriter extends CollecTorMain {
|| line.startsWith("dirreq-")
|| line.startsWith("cell-")
|| line.startsWith("entry-")
- || line.startsWith("exit-")) {
+ || line.startsWith("exit-")
+ || line.startsWith("hidserv-")) {
scrubbed.append(line + "\n");
/* When we reach the signature, we're done. Write the sanitized