Skip to content

Commit 4513a12

Browse files
committed
[backport] feat(ios): replace go-libtor with ./internal/libtor
This diff backports #1366 to the release/3.19 branch. This diff replaces go-libtor with ./internal/libtor. Closes ooni/probe#2564
1 parent d71e416 commit 4513a12

File tree

6 files changed

+11
-47
lines changed

6 files changed

+11
-47
lines changed

go.mod

-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ require (
2222
github.com/miekg/dns v1.1.56
2323
github.com/mitchellh/go-wordwrap v1.0.1
2424
github.com/montanaflynn/stats v0.7.1
25-
github.com/ooni/go-libtor v1.1.8
2625
github.com/ooni/netem v0.0.0-20230920215742-15f3ffec0107
2726
github.com/ooni/oocrypto v0.5.5
2827
github.com/ooni/oohttp v0.6.5

go.sum

-4
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46t
7474
github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY=
7575
github.com/creack/pty v1.1.17 h1:QeVUsEDNrLBW4tMgZHvxy18sKtr6VI492kBhUfhDJNI=
7676
github.com/creack/pty v1.1.17/go.mod h1:MOBLtS5ELjhRRrroQr9kyvTxUAFNvYEK993ew/Vr4O4=
77-
github.com/cretz/bine v0.1.0/go.mod h1:6PF6fWAvYtwjRGkAuDEJeWNOv3a2hUouSP/yRYXmvHw=
7877
github.com/cretz/bine v0.2.0 h1:8GiDRGlTgz+o8H9DSnsl+5MeBK4HsExxgl6WgzOCuZo=
7978
github.com/cretz/bine v0.2.0/go.mod h1:WU4o9QR9wWp8AVKtTM1XD5vUHkEqnf2vVSo6dBqbetI=
8079
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
@@ -322,8 +321,6 @@ github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7J
322321
github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo=
323322
github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY=
324323
github.com/onsi/gomega v1.27.10 h1:naR28SdDFlqrG6kScpT8VWpu1xWY5nJRCF3XaYyBjhI=
325-
github.com/ooni/go-libtor v1.1.8 h1:Wo3V3DVTxl5vZdxtQakqYP+DAHx7pPtAFSl1bnAa08w=
326-
github.com/ooni/go-libtor v1.1.8/go.mod h1:q1YyLwRD9GeMyeerVvwc0vJ2YgwDLTp2bdVcrh/JXyI=
327324
github.com/ooni/netem v0.0.0-20230920215742-15f3ffec0107 h1:PktaCPQ1NYZOaK+J8pQGYiPCYFkGR5H3ZURg9zPkQsI=
328325
github.com/ooni/netem v0.0.0-20230920215742-15f3ffec0107/go.mod h1:5X3Lk4+cnrwrQiYgRlCWXgV33IMDgLaO5s1x0DD/fO0=
329326
github.com/ooni/oocrypto v0.5.5 h1:x0wIgtBfghVu8Ok0tR/xVyfHlo646hN1LB/5bzuXcIg=
@@ -550,7 +547,6 @@ go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM=
550547
golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
551548
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
552549
golang.org/x/crypto v0.0.0-20190325154230-a5d413f7728c/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
553-
golang.org/x/crypto v0.0.0-20190404164418-38d8ce5564a5/go.mod h1:WFFai1msRO1wXaEeE5yQxYXgSfI8pQAWXbQop6sCtWE=
554550
golang.org/x/crypto v0.0.0-20190411191339-88737f569e3a/go.mod h1:WFFai1msRO1wXaEeE5yQxYXgSfI8pQAWXbQop6sCtWE=
555551
golang.org/x/crypto v0.0.0-20190426145343-a29dc8fdc734/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
556552
golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=

internal/libtor/enabled.go

+5
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@ package libtor
1818
// #cgo android,amd64 CFLAGS: -I${SRCDIR}/android/amd64/include
1919
// #cgo android,amd64 LDFLAGS: -L${SRCDIR}/android/amd64/lib -ltor -levent -lssl -lcrypto -lz -lm
2020
//
21+
// #cgo ios,arm64 CFLAGS: -I${SRCDIR}/ios/arm64/include
22+
// #cgo ios,arm64 LDFLAGS: -L${SRCDIR}/ios/arm64/lib -ltor -levent -lssl -lcrypto -lz -lm
23+
// #cgo ios,amd64 CFLAGS: -I${SRCDIR}/ios/amd64/include
24+
// #cgo ios,amd64 LDFLAGS: -L${SRCDIR}/ios/amd64/lib -ltor -levent -lssl -lcrypto -lz -lm
25+
//
2126
// #include <limits.h>
2227
// #include <stdbool.h>
2328
// #include <stdlib.h>

internal/tunnel/tordesktop.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
//go:build !android && !ios && !ooni_libtor
1+
//go:build !ooni_libtor
22

33
package tunnel
44

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

1212
import (

internal/tunnel/torembed.go

+4-5
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
1-
//go:build ooni_libtor && android
1+
//go:build ooni_libtor
22

33
package tunnel
44

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

1413
import (

internal/tunnel/tormobile.go

-35
This file was deleted.

0 commit comments

Comments
 (0)