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

Use Tor's ADD_ONION command when available #385

Merged
merged 4 commits into from
Mar 21, 2016

Conversation

special
Copy link
Member

@special special commented Mar 17, 2016

For Tor >= 0.2.7, start using the ADD_ONION control command instead of SETCONF to configure hidden services, and store the private keys in our configuration file instead of as separate files on the filesystem.

Older versions of Tor remain supported, and the behavior will not change. There is an edge case where a profile is created with a new version of Tor and later downgraded - this is not supported. Don't do that.

Existing profiles will copy their keys into the configuration and stop using the files on disk, but those files will not be removed yet to help avoid any risk of data loss. They will be removed later, likely when we enable profile encryption.

Fixes #227

special added 4 commits March 9, 2016 17:30
Refactored the HiddenService class API to handle services that have no
filesystem representation.
For versions of Tor that support it, use ADD_ONION instead of SETCONF to
configure hidden services.
For Tor >= 0.2.7, we can use ADD_ONION to configure hidden services, so
private keys no longer need to be in separate files on disk. When
possible, stop using those files and store keys only in our
configuration file.

Existing profiles will copy their keys into the configuration file, but
the old files will not be removed yet. Older versions of Tor remain
supported as well, and will always use the filesystem.
@ioerror
Copy link
Contributor

ioerror commented Mar 17, 2016

What kind of tests do you want to see here to merge this code?

out += " NEW:RSA1024";
}

foreach (const HiddenService::Target &target, m_service->targets()) {
Copy link
Contributor

Choose a reason for hiding this comment

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

not something you have to change now, but in the future you may want to look into range-for (and qAsConst), it avoids copies of data & leads to smaller binary size.

@rburchell
Copy link
Contributor

👍

special added a commit that referenced this pull request Mar 21, 2016
Use Tor's ADD_ONION command when available
@special special merged commit e350b46 into ricochet-im:master Mar 21, 2016
@special special deleted the tor-add-onion branch March 21, 2016 13:23
@ioerror
Copy link
Contributor

ioerror commented Mar 21, 2016

Works for me on SubgraphOS now. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants