commit 4d8287948849fcb1de17080d83bb008f65b487ce Author: Karsten Loesing karsten.loesing@gmx.net Date: Fri Jun 29 12:43:10 2012 +0200
Sanitize pluggable transport lines in bridge descriptors.
Implements #4957. --- .../ernie/db/SanitizedBridgesWriter.java | 13 +++++++++++++ 1 files changed, 13 insertions(+), 0 deletions(-)
diff --git a/src/org/torproject/ernie/db/SanitizedBridgesWriter.java b/src/org/torproject/ernie/db/SanitizedBridgesWriter.java index d138dbc..c72ec9f 100644 --- a/src/org/torproject/ernie/db/SanitizedBridgesWriter.java +++ b/src/org/torproject/ernie/db/SanitizedBridgesWriter.java @@ -760,6 +760,19 @@ public class SanitizedBridgesWriter { scrubbed.append(line + "\n"); published = line.substring("published ".length());
+ /* Remove everything from transport lines except the transport + * name. */ + } else if (line.startsWith("transport ")) { + if (parts.length < 3) { + this.logger.fine("Illegal line in extra-info descriptor: '" + + line + "'. Skipping descriptor."); + return; + } + scrubbed.append("transport " + parts[1] + "\n"); + + /* Skip transport-info lines entirely. */ + } else if (line.startsWith("transport-info ")) { + /* Write the following lines unmodified to the sanitized * descriptor. */ } else if (line.startsWith("write-history ")
tor-commits@lists.torproject.org