We should learn to present different TLS certs for incoming connections
vs outgoing connections.
The motivating example is bridges. They want to show the same identity
to people who connect, yet behave like clients when they connect to other
relays (e.g. change keys when they change IP addresses).
(Of course, this change would provide a new way to test for bridges: if a
Tor connects to you, connect back and see if the cert is different. But at
least that's an active test that requires the bridge to connect to you
first. But then, the attack I describe above only kicks in when the bridge
connects to you. Hm.)
[Automatically added by flyspray2trac: Operating System: All]
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Child items ...
Show closed items
Linked items 0
Link issues together to show that they're related.
Learn more.
That branch is built on my bug1994-v3 branch (see #1994 (moved)), so that I could see correct documentation for a few functions before I mutilated them.
Trac: Keywords: N/Adeleted, N/Aadded Parent: N/AtoN/A Status: new to needs_review Description: We should learn to present different TLS certs for incoming connections
vs outgoing connections.
The motivating example is bridges. They want to show the same identity
to people who connect, yet behave like clients when they connect to other
relays (e.g. change keys when they change IP addresses).
(Of course, this change would provide a new way to test for bridges: if a
Tor connects to you, connect back and see if the cert is different. But at
least that's an active test that requires the bridge to connect to you
first. But then, the attack I describe above only kicks in when the bridge
connects to you. Hm.)
[Automatically added by flyspray2trac: Operating System: All]
to
We should learn to present different TLS certs for incoming connections
vs outgoing connections.
The motivating example is bridges. They want to show the same identity
to people who connect, yet behave like clients when they connect to other
relays (e.g. change keys when they change IP addresses).
(Of course, this change would provide a new way to test for bridges: if a
Tor connects to you, connect back and see if the cert is different. But at
least that's an active test that requires the bridge to connect to you
first. But then, the attack I describe above only kicks in when the bridge
connects to you. Hm.)
[Automatically added by flyspray2trac: Operating System: All]
This looks pretty good, modulo a couple of places I'd like to add more documentation. How have you tested this? What more tests are needed?
I've been using it as my regular Tor client. I toggled BridgeRelay on without stopping Tor, then off, then on again several days later, and had no unexpected issues. I have since restarted Tor with BridgeRelay on, and it has been running (and receiving and handling bridge users' connections properly) without trouble since then.
I have not yet tested:
running this Tor in public server mode
toggling to and from public server mode without stopping Tor
whether the certs Tor sends on incoming and outgoing connections do, in fact, have different public keys in bridge mode
I can't reproduce any crash. As far as review, I think public_server_mode() is an unfortunate function name. To me it immediately implied that we'd be dealing with the PublishServerDescriptor options, instead of a simple bridge check. I generally wonder if it is necessary to make this distinction at all, because I can't see how it would hurt to maintain separate client and server certs for public relays. Maybe I'm missing something here?
The functions want better documentation wrt accepted parameters and return values, I think. Also a changes file is missing.
As far as review, I think public_server_mode() is an unfortunate function name.
If anyone can suggest a less bad term for a non-bridge relay than ‘public server’, I will happily rename public_server_mode. I couldn't come up with one.
To me it immediately implied that we'd be dealing with the PublishServerDescriptor options, instead of a simple bridge check.
That test is done in functions whose names contain publishable_server. ‘Publishable server’ is probably a bad term for that, as the documentation states that a Tor controller could publish descriptors for a Tor server with PublishServerDescriptor off, thus making the Tor server publishable.
I generally wonder if it is necessary to make this distinction at all, because I can't see how it would hurt to maintain separate client and server certs for public relays. Maybe I'm missing something here?
See Tor spec §5.3.1. If an OR X opens a TLS connection to an OR Y, and a client asks Y to extend a circuit to X, that circuit should generally go over the existing TLS connection between X and Y, even though X was the client (and used its client certificates) for that connection.
The functions want better documentation wrt accepted parameters and return values, I think.
Yes. Also, the tor_tls_context_t reference manipulation should be refactored out into utility functions, because I can no longer tell at a glance whether tor_tls_context_t references are referenced and freed properly.
The observed crash is now bug2097. With my bug2097 fix, does switching options on and off in a running Tor now work for you?
Toggling BridgeRelay didn't crash Tor most of the times that I tried it, and Sebastian tested it multiple times and couldn't reproduce the crash. bug988-v6 doesn't seem to introduce any crashes.
Apparently this one is missing a changes file, even though it's already merged into the upcoming 0.2.2.18? Is there a changes file somewhere, or should somebody write one?
It looks fine to me. I also grepped for any references to get_identity_key and get_client_identity_key that escaped being replaced with get_tlsclient_identity_key or get_server_identity_key, and didn't find any.
I'm nervous about backporting this one to 0.2.1, since it touches a lot of things and it was tough to get right. Leaving 0.2.1 as-is (and working on making it obsolete) is probably the more robust plan.
We should decide whether to backport it, or no. I personally think it might be a better idea spending our effort trying to get 0.2.2.x stable. This is enough like a new feature that leaving it out of 0.2.1.x is fine by me.
rransom (or anybody) -- want to argue for a backport?
This change did break things on 0.2.2.x and later. In particular, it seems to have introduced #2433 (moved), which introduced #2572 (moved), although I can't quite see how that happened now.
This change was backported to 0.2.1.x anyway in late October 2011, as a prerequisite for the fix for a major anonymity issue.
This change did break things on 0.2.2.x and later. In particular, it seems to have introduced #2433 (moved), which introduced #2572 (moved), although I can't quite see how that happened now.