Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V3 Onion Services With Client Authorization #415

Merged
merged 11 commits into from Feb 4, 2021
Merged

V3 Onion Services With Client Authorization #415

merged 11 commits into from Feb 4, 2021

Conversation

bitmold
Copy link
Collaborator

@bitmold bitmold commented Nov 27, 2020

This introduces V3 Onion Services to Orbot. Right now this does not support client authorization, just the creation of V3 Onion via the user interface or through an Intent call from another application.

Currently you can backup and restore V3 Onion Services to/from disk.

There are a lot of ways in which this implementation follows the code for traditional V2 services, but be that as it may I've decided to be very selective about code reuse from V2 since in the not too distant future those services will be dropped and we'll likely want to remove a lot of it from Orbot altogether. It also would be desirable to allow users to migrate an existing V2 service to V3 but at this time that remains unimplemented.

Making this PR a "draft" right now because there remains a few things to be polished...

@bitmold
Copy link
Collaborator Author

bitmold commented Nov 28, 2020

The main menu UI for "Onion Services" has "Hosted Services" which takes you to an Activity for managing V3 Onion Services, and a new deprecated V2 submenu which allows the user to maintain their V2 Onion Services and associated client cookies

image
image

@bitmold
Copy link
Collaborator Author

bitmold commented Nov 28, 2020

The UI for V3 Onion Services is deeply similar to the old V2 UI in Orbot. Here's a small demo of deleting/restoring a service i made up with fake information.
v3uidemo

@bitmold
Copy link
Collaborator Author

bitmold commented Nov 28, 2020

When testing this, I think the following areas should be put under special consideration:

  • The coexistence of V2 and V3 services. Especially ones pointing to the same location.
  • Backup and restore of Onion Services on newer versions of Android (30) as well as the pre lollipop versions we support and ship with the WRITE_EXTERNAL_STORAGE permission (APIs 16, 17, and 18)
  • Being able to externally spin up a v3 onion service from outside of Orbot.

@bitmold bitmold requested a review from n8fr8 November 28, 2020 17:40
@bitmold
Copy link
Collaborator Author

bitmold commented Nov 28, 2020

At this point the remaining work to be done with this is just the creation of V3 Onion Services from other apps. I'm currently forking NetCipher to add support for a new Intent that's able to talk to Orbot from OrbotHelper in the same way that library uses the org.torproject.android.REQUEST_HS_PORT Intent action for v2 hidden services.

@bitmold bitmold added PLEASE TEST please test and post feedback v3 onion services labels Nov 28, 2020
@bitmold
Copy link
Collaborator Author

bitmold commented Nov 29, 2020

This PR coincides with guardianproject/NetCipher#80

Copy link
Member

@eighthave eighthave left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall looks good, see comments for things that could be improved. I'm not familiar with the old Hidden Service code, so some of my comments might be due to my ignorance there.

@bitmold bitmold changed the title Added Support for V3 Onion Services Without Client Authorization V3 Onion Services With Client Authorization Jan 28, 2021
@bitmold
Copy link
Collaborator Author

bitmold commented Jan 28, 2021

This pull request has changed a lot and I had to take a step back from it for about 2 months.

To summarize all of the changes this PR Includes:

@bitmold
Copy link
Collaborator Author

bitmold commented Jan 28, 2021

Screenshot of client authorization being enabled on some random v3 service
image

Screenshot of field to add new v3 client auth info
image

@bitmold
Copy link
Collaborator Author

bitmold commented Jan 28, 2021

If you want to, you can export *.auth_private client authorization configuration information from Orbot to the external phone storage. Similarly Orbot can import this config info
image

@n8fr8 n8fr8 merged commit ecb5a93 into guardianproject:master Feb 4, 2021
@n8fr8
Copy link
Member

n8fr8 commented Feb 4, 2021

Woohoo!

@bitmold bitmold deleted the v3onions branch February 5, 2021 22:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PLEASE TEST please test and post feedback v3 onion services
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants