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

examples/simpleclient: gives 513 Unrecognized command argument: Invalid key type #83

Open
Delta456 opened this issue Aug 18, 2023 · 10 comments

Comments

@Delta456
Copy link

I am using the example given in the repo, and when I run it I get this error:

image

@cretz
Copy link
Owner

cretz commented Aug 18, 2023

I don't devote enough time to this project to be able to debug this at this time. However, if you are able to debug the Tor control protocol and see what it may not like and/or if we're not prepared for some newer/older Tor version, we'd welcome any fixes.

@elimisteve
Copy link

elimisteve commented Aug 18, 2023

Hey @cretz, thanks for the quick response; we appreciate it. (I'm working with @Delta456 on this.)

..., if you are able to debug the Tor control protocol ...

Does the 513 suggest to you that it's the Tor control protocol that is giving us this error?

@elimisteve
Copy link

Any related quick little pointers you have would helpful, thanks.

@elimisteve
Copy link

elimisteve commented Aug 18, 2023

... and/or if we're not prepared for some newer/older Tor version ...

We may try building against a newer version of the Tor daemon 👍 .

@elimisteve
Copy link

I now see in https://github.com/torproject/torspec/blob/main/control-spec.txt --

"513 syntax error in configuration values" reply on syntax error

Looks like a control protocol issue indeed, yay; progress.

@cretz
Copy link
Owner

cretz commented Aug 18, 2023

Any related quick little pointers you have would helpful, thanks.

Set tor.StartConf.DebugWriter which will then log all interaction back and forth with the control port on that writer (e.g. os.Stdout). Granted that's assuming the error doesn't happen before that writer is set.

@elimisteve
Copy link

@cretz Awesome, thank you! We'll try that.

@Delta456
Copy link
Author

Here is what I get

Connecting to control port 33685
Write line: PROTOCOLINFO
Read line: 250-PROTOCOLINFO 1
Read line: 250-AUTH METHODS=COOKIE,SAFECOOKIE COOKIEFILE="/home/delta/Documents/programs/data-dir-2197588529/control_auth_cookie"
Read line: 250-VERSION Tor="0.4.7.14"
Read line: 250 OK
Write line: AUTHCHALLENGE SAFECOOKIE 
Read line: 250 AUTHCHALLENGE SERVERHASH=
SERVERNONCE=
Write line: AUTHENTICATE 
Read line: 250 OK
Write line: ADD_ONION NEW:RSA1024 Port=80,127.0.0.1:8080
Read line: 513 Invalid key type
Closing onion .onion:80
Closing Tor
Write line: SIGNAL HALT
Read line: 250 OK
Write line: QUIT
2023/08/23 11:44:37 513 Unrecognized command argument: Invalid key type
exit status 1

@cretz
Copy link
Owner

cretz commented Aug 23, 2023

I think when you create a v3 onion key, you have to use to use ED25519-V3 but here it is trying to set RSA1024. What does your ListenConf look like? I think you can just leave Key as nil and set Version3 to true.

@PentaMine
Copy link

For me the issue seemed to be occuring while creating the onion service. Changing

onion, err := t.Listen(listenCtx, &tor.ListenConf{RemotePorts: []int{80}})

to

onion, err := t.Listen(listenCtx, &tor.ListenConf{RemotePorts: []int{80}, Version3: true})

seemed to resolve the issue.

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

No branches or pull requests

4 participants