Replace all Paths
This commit is contained in:
parent
58e2c82c9c
commit
4bf58a3c21
|
@ -30,7 +30,7 @@ import (
|
||||||
"net/http"
|
"net/http"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/cretz/bine/tor"
|
"git.openprivacy.ca/openprivacy/bine/tor"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
@ -67,9 +67,9 @@ func main() {
|
||||||
```
|
```
|
||||||
|
|
||||||
If in `main.go` it can simply be run with `go run main.go`. Of course this uses a separate `tor` process. To embed Tor
|
If in `main.go` it can simply be run with `go run main.go`. Of course this uses a separate `tor` process. To embed Tor
|
||||||
statically in the binary, follow the [embedded package docs](https://godoc.org/github.com/cretz/bine/process/embedded)
|
statically in the binary, follow the [embedded package docs](https://godoc.org/git.openprivacy.ca/openprivacy/bine/process/embedded)
|
||||||
which will require [building Tor statically](https://github.com/cretz/tor-static). Then with
|
which will require [building Tor statically](https://github.com/cretz/tor-static). Then with
|
||||||
`github.com/cretz/bine/process/embedded` imported, change the start line above to:
|
`git.openprivacy.ca/openprivacy/bine/process/embedded` imported, change the start line above to:
|
||||||
|
|
||||||
```go
|
```go
|
||||||
t, err := tor.Start(nil, &tor.StartConf{ProcessCreator: embedded.NewCreator()})
|
t, err := tor.Start(nil, &tor.StartConf{ProcessCreator: embedded.NewCreator()})
|
||||||
|
|
|
@ -3,7 +3,7 @@ package control
|
||||||
import (
|
import (
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/cretz/bine/torutil"
|
"git.openprivacy.ca/openprivacy/bine/torutil"
|
||||||
)
|
)
|
||||||
|
|
||||||
// SetConf invokes SETCONF.
|
// SetConf invokes SETCONF.
|
||||||
|
|
|
@ -7,7 +7,7 @@ import (
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/cretz/bine/torutil"
|
"git.openprivacy.ca/openprivacy/bine/torutil"
|
||||||
)
|
)
|
||||||
|
|
||||||
// EventCode represents an asynchronous event code (ref control spec 4.1).
|
// EventCode represents an asynchronous event code (ref control spec 4.1).
|
||||||
|
|
|
@ -3,7 +3,7 @@ package control
|
||||||
import (
|
import (
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/cretz/bine/torutil"
|
"git.openprivacy.ca/openprivacy/bine/torutil"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Signal invokes SIGNAL.
|
// Signal invokes SIGNAL.
|
||||||
|
|
|
@ -8,8 +8,8 @@ import (
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/cretz/bine/torutil"
|
"git.openprivacy.ca/openprivacy/bine/torutil"
|
||||||
"github.com/cretz/bine/torutil/ed25519"
|
"git.openprivacy.ca/openprivacy/bine/torutil/ed25519"
|
||||||
)
|
)
|
||||||
|
|
||||||
// KeyType is a key type for Key in AddOnion.
|
// KeyType is a key type for Key in AddOnion.
|
||||||
|
|
|
@ -3,7 +3,7 @@ package control
|
||||||
import (
|
import (
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/cretz/bine/torutil"
|
"git.openprivacy.ca/openprivacy/bine/torutil"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ProtocolInfo is the protocol info result of Conn.ProtocolInfo.
|
// ProtocolInfo is the protocol info result of Conn.ProtocolInfo.
|
||||||
|
|
|
@ -10,8 +10,8 @@ import (
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/cretz/bine/process/embedded"
|
"git.openprivacy.ca/openprivacy/bine/process/embedded"
|
||||||
"github.com/cretz/bine/tor"
|
"git.openprivacy.ca/openprivacy/bine/tor"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
|
|
@ -5,7 +5,7 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"log"
|
"log"
|
||||||
|
|
||||||
"github.com/cretz/bine/process/embedded"
|
"git.openprivacy.ca/openprivacy/bine/process/embedded"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
|
|
@ -14,8 +14,8 @@ import (
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/cretz/bine/tor"
|
"git.openprivacy.ca/openprivacy/bine/tor"
|
||||||
"github.com/cretz/bine/torutil"
|
"git.openprivacy.ca/openprivacy/bine/torutil"
|
||||||
)
|
)
|
||||||
|
|
||||||
var verbose bool
|
var verbose bool
|
||||||
|
|
|
@ -9,7 +9,7 @@ import (
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/cretz/bine/tor"
|
"git.openprivacy.ca/openprivacy/bine/tor"
|
||||||
"golang.org/x/net/html"
|
"golang.org/x/net/html"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,7 @@ import (
|
||||||
"net/http"
|
"net/http"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/cretz/bine/tor"
|
"git.openprivacy.ca/openprivacy/bine/tor"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
|
1
go.mod
1
go.mod
|
@ -3,7 +3,6 @@ module git.openprivacy.ca/openprivacy/bine
|
||||||
go 1.14
|
go 1.14
|
||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/cretz/bine v0.1.0
|
|
||||||
github.com/stretchr/testify v1.6.1
|
github.com/stretchr/testify v1.6.1
|
||||||
golang.org/x/crypto v0.0.0-20201012173705-84dcc777aaee
|
golang.org/x/crypto v0.0.0-20201012173705-84dcc777aaee
|
||||||
golang.org/x/net v0.0.0-20201010224723-4f7140c49acb
|
golang.org/x/net v0.0.0-20201010224723-4f7140c49acb
|
||||||
|
|
2
go.sum
2
go.sum
|
@ -1,5 +1,3 @@
|
||||||
github.com/cretz/bine v0.1.0 h1:1/fvhLE+fk0bPzjdO5Ci+0ComYxEMuB1JhM4X5skT3g=
|
|
||||||
github.com/cretz/bine v0.1.0/go.mod h1:6PF6fWAvYtwjRGkAuDEJeWNOv3a2hUouSP/yRYXmvHw=
|
|
||||||
github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8=
|
github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8=
|
||||||
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||||
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
||||||
|
|
|
@ -21,9 +21,9 @@
|
||||||
package embedded
|
package embedded
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/cretz/bine/process"
|
"git.openprivacy.ca/openprivacy/bine/process"
|
||||||
|
|
||||||
tor035 "github.com/cretz/bine/process/embedded/tor-0.3.5"
|
tor035 "git.openprivacy.ca/openprivacy/bine/process/embedded/tor-0.3.5"
|
||||||
)
|
)
|
||||||
|
|
||||||
// NewCreator creates a process.Creator for statically-linked Tor embedded in
|
// NewCreator creates a process.Creator for statically-linked Tor embedded in
|
||||||
|
|
|
@ -5,7 +5,7 @@ import (
|
||||||
"log"
|
"log"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
tor033 "github.com/cretz/bine/process/embedded/tor-0.3.3"
|
tor033 "git.openprivacy.ca/openprivacy/bine/process/embedded/tor-0.3.3"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Simply calls Tor will the same parameters
|
// Simply calls Tor will the same parameters
|
||||||
|
|
|
@ -8,7 +8,7 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"net"
|
"net"
|
||||||
|
|
||||||
"github.com/cretz/bine/process"
|
"git.openprivacy.ca/openprivacy/bine/process"
|
||||||
)
|
)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -7,8 +7,8 @@ import (
|
||||||
"net/textproto"
|
"net/textproto"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/cretz/bine/control"
|
"git.openprivacy.ca/openprivacy/bine/control"
|
||||||
tor035 "github.com/cretz/bine/process/embedded/tor-0.3.5"
|
tor035 "git.openprivacy.ca/openprivacy/bine/process/embedded/tor-0.3.5"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Simply calls Tor will the same parameters, unless "embedconn" is the arg
|
// Simply calls Tor will the same parameters, unless "embedconn" is the arg
|
||||||
|
|
|
@ -9,7 +9,7 @@ import (
|
||||||
"net"
|
"net"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/cretz/bine/process"
|
"git.openprivacy.ca/openprivacy/bine/process"
|
||||||
)
|
)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -16,7 +16,7 @@ import (
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/cretz/bine/torutil"
|
"git.openprivacy.ca/openprivacy/bine/torutil"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Process is the interface implemented by Tor processes.
|
// Process is the interface implemented by Tor processes.
|
||||||
|
|
|
@ -7,7 +7,7 @@ import (
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/cretz/bine/tor"
|
"git.openprivacy.ca/openprivacy/bine/tor"
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@ package tests
|
||||||
import (
|
import (
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/cretz/bine/tor"
|
"git.openprivacy.ca/openprivacy/bine/tor"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestAuthenticateNull(t *testing.T) {
|
func TestAuthenticateNull(t *testing.T) {
|
||||||
|
|
|
@ -4,7 +4,7 @@ import (
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/cretz/bine/control"
|
"git.openprivacy.ca/openprivacy/bine/control"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestGetSetAndResetConf(t *testing.T) {
|
func TestGetSetAndResetConf(t *testing.T) {
|
||||||
|
|
|
@ -6,7 +6,7 @@ import (
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/cretz/bine/control"
|
"git.openprivacy.ca/openprivacy/bine/control"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestHSFetch(t *testing.T) {
|
func TestHSFetch(t *testing.T) {
|
||||||
|
|
|
@ -8,7 +8,7 @@ import (
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/cretz/bine/tor"
|
"git.openprivacy.ca/openprivacy/bine/tor"
|
||||||
"golang.org/x/net/context/ctxhttp"
|
"golang.org/x/net/context/ctxhttp"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -3,8 +3,8 @@ package tests
|
||||||
import (
|
import (
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/cretz/bine/tor"
|
"git.openprivacy.ca/openprivacy/bine/tor"
|
||||||
"github.com/cretz/bine/torutil/geoipembed"
|
"git.openprivacy.ca/openprivacy/bine/torutil/geoipembed"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestEmbeddedGeoIPFile(t *testing.T) {
|
func TestEmbeddedGeoIPFile(t *testing.T) {
|
||||||
|
|
|
@ -7,7 +7,7 @@ import (
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/cretz/bine/tor"
|
"git.openprivacy.ca/openprivacy/bine/tor"
|
||||||
"golang.org/x/net/proxy"
|
"golang.org/x/net/proxy"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -6,8 +6,8 @@ import (
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/cretz/bine/tor"
|
"git.openprivacy.ca/openprivacy/bine/tor"
|
||||||
"github.com/cretz/bine/torutil"
|
"git.openprivacy.ca/openprivacy/bine/torutil"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestListenSimpleHTTPV2(t *testing.T) {
|
func TestListenSimpleHTTPV2(t *testing.T) {
|
||||||
|
|
|
@ -21,7 +21,7 @@ type OnionService struct {
|
||||||
// Key is the private key for this service. It is either the set key, the
|
// Key is the private key for this service. It is either the set key, the
|
||||||
// generated key, or nil if asked to discard the key. If present, it is
|
// generated key, or nil if asked to discard the key. If present, it is
|
||||||
// *crypto/rsa.PrivateKey (1024 bit) when Version3 is false or
|
// *crypto/rsa.PrivateKey (1024 bit) when Version3 is false or
|
||||||
// github.com/cretz/bine/torutil/ed25519.KeyPair when Version3 is true.
|
// git.openprivacy.ca/openprivacy/bine/torutil/ed25519.KeyPair when Version3 is true.
|
||||||
Key crypto.PrivateKey
|
Key crypto.PrivateKey
|
||||||
|
|
||||||
// Version3 says whether or not this service is a V3 service.
|
// Version3 says whether or not this service is a V3 service.
|
||||||
|
@ -66,9 +66,9 @@ type ListenConf struct {
|
||||||
// Key is the private key to use. If not present, a key is generated based
|
// Key is the private key to use. If not present, a key is generated based
|
||||||
// on whether Version3 is true or false. If present, it must be a
|
// on whether Version3 is true or false. If present, it must be a
|
||||||
// *crypto/rsa.PrivateKey (1024 bit), a
|
// *crypto/rsa.PrivateKey (1024 bit), a
|
||||||
// github.com/cretz/bine/torutil/ed25519.KeyPair, a
|
// git.openprivacy.ca/openprivacy/bine/torutil/ed25519.KeyPair, a
|
||||||
// golang.org/x/crypto/ed25519.PrivateKey, or a
|
// golang.org/x/crypto/ed25519.PrivateKey, or a
|
||||||
// github.com/cretz/bine/control.Key.
|
// git.openprivacy.ca/openprivacy/bine/control.Key.
|
||||||
Key crypto.PrivateKey
|
Key crypto.PrivateKey
|
||||||
|
|
||||||
// Version3 determines whether, when Key is nil, a version 2 or version 3
|
// Version3 determines whether, when Key is nil, a version 2 or version 3
|
||||||
|
|
|
@ -12,7 +12,7 @@ import (
|
||||||
"errors"
|
"errors"
|
||||||
"io"
|
"io"
|
||||||
|
|
||||||
"github.com/cretz/bine/torutil/ed25519/internal/edwards25519"
|
"git.openprivacy.ca/openprivacy/bine/torutil/ed25519/internal/edwards25519"
|
||||||
"golang.org/x/crypto/ed25519"
|
"golang.org/x/crypto/ed25519"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,7 @@ import (
|
||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/cretz/bine/torutil/ed25519/internal/edwards25519"
|
"git.openprivacy.ca/openprivacy/bine/torutil/ed25519/internal/edwards25519"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Taken from https://github.com/golang/crypto/blob/1a580b3eff7814fc9b40602fd35256c63b50f491/ed25519/ed25519_test.go
|
// Taken from https://github.com/golang/crypto/blob/1a580b3eff7814fc9b40602fd35256c63b50f491/ed25519/ed25519_test.go
|
||||||
|
|
|
@ -9,7 +9,7 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/cretz/bine/torutil/ed25519"
|
"git.openprivacy.ca/openprivacy/bine/torutil/ed25519"
|
||||||
"golang.org/x/crypto/sha3"
|
"golang.org/x/crypto/sha3"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -17,7 +17,7 @@ var serviceIDEncoding = base32.StdEncoding.WithPadding(base32.NoPadding)
|
||||||
|
|
||||||
// OnionServiceIDFromPrivateKey generates the onion service ID from the given
|
// OnionServiceIDFromPrivateKey generates the onion service ID from the given
|
||||||
// private key. This panics if the private key is not a 1024-bit
|
// private key. This panics if the private key is not a 1024-bit
|
||||||
// crypto/*rsa.PrivateKey or github.com/cretz/bine/torutil/ed25519.KeyPair.
|
// crypto/*rsa.PrivateKey or git.openprivacy.ca/openprivacy/bine/torutil/ed25519.KeyPair.
|
||||||
func OnionServiceIDFromPrivateKey(key crypto.PrivateKey) string {
|
func OnionServiceIDFromPrivateKey(key crypto.PrivateKey) string {
|
||||||
switch k := key.(type) {
|
switch k := key.(type) {
|
||||||
case *rsa.PrivateKey:
|
case *rsa.PrivateKey:
|
||||||
|
@ -30,7 +30,7 @@ func OnionServiceIDFromPrivateKey(key crypto.PrivateKey) string {
|
||||||
|
|
||||||
// OnionServiceIDFromPublicKey generates the onion service ID from the given
|
// OnionServiceIDFromPublicKey generates the onion service ID from the given
|
||||||
// public key. This panics if the public key is not a 1024-bit
|
// public key. This panics if the public key is not a 1024-bit
|
||||||
// crypto/*rsa.PublicKey or github.com/cretz/bine/torutil/ed25519.PublicKey.
|
// crypto/*rsa.PublicKey or git.openprivacy.ca/openprivacy/bine/torutil/ed25519.PublicKey.
|
||||||
func OnionServiceIDFromPublicKey(key crypto.PublicKey) string {
|
func OnionServiceIDFromPublicKey(key crypto.PublicKey) string {
|
||||||
switch k := key.(type) {
|
switch k := key.(type) {
|
||||||
case *rsa.PublicKey:
|
case *rsa.PublicKey:
|
||||||
|
|
|
@ -7,7 +7,7 @@ import (
|
||||||
"math/big"
|
"math/big"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/cretz/bine/torutil/ed25519"
|
"git.openprivacy.ca/openprivacy/bine/torutil/ed25519"
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue