From 628043b228daf50d0c6774cdcd4ea7e2b1fd42dd Mon Sep 17 00:00:00 2001 From: Zack Scholl Date: Fri, 16 Apr 2021 08:13:43 -0700 Subject: [PATCH 01/13] fix: do not use part of secret as room name --- src/croc/croc.go | 8 ++++---- src/utils/utils.go | 17 ++++++++++++++++- src/utils/utils_test.go | 1 + 3 files changed, 21 insertions(+), 5 deletions(-) diff --git a/src/croc/croc.go b/src/croc/croc.go index 88013923..36e5d56e 100644 --- a/src/croc/croc.go +++ b/src/croc/croc.go @@ -157,7 +157,7 @@ func New(ops Options) (c *Client, err error) { Debug(c.Options.Debug) log.Debugf("options: %+v", c.Options) - if len(c.Options.SharedSecret) < 4 { + if len(c.Options.SharedSecret) < 6 { err = fmt.Errorf("code is too short") return } @@ -166,9 +166,9 @@ func New(ops Options) (c *Client, err error) { // initialize pake if c.Options.IsSender { - c.Pake, err = pake.Init([]byte(c.Options.SharedSecret), 1, siec.SIEC255(), 1*time.Microsecond) + c.Pake, err = pake.Init([]byte(c.Options.SharedSecret[5:]), 1, siec.SIEC255(), 1*time.Microsecond) } else { - c.Pake, err = pake.Init([]byte(c.Options.SharedSecret), 0, siec.SIEC255(), 1*time.Microsecond) + c.Pake, err = pake.Init([]byte(c.Options.SharedSecret[5:]), 0, siec.SIEC255(), 1*time.Microsecond) } if err != nil { return @@ -872,7 +872,7 @@ func (c *Client) procesMessagePake(m message.Message) (err error) { c.conn[j+1], _, _, err = tcp.ConnectToTCPServer( server, c.Options.RelayPassword, - fmt.Sprintf("%s-%d", utils.SHA256(c.Options.SharedSecret)[:7], j), + fmt.Sprintf("%s-%d", utils.SHA256(c.Options.SharedSecret[:5])[:6], j), ) if err != nil { panic(err) diff --git a/src/utils/utils.go b/src/utils/utils.go index d54e4229..f7b2e243 100644 --- a/src/utils/utils.go +++ b/src/utils/utils.go @@ -12,6 +12,7 @@ import ( "io/ioutil" "log" "math" + "math/big" "net" "net/http" "os" @@ -140,13 +141,27 @@ func LocalIP() string { return localAddr.IP.String() } +func GenerateRandomPin() string { + s := "" + max := new(big.Int) + max.SetInt64(9) + for i := 0; i < 4; i++ { + v, err := rand.Int(rand.Reader, max) + if err != nil { + panic(err) + } + s += fmt.Sprintf("%d", v) + } + return s +} + // GetRandomName returns mnemoicoded random name func GetRandomName() string { var result []string bs := make([]byte, 4) rand.Read(bs) result = mnemonicode.EncodeWordList(result, bs) - return strings.Join(result, "-") + return GenerateRandomPin() + "-" + strings.Join(result, "-") } // ByteCountDecimal converts bytes to human readable byte string diff --git a/src/utils/utils_test.go b/src/utils/utils_test.go index 8e3acaa1..c1334770 100644 --- a/src/utils/utils_test.go +++ b/src/utils/utils_test.go @@ -184,6 +184,7 @@ func TestLocalIP(t *testing.T) { func TestGetRandomName(t *testing.T) { name := GetRandomName() + fmt.Println(name) assert.NotEmpty(t, name) } From 2131e9982602706640a31ce8de47a4ce474a5e11 Mon Sep 17 00:00:00 2001 From: Zack Scholl Date: Fri, 16 Apr 2021 09:20:13 -0700 Subject: [PATCH 02/13] use new pake --- go.mod | 3 +++ src/croc/croc.go | 7 +++---- src/tcp/tcp.go | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/go.mod b/go.mod index 64e824f3..e9cea1ab 100644 --- a/go.mod +++ b/go.mod @@ -2,6 +2,8 @@ module github.com/schollz/croc/v8 go 1.13 +replace github.com/schollz/pake3 => ../pake3 + require ( github.com/OneOfOne/xxhash v1.2.5 // indirect github.com/cespare/xxhash v1.1.0 @@ -14,6 +16,7 @@ require ( github.com/schollz/logger v1.2.0 github.com/schollz/mnemonicode v1.0.1 github.com/schollz/pake/v2 v2.0.7 + github.com/schollz/pake3 v0.0.0-00010101000000-000000000000 // indirect github.com/schollz/peerdiscovery v1.6.3 github.com/schollz/progressbar/v3 v3.7.6 github.com/spaolacci/murmur3 v1.1.0 // indirect diff --git a/src/croc/croc.go b/src/croc/croc.go index 36e5d56e..c39a95cc 100644 --- a/src/croc/croc.go +++ b/src/croc/croc.go @@ -20,10 +20,9 @@ import ( "github.com/denisbrodbeck/machineid" log "github.com/schollz/logger" - "github.com/schollz/pake/v2" + pake "github.com/schollz/pake3" "github.com/schollz/peerdiscovery" "github.com/schollz/progressbar/v3" - "github.com/tscholl2/siec" "github.com/schollz/croc/v8/src/comm" "github.com/schollz/croc/v8/src/compress" @@ -166,9 +165,9 @@ func New(ops Options) (c *Client, err error) { // initialize pake if c.Options.IsSender { - c.Pake, err = pake.Init([]byte(c.Options.SharedSecret[5:]), 1, siec.SIEC255(), 1*time.Microsecond) + c.Pake, err = pake.InitCurve([]byte(c.Options.SharedSecret[5:]), 1, "siec", 1*time.Microsecond) } else { - c.Pake, err = pake.Init([]byte(c.Options.SharedSecret[5:]), 0, siec.SIEC255(), 1*time.Microsecond) + c.Pake, err = pake.InitCurve([]byte(c.Options.SharedSecret[5:]), 0, "siec", 1*time.Microsecond) } if err != nil { return diff --git a/src/tcp/tcp.go b/src/tcp/tcp.go index 5fabf626..35f990a5 100644 --- a/src/tcp/tcp.go +++ b/src/tcp/tcp.go @@ -9,7 +9,7 @@ import ( "time" log "github.com/schollz/logger" - "github.com/schollz/pake/v2" + pake "github.com/schollz/pake3" "github.com/schollz/croc/v8/src/comm" "github.com/schollz/croc/v8/src/crypt" From 8250a39534daca9ab9de1074a2395d7a2278c174 Mon Sep 17 00:00:00 2001 From: Zack Scholl Date: Fri, 16 Apr 2021 09:48:11 -0700 Subject: [PATCH 03/13] fix: delete room if full and third-party tries to enter --- src/tcp/tcp.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tcp/tcp.go b/src/tcp/tcp.go index 35f990a5..8a40426d 100644 --- a/src/tcp/tcp.go +++ b/src/tcp/tcp.go @@ -266,6 +266,7 @@ func (s *server) clientCommunication(port string, c *comm.Comm) (room string, er return } if s.rooms.rooms[room].full { + defer s.deleteRoom(room) s.rooms.Unlock() bSend, err = crypt.Encrypt([]byte("room full"), strongKeyForEncryption) if err != nil { @@ -274,7 +275,6 @@ func (s *server) clientCommunication(port string, c *comm.Comm) (room string, er err = c.Send(bSend) if err != nil { log.Error(err) - s.deleteRoom(room) return } return From b0693751c13de87198a9ad3febf90c4168e9d3d6 Mon Sep 17 00:00:00 2001 From: Zack Scholl Date: Fri, 16 Apr 2021 14:01:48 -0700 Subject: [PATCH 04/13] fix --- go.mod | 2 +- src/croc/croc.go | 110 ++++++++++++++++++++++------------------------- src/tcp/tcp.go | 16 +------ 3 files changed, 54 insertions(+), 74 deletions(-) diff --git a/go.mod b/go.mod index e9cea1ab..52639324 100644 --- a/go.mod +++ b/go.mod @@ -16,7 +16,7 @@ require ( github.com/schollz/logger v1.2.0 github.com/schollz/mnemonicode v1.0.1 github.com/schollz/pake/v2 v2.0.7 - github.com/schollz/pake3 v0.0.0-00010101000000-000000000000 // indirect + github.com/schollz/pake3 v0.0.0-00010101000000-000000000000 github.com/schollz/peerdiscovery v1.6.3 github.com/schollz/progressbar/v3 v3.7.6 github.com/spaolacci/murmur3 v1.1.0 // indirect diff --git a/src/croc/croc.go b/src/croc/croc.go index c39a95cc..fb637174 100644 --- a/src/croc/croc.go +++ b/src/croc/croc.go @@ -165,9 +165,9 @@ func New(ops Options) (c *Client, err error) { // initialize pake if c.Options.IsSender { - c.Pake, err = pake.InitCurve([]byte(c.Options.SharedSecret[5:]), 1, "siec", 1*time.Microsecond) + c.Pake, err = pake.InitCurve([]byte(c.Options.SharedSecret[5:]), 1, "siec") } else { - c.Pake, err = pake.InitCurve([]byte(c.Options.SharedSecret[5:]), 0, "siec", 1*time.Microsecond) + c.Pake, err = pake.InitCurve([]byte(c.Options.SharedSecret[5:]), 0, "siec") } if err != nil { return @@ -816,80 +816,72 @@ func (c *Client) processMessageFileInfo(m message.Message) (done bool, err error func (c *Client) procesMessagePake(m message.Message) (err error) { log.Debug("received pake payload") - // if // c.spinner.Suffix != " performing PAKE..." { - // // c.spinner.Stop() - // // c.spinner.Suffix = " performing PAKE..." - // // c.spinner.Start() - // } - notVerified := !c.Pake.IsVerified() + err = c.Pake.Update(m.Bytes) if err != nil { return } - if (notVerified && c.Pake.IsVerified() && !c.Options.IsSender) || !c.Pake.IsVerified() { + if c.Options.IsSender { err = message.Send(c.conn[0], c.Key, message.Message{ Type: "pake", Bytes: c.Pake.Bytes(), }) - } - if c.Pake.IsVerified() { - if c.Options.IsSender { - log.Debug("generating salt") - salt := make([]byte, 8) - if _, rerr := rand.Read(salt); err != nil { - log.Errorf("can't generate random numbers: %v", rerr) - return - } - err = message.Send(c.conn[0], c.Key, message.Message{ - Type: "salt", - Bytes: salt, - }) - if err != nil { - return - } + } else { + log.Debug("generating salt") + salt := make([]byte, 8) + if _, rerr := rand.Read(salt); err != nil { + log.Errorf("can't generate random numbers: %v", rerr) + return } + err = message.Send(c.conn[0], c.Key, message.Message{ + Type: "salt", + Bytes: salt, + }) + if err != nil { + return + } + } - // connects to the other ports of the server for transfer - var wg sync.WaitGroup - wg.Add(len(c.Options.RelayPorts)) - for i := 0; i < len(c.Options.RelayPorts); i++ { - log.Debugf("port: [%s]", c.Options.RelayPorts[i]) - go func(j int) { - defer wg.Done() - var host string - if c.Options.RelayAddress == "localhost" { - host = c.Options.RelayAddress - } else { - host, _, err = net.SplitHostPort(c.Options.RelayAddress) - if err != nil { - log.Errorf("bad relay address %s", c.Options.RelayAddress) - return - } - } - server := net.JoinHostPort(host, c.Options.RelayPorts[j]) - log.Debugf("connecting to %s", server) - c.conn[j+1], _, _, err = tcp.ConnectToTCPServer( - server, - c.Options.RelayPassword, - fmt.Sprintf("%s-%d", utils.SHA256(c.Options.SharedSecret[:5])[:6], j), - ) + // connects to the other ports of the server for transfer + var wg sync.WaitGroup + wg.Add(len(c.Options.RelayPorts)) + for i := 0; i < len(c.Options.RelayPorts); i++ { + log.Debugf("port: [%s]", c.Options.RelayPorts[i]) + go func(j int) { + defer wg.Done() + var host string + if c.Options.RelayAddress == "localhost" { + host = c.Options.RelayAddress + } else { + host, _, err = net.SplitHostPort(c.Options.RelayAddress) if err != nil { - panic(err) + log.Errorf("bad relay address %s", c.Options.RelayAddress) + return } - log.Debugf("connected to %s", server) - if !c.Options.IsSender { - go c.receiveData(j) - } - }(i) - } - wg.Wait() + } + server := net.JoinHostPort(host, c.Options.RelayPorts[j]) + log.Debugf("connecting to %s", server) + c.conn[j+1], _, _, err = tcp.ConnectToTCPServer( + server, + c.Options.RelayPassword, + fmt.Sprintf("%s-%d", utils.SHA256(c.Options.SharedSecret[:5])[:6], j), + ) + if err != nil { + panic(err) + } + log.Debugf("connected to %s", server) + if !c.Options.IsSender { + go c.receiveData(j) + } + }(i) } + wg.Wait() return } func (c *Client) processMessageSalt(m message.Message) (done bool, err error) { log.Debug("received salt") - if !c.Options.IsSender { + if c.Options.IsSender { log.Debug("sending salt back") err = message.Send(c.conn[0], c.Key, message.Message{ Type: "salt", @@ -899,7 +891,7 @@ func (c *Client) processMessageSalt(m message.Message) (done bool, err error) { return true, err } } - log.Debugf("session key is verified, generating encryption with salt: %x", m.Bytes) + log.Debugf("generating encryption with salt: %x", m.Bytes) key, err := c.Pake.SessionKey() if err != nil { return true, err diff --git a/src/tcp/tcp.go b/src/tcp/tcp.go index 8a40426d..cd0fc593 100644 --- a/src/tcp/tcp.go +++ b/src/tcp/tcp.go @@ -152,7 +152,7 @@ var weakKey = []byte{1, 2, 3} func (s *server) clientCommunication(port string, c *comm.Comm) (room string, err error) { // establish secure password with PAKE for communication with relay - B, err := pake.InitCurve(weakKey, 1, "siec", 1*time.Microsecond) + B, err := pake.InitCurve(weakKey, 1, "siec") if err != nil { return } @@ -173,14 +173,6 @@ func (s *server) clientCommunication(port string, c *comm.Comm) (room string, er if err != nil { return } - Abytes, err = c.Receive() - if err != nil { - return - } - err = B.Update(Abytes) - if err != nil { - return - } strongKey, err := B.SessionKey() if err != nil { return @@ -425,7 +417,7 @@ func ConnectToTCPServer(address, password, room string, timelimit ...time.Durati } // get PAKE connection with server to establish strong key to transfer info - A, err := pake.InitCurve(weakKey, 0, "siec", 1*time.Microsecond) + A, err := pake.InitCurve(weakKey, 0, "siec") if err != nil { return } @@ -441,10 +433,6 @@ func ConnectToTCPServer(address, password, room string, timelimit ...time.Durati if err != nil { return } - err = c.Send(A.Bytes()) - if err != nil { - return - } strongKey, err := A.SessionKey() if err != nil { return From 6be4080f0569b53404c9245fad78a9940e58b9f0 Mon Sep 17 00:00:00 2001 From: Zack Scholl Date: Fri, 16 Apr 2021 14:25:57 -0700 Subject: [PATCH 05/13] remove hash exchange --- src/croc/croc.go | 61 +++++++++++++++--------------------------- src/message/message.go | 1 + 2 files changed, 22 insertions(+), 40 deletions(-) diff --git a/src/croc/croc.go b/src/croc/croc.go index fb637174..b935d88f 100644 --- a/src/croc/croc.go +++ b/src/croc/croc.go @@ -814,33 +814,40 @@ func (c *Client) processMessageFileInfo(m message.Message) (done bool, err error return } -func (c *Client) procesMessagePake(m message.Message) (err error) { +func (c *Client) processMessagePake(m message.Message) (err error) { log.Debug("received pake payload") err = c.Pake.Update(m.Bytes) if err != nil { return } + var salt []byte if c.Options.IsSender { - err = message.Send(c.conn[0], c.Key, message.Message{ - Type: "pake", - Bytes: c.Pake.Bytes(), - }) - } else { log.Debug("generating salt") - salt := make([]byte, 8) + salt = make([]byte, 8) if _, rerr := rand.Read(salt); err != nil { log.Errorf("can't generate random numbers: %v", rerr) return } + log.Debug("sender sending pake+salt") err = message.Send(c.conn[0], c.Key, message.Message{ - Type: "salt", - Bytes: salt, + Type: "pake", + Bytes: c.Pake.Bytes(), + Bytes2: salt, }) - if err != nil { - return - } + } else { + salt = m.Bytes2 } + // generate key + key, err := c.Pake.SessionKey() + if err != nil { + return err + } + c.Key, _, err = crypt.New(key, salt) + if err != nil { + return err + } + log.Debugf("generated key = %+x with salt %x", c.Key, salt) // connects to the other ports of the server for transfer var wg sync.WaitGroup @@ -876,32 +883,8 @@ func (c *Client) procesMessagePake(m message.Message) (err error) { }(i) } wg.Wait() - return -} -func (c *Client) processMessageSalt(m message.Message) (done bool, err error) { - log.Debug("received salt") - if c.Options.IsSender { - log.Debug("sending salt back") - err = message.Send(c.conn[0], c.Key, message.Message{ - Type: "salt", - Bytes: m.Bytes, - }) - if err != nil { - return true, err - } - } - log.Debugf("generating encryption with salt: %x", m.Bytes) - key, err := c.Pake.SessionKey() - if err != nil { - return true, err - } - c.Key, _, err = crypt.New(key, m.Bytes) - if err != nil { - return true, err - } - log.Debugf("key = %+x", c.Key) - if c.Options.IsSender { + if !c.Options.IsSender { log.Debug("sending external IP") err = message.Send(c.conn[0], c.Key, message.Message{ Type: "externalip", @@ -949,13 +932,11 @@ func (c *Client) processMessage(payload []byte) (done bool, err error) { c.SuccessfulTransfer = true return case "pake": - err = c.procesMessagePake(m) + err = c.processMessagePake(m) if err != nil { err = fmt.Errorf("pake not successful: %w", err) log.Debug(err) } - case "salt": - done, err = c.processMessageSalt(m) case "externalip": done, err = c.processExternalIP(m) case "error": diff --git a/src/message/message.go b/src/message/message.go index efa3dd1a..cbe5919f 100644 --- a/src/message/message.go +++ b/src/message/message.go @@ -14,6 +14,7 @@ type Message struct { Type string `json:"t,omitempty"` Message string `json:"m,omitempty"` Bytes []byte `json:"b,omitempty"` + Bytes2 []byte `json:"b2,omitempty"` Num int `json:"n,omitempty"` } From be5ceae8c7dba6d783fa28ed33376f8ed5182252 Mon Sep 17 00:00:00 2001 From: Zack Scholl Date: Fri, 16 Apr 2021 15:12:11 -0700 Subject: [PATCH 06/13] prompt to overwrite --- src/croc/croc.go | 21 +++++++++++++++++++-- src/message/message.go | 9 ++++++++- 2 files changed, 27 insertions(+), 3 deletions(-) diff --git a/src/croc/croc.go b/src/croc/croc.go index b935d88f..dfc378c8 100644 --- a/src/croc/croc.go +++ b/src/croc/croc.go @@ -108,6 +108,7 @@ type Client struct { numfinished int quit chan bool finishedNum int + numberOfTransferedFiles int } // Chunk contains information about the @@ -673,7 +674,13 @@ func (c *Client) Receive() (err error) { } log.Debug("exchanged header message") fmt.Fprintf(os.Stderr, "\rsecuring channel...") - return c.transfer(TransferOptions{}) + err = c.transfer(TransferOptions{}) + if err == nil { + if c.numberOfTransferedFiles == 0 { + fmt.Fprintf(os.Stderr,"\rNo files need transfering.") + } + } + return } func (c *Client) transfer(options TransferOptions) (err error) { @@ -897,7 +904,7 @@ func (c *Client) processMessagePake(m message.Message) (err error) { func (c *Client) processExternalIP(m message.Message) (done bool, err error) { log.Debugf("received external IP: %+v", m) - if !c.Options.IsSender { + if c.Options.IsSender { err = message.Send(c.conn[0], c.Key, message.Message{ Type: "externalip", Message: c.ExternalIP, @@ -1201,12 +1208,21 @@ func (c *Client) updateIfRecipientHasFileInfo() (err error) { err = c.createEmptyFileAndFinish(fileInfo, i) if err != nil { return + } else{ + c.numberOfTransferedFiles++ } continue } log.Debugf("%s %+x %+x %+v", fileInfo.Name, fileHash, fileInfo.Hash, errHash) if !bytes.Equal(fileHash, fileInfo.Hash) { log.Debugf("hashes are not equal %x != %x", fileHash, fileInfo.Hash) + if errHash== nil { + ans := utils.GetInput(fmt.Sprintf("\rOverwrite '%s'? (y/n) ",path.Join(fileInfo.FolderRemote, fileInfo.Name))) + if strings.TrimSpace(strings.ToLower(ans)) != "y" { + fmt.Fprintf(os.Stderr,"skipping '%s'",path.Join(fileInfo.FolderRemote, fileInfo.Name)) + continue + } + } } else { log.Debugf("hashes are equal %x == %x", fileHash, fileInfo.Hash) } @@ -1217,6 +1233,7 @@ func (c *Client) updateIfRecipientHasFileInfo() (err error) { if errHash != nil || !bytes.Equal(fileHash, fileInfo.Hash) { finished = false c.FilesToTransferCurrentNum = i + c.numberOfTransferedFiles++ break } // TODO: print out something about this file already existing diff --git a/src/message/message.go b/src/message/message.go index cbe5919f..099f98a3 100644 --- a/src/message/message.go +++ b/src/message/message.go @@ -44,7 +44,7 @@ func Encode(key []byte, m Message) (b []byte, err error) { log.Debugf("writing %s message (encrypted)", m.Type) b, err = crypt.Encrypt(b, key) } else { - log.Debugf("writing %s message", m.Type) + log.Debugf("writing %s message (unencrypted)", m.Type) } return } @@ -59,5 +59,12 @@ func Decode(key []byte, b []byte) (m Message, err error) { } b = compress.Decompress(b) err = json.Unmarshal(b, &m) + if err == nil { + if key != nil { + log.Debugf("read %s message (encrypted)", m.Type) + } else { + log.Debugf("read %s message (unencrypted)", m.Type) + } + } return } From babfd5f35fc4db80db39fbfc3dcb572f48e3a81a Mon Sep 17 00:00:00 2001 From: Zack Scholl Date: Fri, 16 Apr 2021 15:14:21 -0700 Subject: [PATCH 07/13] add option to overwrite automatically --- src/cli/cli.go | 7 +++++-- src/croc/croc.go | 3 ++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/cli/cli.go b/src/cli/cli.go index 022aab8e..b3fb14d8 100644 --- a/src/cli/cli.go +++ b/src/cli/cli.go @@ -86,6 +86,7 @@ func Run() (err error) { &cli.BoolFlag{Name: "ask", Usage: "make sure sender and recipient are prompted"}, &cli.BoolFlag{Name: "local", Usage: "force to use only local connections"}, &cli.BoolFlag{Name: "ignore-stdin", Usage: "ignore piped stdin"}, + &cli.BoolFlag{Name: "overwrite", Usage: "do not prompt to overwrite"}, &cli.StringFlag{Name: "ip", Value: "", Usage: "set sender ip if known e.g. 10.0.0.1:9009, [::1]:9009"}, &cli.StringFlag{Name: "relay", Value: models.DEFAULT_RELAY, Usage: "address of the relay", EnvVars: []string{"CROC_RELAY"}}, &cli.StringFlag{Name: "relay6", Value: models.DEFAULT_RELAY6, Usage: "ipv6 address of the relay", EnvVars: []string{"CROC_RELAY6"}}, @@ -130,7 +131,7 @@ func getConfigDir() (homedir string, err error) { log.Error(err) return } - + if envHomedir, isSet := os.LookupEnv("CROC_CONFIG_DIR"); isSet { homedir = envHomedir } else if xdgConfigHome, isSet := os.LookupEnv("XDG_CONFIG_HOME"); isSet { @@ -138,7 +139,7 @@ func getConfigDir() (homedir string, err error) { } else { homedir = path.Join(homedir, ".config", "croc") } - + if _, err = os.Stat(homedir); os.IsNotExist(err) { log.Debugf("creating home directory %s", homedir) err = os.MkdirAll(homedir, 0700) @@ -193,6 +194,7 @@ func send(c *cli.Context) (err error) { RelayPassword: determinePass(c), SendingText: c.String("text") != "", NoCompress: c.Bool("no-compress"), + Overwrite: c.Bool("overwrite"), } if crocOptions.RelayAddress != models.DEFAULT_RELAY { crocOptions.RelayAddress6 = "" @@ -388,6 +390,7 @@ func receive(c *cli.Context) (err error) { RelayPassword: determinePass(c), OnlyLocal: c.Bool("local"), IP: c.String("ip"), + Overwrite: c.Bool("overwrite"), } if crocOptions.RelayAddress != models.DEFAULT_RELAY { crocOptions.RelayAddress6 = "" diff --git a/src/croc/croc.go b/src/croc/croc.go index dfc378c8..bc4f3dd0 100644 --- a/src/croc/croc.go +++ b/src/croc/croc.go @@ -65,6 +65,7 @@ type Options struct { SendingText bool NoCompress bool IP string + Overwrite bool } // Client holds the state of the croc transfer @@ -1216,7 +1217,7 @@ func (c *Client) updateIfRecipientHasFileInfo() (err error) { log.Debugf("%s %+x %+x %+v", fileInfo.Name, fileHash, fileInfo.Hash, errHash) if !bytes.Equal(fileHash, fileInfo.Hash) { log.Debugf("hashes are not equal %x != %x", fileHash, fileInfo.Hash) - if errHash== nil { + if errHash== nil && !c.Options.Overwrite { ans := utils.GetInput(fmt.Sprintf("\rOverwrite '%s'? (y/n) ",path.Join(fileInfo.FolderRemote, fileInfo.Name))) if strings.TrimSpace(strings.ToLower(ans)) != "y" { fmt.Fprintf(os.Stderr,"skipping '%s'",path.Join(fileInfo.FolderRemote, fileInfo.Name)) From c02b4f12560ae13f19e3c290e7df8ded686f2518 Mon Sep 17 00:00:00 2001 From: Zack Scholl Date: Fri, 16 Apr 2021 17:15:51 -0700 Subject: [PATCH 08/13] fix: make sure that only pake messages are unencrypted --- src/croc/croc.go | 31 ++++++++++++++++++++----------- 1 file changed, 20 insertions(+), 11 deletions(-) diff --git a/src/croc/croc.go b/src/croc/croc.go index bc4f3dd0..5ac5012c 100644 --- a/src/croc/croc.go +++ b/src/croc/croc.go @@ -104,11 +104,11 @@ type Client struct { longestFilename int firstSend bool - mutex *sync.Mutex - fread *os.File - numfinished int - quit chan bool - finishedNum int + mutex *sync.Mutex + fread *os.File + numfinished int + quit chan bool + finishedNum int numberOfTransferedFiles int } @@ -678,7 +678,7 @@ func (c *Client) Receive() (err error) { err = c.transfer(TransferOptions{}) if err == nil { if c.numberOfTransferedFiles == 0 { - fmt.Fprintf(os.Stderr,"\rNo files need transfering.") + fmt.Fprintf(os.Stderr, "\rNo files need transfering.") } } return @@ -931,6 +931,15 @@ func (c *Client) processMessage(payload []byte) (done bool, err error) { return } + // only "pake" messages should be unencrypted + // if a non-"pake" message is received unencrypted something + // is weird + if m.Type != "pake" && c.Key == nil { + err = fmt.Errorf("unencrypted communication rejected") + done = true + return + } + switch m.Type { case "finished": err = message.Send(c.conn[0], c.Key, message.Message{ @@ -1209,7 +1218,7 @@ func (c *Client) updateIfRecipientHasFileInfo() (err error) { err = c.createEmptyFileAndFinish(fileInfo, i) if err != nil { return - } else{ + } else { c.numberOfTransferedFiles++ } continue @@ -1217,12 +1226,12 @@ func (c *Client) updateIfRecipientHasFileInfo() (err error) { log.Debugf("%s %+x %+x %+v", fileInfo.Name, fileHash, fileInfo.Hash, errHash) if !bytes.Equal(fileHash, fileInfo.Hash) { log.Debugf("hashes are not equal %x != %x", fileHash, fileInfo.Hash) - if errHash== nil && !c.Options.Overwrite { - ans := utils.GetInput(fmt.Sprintf("\rOverwrite '%s'? (y/n) ",path.Join(fileInfo.FolderRemote, fileInfo.Name))) + if errHash == nil && !c.Options.Overwrite { + ans := utils.GetInput(fmt.Sprintf("\rOverwrite '%s'? (y/n) ", path.Join(fileInfo.FolderRemote, fileInfo.Name))) if strings.TrimSpace(strings.ToLower(ans)) != "y" { - fmt.Fprintf(os.Stderr,"skipping '%s'",path.Join(fileInfo.FolderRemote, fileInfo.Name)) + fmt.Fprintf(os.Stderr, "skipping '%s'", path.Join(fileInfo.FolderRemote, fileInfo.Name)) continue - } + } } } else { log.Debugf("hashes are equal %x == %x", fileHash, fileInfo.Hash) From 7a997156edd798d908c320284f7d6ffe87259336 Mon Sep 17 00:00:00 2001 From: Zack Scholl Date: Fri, 16 Apr 2021 17:17:32 -0700 Subject: [PATCH 09/13] minor --- src/croc/croc.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/croc/croc.go b/src/croc/croc.go index 5ac5012c..697597d8 100644 --- a/src/croc/croc.go +++ b/src/croc/croc.go @@ -678,7 +678,7 @@ func (c *Client) Receive() (err error) { err = c.transfer(TransferOptions{}) if err == nil { if c.numberOfTransferedFiles == 0 { - fmt.Fprintf(os.Stderr, "\rNo files need transfering.") + fmt.Fprintf(os.Stderr, "\rNo files transferred.") } } return From cec39ba2ce8f6a91d8a4e2ff7f9d19cab63f5a20 Mon Sep 17 00:00:00 2001 From: Zack Scholl Date: Sat, 17 Apr 2021 09:01:58 -0700 Subject: [PATCH 10/13] allow changing curve --- README.md | 17 ++++++++++++++++ go.mod | 51 +++++++++++++++++++++++------------------------- src/cli/cli.go | 4 ++++ src/croc/croc.go | 37 ++++++++++++++++++++++++----------- 4 files changed, 71 insertions(+), 38 deletions(-) diff --git a/README.md b/README.md index 59cfbdb5..a4227efa 100644 --- a/README.md +++ b/README.md @@ -137,6 +137,15 @@ You can send with your own code phrase (must be more than 4 characters). croc send --code [code-phrase] [file(s)-or-folder] ``` +### Allow overwriting without prompt + +By default, croc will prompt whether to overwrite a file. You can automatically overwrite files by using the `--overwrite` flag (recipient only). For example, receive a file to automatically overwrite: + +``` +croc --yes --overwrite +``` + + ### Use pipes - stdin and stdout You can pipe to `croc`: @@ -173,6 +182,14 @@ You can use a proxy as your connection to the relay by adding a proxy address wi croc --socks5 "127.0.0.1:9050" send SOMEFILE ``` +### Change encryption curve + +You can choose from several different elliptic curves to use for encryption by using the `--curve` flag. Only the recipient can choose the curve. For example, receive a file using the P-521 curve: + +``` +croc --curve p521 +``` + ### Self-host relay The relay is needed to staple the parallel incoming and outgoing connections. By default, `croc` uses a public relay but you can also run your own relay: diff --git a/go.mod b/go.mod index 52639324..2e024989 100644 --- a/go.mod +++ b/go.mod @@ -1,31 +1,28 @@ module github.com/schollz/croc/v8 - go 1.13 - replace github.com/schollz/pake3 => ../pake3 - require ( - github.com/OneOfOne/xxhash v1.2.5 // indirect - github.com/cespare/xxhash v1.1.0 - github.com/cpuguy83/go-md2man/v2 v2.0.0 // indirect - github.com/denisbrodbeck/machineid v1.0.1 - github.com/kalafut/imohash v1.0.0 - github.com/kr/pretty v0.1.0 // indirect - github.com/russross/blackfriday/v2 v2.1.0 // indirect - github.com/schollz/cli/v2 v2.2.1 - github.com/schollz/logger v1.2.0 - github.com/schollz/mnemonicode v1.0.1 - github.com/schollz/pake/v2 v2.0.7 - github.com/schollz/pake3 v0.0.0-00010101000000-000000000000 - github.com/schollz/peerdiscovery v1.6.3 - github.com/schollz/progressbar/v3 v3.7.6 - github.com/spaolacci/murmur3 v1.1.0 // indirect - github.com/stretchr/testify v1.6.1 - github.com/tscholl2/siec v0.0.0-20191122224205-8da93652b094 - golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2 - golang.org/x/net v0.0.0-20210326220855-61e056675ecf - golang.org/x/sys v0.0.0-20210326220804-49726bf1d181 // indirect - golang.org/x/term v0.0.0-20210317153231-de623e64d2a6 // indirect - golang.org/x/text v0.3.5 // indirect - gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 // indirect -) +github.com/OneOfOne/xxhash v1.2.5 // indirect +github.com/cespare/xxhash v1.1.0 +github.com/cpuguy83/go-md2man/v2 v2.0.0 // indirect +github.com/denisbrodbeck/machineid v1.0.1 +github.com/kalafut/imohash v1.0.0 +github.com/kr/pretty v0.1.0 // indirect +github.com/russross/blackfriday/v2 v2.1.0 // indirect +github.com/schollz/cli/v2 v2.2.1 +github.com/schollz/logger v1.2.0 +github.com/schollz/mnemonicode v1.0.1 +github.com/schollz/pake/v2 v2.0.7 +github.com/schollz/pake3 v0.0.0-00010101000000-000000000000 +github.com/schollz/peerdiscovery v1.6.3 +github.com/schollz/progressbar/v3 v3.7.6 +github.com/spaolacci/murmur3 v1.1.0 // indirect +github.com/stretchr/testify v1.6.1 +github.com/tscholl2/siec v0.0.0-20191122224205-8da93652b094 +golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2 +golang.org/x/net v0.0.0-20210326220855-61e056675ecf +golang.org/x/sys v0.0.0-20210326220804-49726bf1d181 // indirect +golang.org/x/term v0.0.0-20210317153231-de623e64d2a6 // indirect +golang.org/x/text v0.3.5 // indirect +gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 // indirect +) \ No newline at end of file diff --git a/src/cli/cli.go b/src/cli/cli.go index b3fb14d8..7978f761 100644 --- a/src/cli/cli.go +++ b/src/cli/cli.go @@ -20,6 +20,7 @@ import ( "github.com/schollz/croc/v8/src/tcp" "github.com/schollz/croc/v8/src/utils" log "github.com/schollz/logger" + pake "github.com/schollz/pake3" ) // Version specifies the version @@ -87,6 +88,7 @@ func Run() (err error) { &cli.BoolFlag{Name: "local", Usage: "force to use only local connections"}, &cli.BoolFlag{Name: "ignore-stdin", Usage: "ignore piped stdin"}, &cli.BoolFlag{Name: "overwrite", Usage: "do not prompt to overwrite"}, + &cli.StringFlag{Name: "curve", Value: "siec", Usage: "choose an encryption curve (" + strings.Join(pake.AvailableCurves(), ", ") + ")"}, &cli.StringFlag{Name: "ip", Value: "", Usage: "set sender ip if known e.g. 10.0.0.1:9009, [::1]:9009"}, &cli.StringFlag{Name: "relay", Value: models.DEFAULT_RELAY, Usage: "address of the relay", EnvVars: []string{"CROC_RELAY"}}, &cli.StringFlag{Name: "relay6", Value: models.DEFAULT_RELAY6, Usage: "ipv6 address of the relay", EnvVars: []string{"CROC_RELAY6"}}, @@ -195,6 +197,7 @@ func send(c *cli.Context) (err error) { SendingText: c.String("text") != "", NoCompress: c.Bool("no-compress"), Overwrite: c.Bool("overwrite"), + Curve: c.String("curve"), } if crocOptions.RelayAddress != models.DEFAULT_RELAY { crocOptions.RelayAddress6 = "" @@ -391,6 +394,7 @@ func receive(c *cli.Context) (err error) { OnlyLocal: c.Bool("local"), IP: c.String("ip"), Overwrite: c.Bool("overwrite"), + Curve: c.String("curve"), } if crocOptions.RelayAddress != models.DEFAULT_RELAY { crocOptions.RelayAddress6 = "" diff --git a/src/croc/croc.go b/src/croc/croc.go index 697597d8..fd078ce7 100644 --- a/src/croc/croc.go +++ b/src/croc/croc.go @@ -66,6 +66,7 @@ type Options struct { NoCompress bool IP string Overwrite bool + Curve string } // Client holds the state of the croc transfer @@ -165,11 +166,9 @@ func New(ops Options) (c *Client, err error) { c.conn = make([]*comm.Comm, 16) - // initialize pake - if c.Options.IsSender { - c.Pake, err = pake.InitCurve([]byte(c.Options.SharedSecret[5:]), 1, "siec") - } else { - c.Pake, err = pake.InitCurve([]byte(c.Options.SharedSecret[5:]), 0, "siec") + // initialize pake for recipient + if !c.Options.IsSender { + c.Pake, err = pake.InitCurve([]byte(c.Options.SharedSecret[5:]), 0, c.Options.Curve) } if err != nil { return @@ -694,8 +693,9 @@ func (c *Client) transfer(options TransferOptions) (err error) { log.Debug("ready") if !c.Options.IsSender && !c.Step1ChannelSecured { err = message.Send(c.conn[0], c.Key, message.Message{ - Type: "pake", - Bytes: c.Pake.Bytes(), + Type: "pake", + Bytes: c.Pake.Bytes(), + Bytes2: []byte(c.Options.Curve), }) if err != nil { return @@ -825,12 +825,23 @@ func (c *Client) processMessageFileInfo(m message.Message) (done bool, err error func (c *Client) processMessagePake(m message.Message) (err error) { log.Debug("received pake payload") - err = c.Pake.Update(m.Bytes) - if err != nil { - return - } var salt []byte if c.Options.IsSender { + // initialize curve based on the recipient's choice + log.Debugf("using curve %s", string(m.Bytes2)) + c.Pake, err = pake.InitCurve([]byte(c.Options.SharedSecret[5:]), 1, string(m.Bytes2)) + if err != nil { + log.Error(err) + return + } + + // update the pake + err = c.Pake.Update(m.Bytes) + if err != nil { + return + } + + // generate salt and send it back to recipient log.Debug("generating salt") salt = make([]byte, 8) if _, rerr := rand.Read(salt); err != nil { @@ -844,6 +855,10 @@ func (c *Client) processMessagePake(m message.Message) (err error) { Bytes2: salt, }) } else { + err = c.Pake.Update(m.Bytes) + if err != nil { + return + } salt = m.Bytes2 } // generate key From 3e56d4cdb9b41f7ecd95a031c8a7ff0c1e54b207 Mon Sep 17 00:00:00 2001 From: Zack Scholl Date: Sat, 17 Apr 2021 09:05:27 -0700 Subject: [PATCH 11/13] use magic bytes instead of checking max --- src/comm/comm.go | 22 +++++++++++++++------- src/comm/comm_test.go | 2 +- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/src/comm/comm.go b/src/comm/comm.go index daf0b1ee..c9d32c76 100644 --- a/src/comm/comm.go +++ b/src/comm/comm.go @@ -17,7 +17,7 @@ import ( var Socks5Proxy = "" -const MAXBYTES = 4000000 +var MAGIC_BYTES = []byte("croc") // Comm is some basic TCP communication type Comm struct { @@ -95,6 +95,7 @@ func (c *Comm) Write(b []byte) (n int, err error) { fmt.Println("binary.Write failed:", err) } tmpCopy := append(header.Bytes(), b...) + tmpCopy = append(MAGIC_BYTES, tmpCopy...) n, err = c.connection.Write(tmpCopy) if err != nil { err = fmt.Errorf("connection.Write failed: %w", err) @@ -115,13 +116,25 @@ func (c *Comm) Read() (buf []byte, numBytes int, bs []byte, err error) { // must clear the timeout setting defer c.connection.SetDeadline(time.Time{}) - // read until we get 4 bytes for the header + // read until we get 4 bytes for the magic header := make([]byte, 4) _, err = io.ReadFull(c.connection, header) if err != nil { log.Debugf("initial read error: %v", err) return } + if !bytes.Equal(header, MAGIC_BYTES) { + err = fmt.Errorf("initial bytes are not magic: %x", header) + return + } + + // read until we get 4 bytes for the header + header = make([]byte, 4) + _, err = io.ReadFull(c.connection, header) + if err != nil { + log.Debugf("initial read error: %v", err) + return + } var numBytesUint32 uint32 rbuf := bytes.NewReader(header) @@ -132,11 +145,6 @@ func (c *Comm) Read() (buf []byte, numBytes int, bs []byte, err error) { return } numBytes = int(numBytesUint32) - if numBytes > MAXBYTES { - err = fmt.Errorf("too many bytes: %d", numBytes) - log.Debug(err) - return - } // shorten the reading deadline in case getting weird data if err := c.connection.SetReadDeadline(time.Now().Add(10 * time.Second)); err != nil { diff --git a/src/comm/comm_test.go b/src/comm/comm_test.go index 90370750..e69ae73e 100644 --- a/src/comm/comm_test.go +++ b/src/comm/comm_test.go @@ -11,7 +11,7 @@ import ( ) func TestComm(t *testing.T) { - token := make([]byte, MAXBYTES) + token := make([]byte, 3000) if _, err := rand.Read(token); err != nil { t.Error(err) } From 9231b1a661f8f5a7868b76c08e1e68846b152c98 Mon Sep 17 00:00:00 2001 From: Zack Scholl Date: Sat, 17 Apr 2021 09:39:47 -0700 Subject: [PATCH 12/13] update utils benchmark --- src/utils/utils_test.go | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/utils/utils_test.go b/src/utils/utils_test.go index c1334770..e3e2bdf8 100644 --- a/src/utils/utils_test.go +++ b/src/utils/utils_test.go @@ -10,11 +10,14 @@ import ( "strings" "testing" + "github.com/schollz/croc/v8/src/models" "github.com/stretchr/testify/assert" ) +var bigFileSize = 75000000 + func bigFile() { - ioutil.WriteFile("bigfile.test", bytes.Repeat([]byte("z"), 75000000), 0666) + ioutil.WriteFile("bigfile.test", bytes.Repeat([]byte("z"), bigFileSize), 0666) } func BenchmarkMD5(b *testing.B) { @@ -47,6 +50,14 @@ func BenchmarkSha256(b *testing.B) { } } +func BenchmarkMissingChunks(b *testing.B) { + bigFile() + b.ResetTimer() + for i := 0; i < b.N; i++ { + MissingChunks("bigfile.test", int64(bigFileSize), models.TCP_BUFFER_SIZE/2) + } +} + func TestExists(t *testing.T) { bigFile() defer os.Remove("bigfile.test") From daf10395a308a1b41eb69ea2866411c9d8e65d7c Mon Sep 17 00:00:00 2001 From: Zack Scholl Date: Sat, 17 Apr 2021 09:42:11 -0700 Subject: [PATCH 13/13] update deps --- go.mod | 49 ++++++++++++++++++++++++------------------------ go.sum | 5 ++--- src/cli/cli.go | 2 +- src/croc/croc.go | 2 +- src/tcp/tcp.go | 2 +- 5 files changed, 29 insertions(+), 31 deletions(-) diff --git a/go.mod b/go.mod index 2e024989..61b23f11 100644 --- a/go.mod +++ b/go.mod @@ -1,28 +1,27 @@ module github.com/schollz/croc/v8 + go 1.13 -replace github.com/schollz/pake3 => ../pake3 + require ( -github.com/OneOfOne/xxhash v1.2.5 // indirect -github.com/cespare/xxhash v1.1.0 -github.com/cpuguy83/go-md2man/v2 v2.0.0 // indirect -github.com/denisbrodbeck/machineid v1.0.1 -github.com/kalafut/imohash v1.0.0 -github.com/kr/pretty v0.1.0 // indirect -github.com/russross/blackfriday/v2 v2.1.0 // indirect -github.com/schollz/cli/v2 v2.2.1 -github.com/schollz/logger v1.2.0 -github.com/schollz/mnemonicode v1.0.1 -github.com/schollz/pake/v2 v2.0.7 -github.com/schollz/pake3 v0.0.0-00010101000000-000000000000 -github.com/schollz/peerdiscovery v1.6.3 -github.com/schollz/progressbar/v3 v3.7.6 -github.com/spaolacci/murmur3 v1.1.0 // indirect -github.com/stretchr/testify v1.6.1 -github.com/tscholl2/siec v0.0.0-20191122224205-8da93652b094 -golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2 -golang.org/x/net v0.0.0-20210326220855-61e056675ecf -golang.org/x/sys v0.0.0-20210326220804-49726bf1d181 // indirect -golang.org/x/term v0.0.0-20210317153231-de623e64d2a6 // indirect -golang.org/x/text v0.3.5 // indirect -gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 // indirect -) \ No newline at end of file + github.com/OneOfOne/xxhash v1.2.5 // indirect + github.com/cespare/xxhash v1.1.0 + github.com/cpuguy83/go-md2man/v2 v2.0.0 // indirect + github.com/denisbrodbeck/machineid v1.0.1 + github.com/kalafut/imohash v1.0.0 + github.com/kr/pretty v0.1.0 // indirect + github.com/russross/blackfriday/v2 v2.1.0 // indirect + github.com/schollz/cli/v2 v2.2.1 + github.com/schollz/logger v1.2.0 + github.com/schollz/mnemonicode v1.0.1 + github.com/schollz/pake/v3 v3.0.0-20210417162517-73e32835a3d0 + github.com/schollz/peerdiscovery v1.6.3 + github.com/schollz/progressbar/v3 v3.7.6 + github.com/spaolacci/murmur3 v1.1.0 // indirect + github.com/stretchr/testify v1.6.1 + golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2 + golang.org/x/net v0.0.0-20210326220855-61e056675ecf + golang.org/x/sys v0.0.0-20210326220804-49726bf1d181 // indirect + golang.org/x/term v0.0.0-20210317153231-de623e64d2a6 // indirect + golang.org/x/text v0.3.5 // indirect + gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 // indirect +) diff --git a/go.sum b/go.sum index d3ce5e94..32f897a7 100644 --- a/go.sum +++ b/go.sum @@ -39,8 +39,8 @@ github.com/schollz/logger v1.2.0 h1:5WXfINRs3lEUTCZ7YXhj0uN+qukjizvITLm3Ca2m0Ho= github.com/schollz/logger v1.2.0/go.mod h1:P6F4/dGMGcx8wh+kG1zrNEd4vnNpEBY/mwEMd/vn6AM= github.com/schollz/mnemonicode v1.0.1 h1:LiH5hwADZwjwnfXsaD4xgnMyTAtaKHN+e5AyjRU6WSU= github.com/schollz/mnemonicode v1.0.1/go.mod h1:cl4UAOhUV0mkdjMj/QYaUZbZZdF8BnOqoz8rHMzwboY= -github.com/schollz/pake/v2 v2.0.7 h1:pMd7VRwEytDLFXP3vf5UksO6/zxcEoEhb4jaqb6NRR4= -github.com/schollz/pake/v2 v2.0.7/go.mod h1:9pvRBp3hcsPYRJre5t3dP6HFOkPG80bUqzDwB7PP3Ec= +github.com/schollz/pake/v3 v3.0.0-20210417162517-73e32835a3d0 h1:OdIvrbSi1RDKc9Olim4M+Sh0hms7ZU9kXNoXGG17UwA= +github.com/schollz/pake/v3 v3.0.0-20210417162517-73e32835a3d0/go.mod h1:U8udmizi/9pb5OqW+ieb4ebU5wGCqnLhXqYXSJRpeD4= github.com/schollz/peerdiscovery v1.6.3 h1:qoawrl3GBwf8ff3Itb0QkaUGDb2k40NwE24MEgFL4Gc= github.com/schollz/peerdiscovery v1.6.3/go.mod h1:xpt6HDA944jqSLzJMLreYtmhWeS2OW2XW4ZLmCezi00= github.com/schollz/progressbar/v3 v3.7.6 h1:akAvVpTy2IAcePWYndctoBaY9bLE3z4LE1Hn91BJ9g4= @@ -57,7 +57,6 @@ github.com/tscholl2/siec v0.0.0-20191122224205-8da93652b094 h1:tZWtuLE+LbUwT4OP1 github.com/tscholl2/siec v0.0.0-20191122224205-8da93652b094/go.mod h1:KL9+ubr1JZdaKjgAaHr+tCytEncXBa1pR6FjbTsOJnw= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20210220033148-5ea612d1eb83/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= -golang.org/x/crypto v0.0.0-20210314154223-e6e6c4f2bb5b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2 h1:It14KIkyBFYkHkwZ7k45minvA9aorojkyjGk9KJ5B/w= golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= diff --git a/src/cli/cli.go b/src/cli/cli.go index 7978f761..e80e006d 100644 --- a/src/cli/cli.go +++ b/src/cli/cli.go @@ -20,7 +20,7 @@ import ( "github.com/schollz/croc/v8/src/tcp" "github.com/schollz/croc/v8/src/utils" log "github.com/schollz/logger" - pake "github.com/schollz/pake3" + "github.com/schollz/pake/v3" ) // Version specifies the version diff --git a/src/croc/croc.go b/src/croc/croc.go index fd078ce7..f1a9abd2 100644 --- a/src/croc/croc.go +++ b/src/croc/croc.go @@ -20,7 +20,7 @@ import ( "github.com/denisbrodbeck/machineid" log "github.com/schollz/logger" - pake "github.com/schollz/pake3" + "github.com/schollz/pake/v3" "github.com/schollz/peerdiscovery" "github.com/schollz/progressbar/v3" diff --git a/src/tcp/tcp.go b/src/tcp/tcp.go index cd0fc593..2b9b610b 100644 --- a/src/tcp/tcp.go +++ b/src/tcp/tcp.go @@ -9,7 +9,7 @@ import ( "time" log "github.com/schollz/logger" - pake "github.com/schollz/pake3" + "github.com/schollz/pake/v3" "github.com/schollz/croc/v8/src/comm" "github.com/schollz/croc/v8/src/crypt"