Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Tor now has support for hidden services v3 for quite a while. This library lacks support for it.
Note: This code exits because I needed a rather quick solution. I would vote for a cleaner solution that is a little more effort. This PR, although being functional, does not feel like the proper solution to the problem.
This PR adds basic support for hidden services v3. To aquire this it applies the following changes:
mapOnion
function to create a hidden services v2 key if no secret key is given.mapOnion
function it adds anothermapOnionV3
function that implements the same behaviour for hidden services v3. Also tests are duplicated for this function.accept
function now usesmapOnionV3
.The latter one is kind of a breaking change as accept is not able to cunsume hidden services v2 keys any longer. But duplicating
accept
felt somewhat wrong to me.Mid term I would vote for rewriting this library a bit and utilizing its own types for the keys. This would deduplicate
mapOnion
andmapOnionV3
again and also would empoweraccept
to work with hidden services v2 again.