YEEEEAHHHH I really need HidServAuth for v3 onion!!!
Please give haxxpop's code (comment:16) a try and let us know how it works for you.
You can test it by adding HiddenServiceAuthorizeClient basic <client_name>
on the service torrc and HidServAuth <onion address> <base64-encoded x25519 private key> on the client torrc. You can get the private key from client_authorized_privkeys/<client_name>.privkey on the service file directory
You can just put the public key in client_authorized_pubkeys before running the HS.
The HS will not generate a new key and it will use the public key in that file.
"basic" and "stealth" don't make sense for v3 onion services, because authentication works differently in v3.
We have "descriptor", "intro", and "standard" (both).
Depending on your use case, you might be looking for "descriptor" auth.
Trac: Summary: prop224: Implement basic client authorization to prop224: Implement standard client authorization
But we are re-using existing options, so I suggest we create:
config/onions/versions = 2 3
config/onions/auth/descriptor = 1
config/onions/auth/intro = 1
We might also want a flag when v3 single onions support IPv6-only, but that's a separate ticket.
Did an initial review of haxxpop's branch here. Next steps include: More careful review, valgrind, more testing on chutney and more testing on real net.
Apparently we have two things called Appendix E in rend-spec-v3.txt now. I don't think this is new with this patch, but let's fix that.
When you list "./authorized_clients/alice", etc in appendix F, do you intend to specify that this list has to be inside the service directory? I ask because if you're doing this, I don't think it makes sense to list them all separately in the torrc, and list the directory separately as well.
Do we want to allow multiple keys per file?
I'd suggest renaming all the client options so that they don't start with "HiddenService": It makes things much easier if only our service-side options start with "HiddenService". How about ClientOnionAuth or something?
We should say what happens if Tor encounters an unrecognized auth-type, user name, or onion service name in one of these files. I say it should ignore that key.
Apparently we have two things called Appendix E in rend-spec-v3.txt now. I don't think this is new with this patch, but let's fix that.
When you list "./authorized_clients/alice", etc in appendix F, do you intend to specify that this list has to be inside the service directory? I ask because if you're doing this, I don't think it makes sense to list them all separately in the torrc, and list the directory separately as well.
Do we want to allow multiple keys per file?
I'd suggest renaming all the client options so that they don't start with "HiddenService": It makes things much easier if only our service-side options start with "HiddenService". How about ClientOnionAuth or something?
We should say what happens if Tor encounters an unrecognized auth-type, user name, or onion service name in one of these files. I say it should ignore that key.
Thanks for the review. Pushed relevant fixes on my github repo, same branch name.
I've commented on the new PR. Very very good stuff :). Minor easy-to-fix things I pointed it out.
There is an issue that I've been discussing with haxxpop on IRC so I'll summarize it here. If the client gets the descriptor but can't decrypt it, there are two cases:
Client has no client authorization configured for the .onion.
What happens in this case is that we end up with many scaring warnings:
Aug 22 14:07:03.704 [warn] Encrypted service descriptor MAC check failedAug 22 14:07:03.704 [warn] Decrypting encrypted desc failed.Aug 22 14:07:03.704 [warn] Service descriptor decryption failed.Aug 22 14:07:03.704 [warn] Could not parse received descriptor as client.
... and then the client will refetch the descriptor on all HSDir leading to 8 times these failures. So the question is what to do if decryption fails? My opinion is:
Downgrade the logs to info(). Then, iff the client can't decrypt the descriptor, then log info that it probably doesn't have a valid authorization for the service and stop the refetch. Creating a thundering herd on all HSDir because the first can't be decrypted is not good imo.
Client has client authorization configured for the .onion but not working.
In this case, same will happen as above but we do know in this case that the client has an authorization for the .onion but it simply didn't worked. So same as above, I would not make the client refetch but this time log notice that their configured authorization is not working.
I've commented on the new PR. Very very good stuff :). Minor easy-to-fix things I pointed it out.
There is an issue that I've been discussing with haxxpop on IRC so I'll summarize it here. If the client gets the descriptor but can't decrypt it, there are two cases:
Client has no client authorization configured for the .onion.
What happens in this case is that we end up with many scaring warnings:
{{{
Aug 22 14:07:03.704 [warn] Encrypted service descriptor MAC check failed
Aug 22 14:07:03.704 [warn] Decrypting encrypted desc failed.
Aug 22 14:07:03.704 [warn] Service descriptor decryption failed.
Aug 22 14:07:03.704 [warn] Could not parse received descriptor as client.
}}}
... and then the client will refetch the descriptor on all HSDir leading to 8 times these failures. So the question is what to do if decryption fails? My opinion is:
Downgrade the logs to info(). Then, iff the client can't decrypt the descriptor, then log info that it probably doesn't have a valid authorization for the service and stop the refetch. Creating a thundering herd on all HSDir because the first can't be decrypted is not good imo.
Sounds plausible. Perhaps we should still log a single line in notice that the client tried to access an HS with client authorization? So that the user "learns" why the connection failed, otherwise it's completely hidden.
Client has client authorization configured for the .onion but not working.
In this case, same will happen as above but we do know in this case that the client has an authorization for the .onion but it simply didn't worked. So same as above, I would not make the client refetch but this time log notice that their configured authorization is not working.
Sounds plausible.
The underlying assumption here is that all HSDirs will serve the same descriptor, so if one can't satisfy us, the others can't satisfy us either, so no point in trying. I think that's a reasonable assumption for now.
Revisions have been pushed in the PR. For some reasons, the OSX clang Travis build failed during "setup" so I don't know how to restart that but everything else is green.
There is also the question of what to do when a recognized line fails to be parsed on the client or service side. Right now on the service side we just warn that we failed to parse the client pubkey and move on. Is this the right thing? Shouldn't we just abort since something is obviously wrong? Otherwise the operator might not even notice. Same for the client-case above.