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

V10 can't secure channel error #705

Closed
AndrewSkelton opened this issue May 23, 2024 · 15 comments · Fixed by #708
Closed

V10 can't secure channel error #705

AndrewSkelton opened this issue May 23, 2024 · 15 comments · Fixed by #708
Labels

Comments

@AndrewSkelton
Copy link

Describe the bug

Repeated instances of "cannot secure channel", but sender and receiver are on latest (v10). Ubuntu <-> Mac
The ubuntu version requires an export of a variable, which is used as the pass code on send commands (assuming this is intended behaviour). Mac version of send generated a random pass phrase (typical past behaviour).

To Reproduce

Steps to reproduce the behavior:

  1. Install v10 on both machines
  2. Send a file either way croc send Z.tar.gz
  3. Prompt to generate export secret export CROC_SECRET="xxx"
  4. On the other computer run croc xxx
  5. Run croc xxx on reciever machine
  6. securing channel...2024/05/23 15:33:24 could not secure channel

Expected behaviour

Croc to generate a random pass phrase without need for the CROC_SECRET variable to be set. File to send without secure channel issues

Version

croc version v10.0.0

Additional context

Thanks for the great tool! First time I've had this issue, ran the latest tool for a long time without issues, this is the first problem.

@schollz
Copy link
Owner

schollz commented May 23, 2024

export secret on both computers

@meepmeep
Copy link

This mean that we can't use the "old process" with automated generated code ?

@AndrewSkelton
Copy link
Author

Hey @schollz thanks for the prompt reply - I've tried exporting different and the same secrets on both machines and get the same error.

@schollz
Copy link
Owner

schollz commented May 23, 2024

@AndrewSkelton @meepmeep try 10.0.1

@AndrewSkelton
Copy link
Author

@schollz

\e[0m== Architecture detected as x86_64\e[0m
\e[0m== OS detected as Darwin\e[0m
https://github.com/schollz/croc/releases/download/v10.0.1/croc_v10.0.1_macOS-64bit.tar.gz /var/folders/dl/yg3x4x1s75bbf9ph3yd4jrbr0000gn/T/croc.XXXXXX.6vIxAgSgQ0 croc_v10.0.1_macOS-64bit.tar.gz
curl: (22) The requested URL returned error: 404
\e[0;31m== Return code of download tool returned an unexpected value of 22\e[0m

@schollz
Copy link
Owner

schollz commented May 23, 2024

@AndrewSkelton I think you hit the server as binaries were being generated. try it again

@AndrewSkelton
Copy link
Author

@schollz - too keen obviously

Same error (10.1 on both machines)

Debug trace seems fine up to the end

[debug]	16:55:30 croc.go:1047: exchanged header message
securing channel...[debug]	16:55:30 croc.go:1065: ready
[debug]	16:55:30 message.go:61: writing pake message (unencrypted)
[debug]	16:55:31 comm.go:151: initial read error: EOF
[debug]	16:55:31 croc.go:1083: got error receiving: EOF
2024/05/23 16:55:31 could not secure channel

@schollz
Copy link
Owner

schollz commented May 23, 2024

are you using environmental variable?

@AndrewSkelton
Copy link
Author

If I have the same secret on both machines (not sure if that's the assumption?)

[debug]	16:58:06 croc.go:958: data: 
[debug]	16:58:06 croc.go:1047: exchanged header message
securing channel...[debug]	16:58:06 croc.go:1065: ready
[debug]	16:58:06 message.go:61: writing pake message (unencrypted)
[debug]	16:58:07 compress.go:50: error copying data: unexpected EOF
[debug]	16:58:07 croc.go:1434: problem with decoding: unexpected end of JSON input
[debug]	16:58:07 croc.go:1091: data: 
[debug]	16:58:07 croc.go:1092: got error processing: problem with decoding: unexpected end of JSON input
[debug]	16:58:07 croc.go:1146: error: problem with decoding: unexpected end of JSON input
2024/05/23 16:58:07 room (secure channel) not ready, maybe peer disconnected

Both machines have environment variables set with export CROC_SECRET="xxx"
Echoing on both appears to indicate they're set. (echo $CROC_SECRET)

@schollz
Copy link
Owner

schollz commented May 23, 2024

and how are you invoking croc at the command line?

@AndrewSkelton
Copy link
Author

## Sender
export CROC_SECRET="xxx"
croc send x.tar.gz
Sending 'x.tar.gz' (54.5 kB)
Code is: xxx
On the other computer run

croc xxx

## Receiver
export CROC_SECRET="xxx"
croc xxx
securing channel...2024/05/23 17:09:46 could not secure channel

@schollz
Copy link
Owner

schollz commented May 23, 2024

I can't replicate.

try removing your croc config dirs on both computers: ~/.config/croc

@AndrewSkelton
Copy link
Author

Thanks for checking @schollz. Clearing the config didn't help. I reverted the machines back to v9.6.14 (which I had left on another machine), and that worked, so not sure what the root cause is, but thanks all the same for checking.

@schollz
Copy link
Owner

schollz commented May 23, 2024

@AndrewSkelton try v10.0.2, I think I found the culprit and fixed it

@meepmeep
Copy link

indeed, v10.0.2 fixed it, thank you !!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants