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

feat(ios): replace go-libtor with ./internal/libtor #1366

Merged
merged 13 commits into from
Oct 12, 2023
1 change: 0 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ require (
github.com/miekg/dns v1.1.56
github.com/mitchellh/go-wordwrap v1.0.1
github.com/montanaflynn/stats v0.7.1
github.com/ooni/go-libtor v1.1.8
github.com/ooni/netem v0.0.0-20230920215742-15f3ffec0107
github.com/ooni/oocrypto v0.5.5
github.com/ooni/oohttp v0.6.5
Expand Down
4 changes: 0 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46t
github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY=
github.com/creack/pty v1.1.17 h1:QeVUsEDNrLBW4tMgZHvxy18sKtr6VI492kBhUfhDJNI=
github.com/creack/pty v1.1.17/go.mod h1:MOBLtS5ELjhRRrroQr9kyvTxUAFNvYEK993ew/Vr4O4=
github.com/cretz/bine v0.1.0/go.mod h1:6PF6fWAvYtwjRGkAuDEJeWNOv3a2hUouSP/yRYXmvHw=
github.com/cretz/bine v0.2.0 h1:8GiDRGlTgz+o8H9DSnsl+5MeBK4HsExxgl6WgzOCuZo=
github.com/cretz/bine v0.2.0/go.mod h1:WU4o9QR9wWp8AVKtTM1XD5vUHkEqnf2vVSo6dBqbetI=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
Expand Down Expand Up @@ -322,8 +321,6 @@ github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7J
github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo=
github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY=
github.com/onsi/gomega v1.27.10 h1:naR28SdDFlqrG6kScpT8VWpu1xWY5nJRCF3XaYyBjhI=
github.com/ooni/go-libtor v1.1.8 h1:Wo3V3DVTxl5vZdxtQakqYP+DAHx7pPtAFSl1bnAa08w=
github.com/ooni/go-libtor v1.1.8/go.mod h1:q1YyLwRD9GeMyeerVvwc0vJ2YgwDLTp2bdVcrh/JXyI=
github.com/ooni/netem v0.0.0-20230920215742-15f3ffec0107 h1:PktaCPQ1NYZOaK+J8pQGYiPCYFkGR5H3ZURg9zPkQsI=
github.com/ooni/netem v0.0.0-20230920215742-15f3ffec0107/go.mod h1:5X3Lk4+cnrwrQiYgRlCWXgV33IMDgLaO5s1x0DD/fO0=
github.com/ooni/oocrypto v0.5.5 h1:x0wIgtBfghVu8Ok0tR/xVyfHlo646hN1LB/5bzuXcIg=
Expand Down Expand Up @@ -550,7 +547,6 @@ go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM=
golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20190325154230-a5d413f7728c/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20190404164418-38d8ce5564a5/go.mod h1:WFFai1msRO1wXaEeE5yQxYXgSfI8pQAWXbQop6sCtWE=
golang.org/x/crypto v0.0.0-20190411191339-88737f569e3a/go.mod h1:WFFai1msRO1wXaEeE5yQxYXgSfI8pQAWXbQop6sCtWE=
golang.org/x/crypto v0.0.0-20190426145343-a29dc8fdc734/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
Expand Down
5 changes: 5 additions & 0 deletions internal/libtor/enabled.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ package libtor
// #cgo android,amd64 CFLAGS: -I${SRCDIR}/android/amd64/include
// #cgo android,amd64 LDFLAGS: -L${SRCDIR}/android/amd64/lib -ltor -levent -lssl -lcrypto -lz -lm
//
// #cgo ios,arm64 CFLAGS: -I${SRCDIR}/ios/arm64/include
// #cgo ios,arm64 LDFLAGS: -L${SRCDIR}/ios/arm64/lib -ltor -levent -lssl -lcrypto -lz -lm
// #cgo ios,amd64 CFLAGS: -I${SRCDIR}/ios/amd64/include
// #cgo ios,amd64 LDFLAGS: -L${SRCDIR}/ios/amd64/lib -ltor -levent -lssl -lcrypto -lz -lm
//
// #include <limits.h>
// #include <stdbool.h>
// #include <stdlib.h>
Expand Down
4 changes: 2 additions & 2 deletions internal/tunnel/tordesktop.go
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
//go:build !android && !ios && !ooni_libtor
//go:build !ooni_libtor

package tunnel

//
// This file implements our strategy for running tor on desktop in most
// configurations except for the ooni_libtor case, where we build tor and
// its dependencies for Linux. The purpuse of this special case it that
// of testing the otherwise untested code that would run on Android.
// of testing the otherwise untested code that would run on mobile.
//

import (
Expand Down
9 changes: 4 additions & 5 deletions internal/tunnel/torembed.go
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
//go:build ooni_libtor && android
//go:build ooni_libtor

package tunnel

//
// This file implements the ooni_libtor strategy of embedding tor. We manually
// compile tor and its dependencies and link against it. We currently only adopt
// this technique for Android. We may possibly migrate also iOS in the future,
// provided that this functionality proves to be stable in the 3.17 cycle.
// compile tor and its dependencies and link against it.
//
// See https://github.com/ooni/probe/issues/2365.
// See https://github.com/ooni/probe/issues/2365 and
// https://github.com/ooni/probe/issues/2564.
//

import (
Expand Down
35 changes: 0 additions & 35 deletions internal/tunnel/tormobile.go

This file was deleted.