I suspect the 0.2.3.1-alpha test bundles, because I remember hearing that the dirreq-stats feature was turned on by default in 0.2.3.x, and any Windows user who would have known how to fiddle with Tor's configuration on 0.2.2.x in a way that would trigger this bug would have submitted a more detailed bug report.

I've made a "bug3607" branch and tweaked the changes file a little bit so that it doesn't have a huge list between "write several files" and "in text mode".

I was a little worried in some places that we might be write something in text mode and then later read it in binary mode, but I think we're in the clear: when we read the client-keys file, we do so in text mode. We never read the files written in geoip.c, or the hostname file, or the buffer-stats file.

One thing, though: is it right to make the stuff in tor-gencert in text mode? I think that when we load and parse certificates, we assume that they're stored in LF mode. Better check this. (This doesn't matter too much, since there is no way we're having an authority op who makes signing keys on windows, but it would be nice to get it right for testing.)

I've made a "bug3607" branch and tweaked the changes file a little bit so that it doesn't have a huge list between "write several files" and "in text mode".

Looks good!

I was a little worried in some places that we might be write something in text mode and then later read it in binary mode, but I think we're in the clear: when we read the client-keys file, we do so in text mode. We never read the files written in geoip.c, or the hostname file, or the buffer-stats file.

One thing, though: is it right to make the stuff in tor-gencert in text mode? I think that when we load and parse certificates, we assume that they're stored in LF mode. Better check this. (This doesn't matter too much, since there is no way we're having an authority op who makes signing keys on windows, but it would be nice to get it right for testing.)

Keys are read using init_key_from_file, which calls crypto_pk_read_private_key_from_filename, which calls read_file_to_str without the RFTS_BIN flag; thus, keys are read in text mode. Whether this text mode expects CRLF or LF line endings is OS-dependent.