From 2f943d4b9789420ea01a583dadc4bad507030cdd Mon Sep 17 00:00:00 2001 From: Sarah Jamie Lewis Date: Thu, 30 Sep 2021 16:03:30 -0700 Subject: [PATCH 1/2] Upgrade Cwtch to 11.2 --- go.mod | 2 +- go.sum | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 91a8c55..a3b5288 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module git.openprivacy.ca/cwtch.im/libcwtch-go go 1.15 require ( - cwtch.im/cwtch v0.11.1 + cwtch.im/cwtch v0.11.2 git.openprivacy.ca/openprivacy/connectivity v1.5.0 git.openprivacy.ca/openprivacy/log v1.0.3 golang.org/x/mobile v0.0.0-20210716004757-34ab1303b554 // indirect diff --git a/go.sum b/go.sum index 7e48626..b5a989d 100644 --- a/go.sum +++ b/go.sum @@ -2,6 +2,8 @@ cwtch.im/cwtch v0.11.0 h1:CwmbaMEbL0lOiPagfWxA7po2HSq49B1lcFjPB7UR8k4= cwtch.im/cwtch v0.11.0/go.mod h1:QpTkQK7MqNt0dQK9/pBk5VpkvFhy6xuoxJIn401B8fM= cwtch.im/cwtch v0.11.1 h1:9HHcGwij3WIt53ZuKQUSqQ4x29CnZJ7TufA+t+cat/M= cwtch.im/cwtch v0.11.1/go.mod h1:QpTkQK7MqNt0dQK9/pBk5VpkvFhy6xuoxJIn401B8fM= +cwtch.im/cwtch v0.11.2 h1:a38zZLSNsKJzLStBDOIoYKKIL56V9ueQvOZfnIEVc5I= +cwtch.im/cwtch v0.11.2/go.mod h1:QpTkQK7MqNt0dQK9/pBk5VpkvFhy6xuoxJIn401B8fM= filippo.io/edwards25519 v1.0.0-rc.1 h1:m0VOOB23frXZvAOK44usCgLWvtsxIoMCTBGJZlpmGfU= filippo.io/edwards25519 v1.0.0-rc.1/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5EwJns= git.openprivacy.ca/cwtch.im/tapir v0.4.9 h1:LXonlztwvI1F1++0IyomIcDH1/Bxzo+oN8YjGonNvjM= From 585f1eed46f3eba7d95573171787b9f67e7baf7b Mon Sep 17 00:00:00 2001 From: Sarah Jamie Lewis Date: Thu, 30 Sep 2021 16:04:54 -0700 Subject: [PATCH 2/2] Always use path/filepath --- go.sum | 4 ---- lib.go | 3 +-- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/go.sum b/go.sum index b5a989d..9e6a0a9 100644 --- a/go.sum +++ b/go.sum @@ -1,7 +1,3 @@ -cwtch.im/cwtch v0.11.0 h1:CwmbaMEbL0lOiPagfWxA7po2HSq49B1lcFjPB7UR8k4= -cwtch.im/cwtch v0.11.0/go.mod h1:QpTkQK7MqNt0dQK9/pBk5VpkvFhy6xuoxJIn401B8fM= -cwtch.im/cwtch v0.11.1 h1:9HHcGwij3WIt53ZuKQUSqQ4x29CnZJ7TufA+t+cat/M= -cwtch.im/cwtch v0.11.1/go.mod h1:QpTkQK7MqNt0dQK9/pBk5VpkvFhy6xuoxJIn401B8fM= cwtch.im/cwtch v0.11.2 h1:a38zZLSNsKJzLStBDOIoYKKIL56V9ueQvOZfnIEVc5I= cwtch.im/cwtch v0.11.2/go.mod h1:QpTkQK7MqNt0dQK9/pBk5VpkvFhy6xuoxJIn401B8fM= filippo.io/edwards25519 v1.0.0-rc.1 h1:m0VOOB23frXZvAOK44usCgLWvtsxIoMCTBGJZlpmGfU= diff --git a/lib.go b/lib.go index 3d4fc9d..437e1f0 100644 --- a/lib.go +++ b/lib.go @@ -31,7 +31,6 @@ import ( "encoding/base64" mrand "math/rand" "os" - "path" "path/filepath" "time" @@ -156,7 +155,7 @@ func _startCwtch(appDir string, torPath string) { } log.Infof("making directory %v", appDir) - os.MkdirAll(path.Join(appDir, "tor"), 0700) + os.MkdirAll(filepath.Join(appDir, "tor"), 0700) tor.NewTorrc().WithSocksPort(port).WithOnionTrafficOnly().WithControlPort(controlPort).WithHashedPassword(base64.StdEncoding.EncodeToString(key)).Build(filepath.Join(appDir, "tor", "torrc")) acn, err := tor.NewTorACNWithAuth(appDir, torPath, controlPort, tor.HashedPasswordAuthenticator{Password: base64.StdEncoding.EncodeToString(key)}) if err != nil {