Ignore carriage returns when parsing descriptors
|Reported by:||karsten||Owned by:||karsten|
There are some (very old) server descriptors containing carriage returns in their contact line, more precisely in a full PGP key block. I'm attaching one such descriptor to this ticket.
It's unclear if carriage returns are permitted by dir-spec.txt. It does say "ArgumentChar ::= any printing ASCII character except NL.", but we know that Tor accepts non-ASCII characters in contact or platform lines, too. So, I guess the only non-permitted character is NL.
In metrics-lib, we parse descriptors using BufferedReader.readLine() which treats \n, \r, and \r\n all the same. We may have to write our own readLine() replacement that only accepts \n as line end.
This may also affect stem's descriptor parser.