Skip to content

golang.org/x/crypto/ssh marshal/unmarshal errors #21491

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

Closed
tobowers opened this issue Aug 17, 2017 · 3 comments
Closed

golang.org/x/crypto/ssh marshal/unmarshal errors #21491

tobowers opened this issue Aug 17, 2017 · 3 comments

Comments

@tobowers
Copy link

Please answer these questions before submitting your issue. Thanks!

What version of Go are you using (go version)?

1.8.3

What operating system and processor architecture are you using (go env)?

amd64 darwin

What did you do?

This program ( https://gist.github.com/tobowers/8118cd1a668926c40909639a2b2af195
) generates the output:

$ go run marshal.go 
2017/08/17 09:53:16 error unmaarshaling: ssh: unmarshal error for field Key of type Certificate: unsupported type: ssh.PublicKey
exit status 1

play.golang apparently doesn't have x/crypto/ssh so I couldn't have it runnable on there.

What did you expect to see?

I expect an immediate call to Unmarshal from a marshaled certificate to succeed without error.

What did you see instead?

The program errors with the output above.

@tobowers
Copy link
Author

hmmm.... changing the code to: https://gist.github.com/tobowers/7df99bac5fb2cb30bb06e4ce4d540364#file-marshaled-fixed-go-L40-L48 works.

It's confusing that you need to use ParsePublicKey and then type assert into a certificate to have this work.

@hanwen
Copy link
Contributor

hanwen commented Aug 30, 2017

ssh.Unmarshal is the mirror ssh.Marshal.

If you want to send a clarification of the SSH package docs, that would be great.

@gopherbot
Copy link
Contributor

Change https://golang.org/cl/95115 mentions this issue: ssh: document how to unmarshal public keys

@golang golang locked and limited conversation to collaborators Feb 27, 2019
bored-engineer pushed a commit to bored-engineer/ssh that referenced this issue Oct 13, 2019
Fixes golang/go#21491.

Change-Id: I5c720f1f6c6acfa7f4cd50920f65db7e57ba3792
Reviewed-on: https://go-review.googlesource.com/95115
Run-TryBot: Han-Wen Nienhuys <[email protected]>
TryBot-Result: Gobot Gobot <[email protected]>
Reviewed-by: Brad Fitzpatrick <[email protected]>
bored-engineer pushed a commit to bored-engineer/ssh that referenced this issue Oct 13, 2019
Fixes golang/go#21491.

Change-Id: I5c720f1f6c6acfa7f4cd50920f65db7e57ba3792
Reviewed-on: https://go-review.googlesource.com/95115
Run-TryBot: Han-Wen Nienhuys <[email protected]>
TryBot-Result: Gobot Gobot <[email protected]>
Reviewed-by: Brad Fitzpatrick <[email protected]>
bored-engineer pushed a commit to bored-engineer/ssh that referenced this issue Oct 13, 2019
Fixes golang/go#21491.

Change-Id: I5c720f1f6c6acfa7f4cd50920f65db7e57ba3792
Reviewed-on: https://go-review.googlesource.com/95115
Run-TryBot: Han-Wen Nienhuys <[email protected]>
TryBot-Result: Gobot Gobot <[email protected]>
Reviewed-by: Brad Fitzpatrick <[email protected]>
c-expert-zigbee pushed a commit to c-expert-zigbee/crypto_go that referenced this issue Mar 28, 2022
Fixes golang/go#21491.

Change-Id: I5c720f1f6c6acfa7f4cd50920f65db7e57ba3792
Reviewed-on: https://go-review.googlesource.com/95115
Run-TryBot: Han-Wen Nienhuys <[email protected]>
TryBot-Result: Gobot Gobot <[email protected]>
Reviewed-by: Brad Fitzpatrick <[email protected]>
c-expert-zigbee pushed a commit to c-expert-zigbee/crypto_go that referenced this issue Mar 29, 2022
Fixes golang/go#21491.

Change-Id: I5c720f1f6c6acfa7f4cd50920f65db7e57ba3792
Reviewed-on: https://go-review.googlesource.com/95115
Run-TryBot: Han-Wen Nienhuys <[email protected]>
TryBot-Result: Gobot Gobot <[email protected]>
Reviewed-by: Brad Fitzpatrick <[email protected]>
LewiGoddard pushed a commit to LewiGoddard/crypto that referenced this issue Feb 16, 2023
Fixes golang/go#21491.

Change-Id: I5c720f1f6c6acfa7f4cd50920f65db7e57ba3792
Reviewed-on: https://go-review.googlesource.com/95115
Run-TryBot: Han-Wen Nienhuys <[email protected]>
TryBot-Result: Gobot Gobot <[email protected]>
Reviewed-by: Brad Fitzpatrick <[email protected]>
BiiChris pushed a commit to BiiChris/crypto that referenced this issue Sep 15, 2023
Fixes golang/go#21491.

Change-Id: I5c720f1f6c6acfa7f4cd50920f65db7e57ba3792
Reviewed-on: https://go-review.googlesource.com/95115
Run-TryBot: Han-Wen Nienhuys <[email protected]>
TryBot-Result: Gobot Gobot <[email protected]>
Reviewed-by: Brad Fitzpatrick <[email protected]>
desdeel2d0m added a commit to desdeel2d0m/crypto that referenced this issue Jul 1, 2024
Fixes golang/go#21491.

Change-Id: I5c720f1f6c6acfa7f4cd50920f65db7e57ba3792
Reviewed-on: https://go-review.googlesource.com/95115
Run-TryBot: Han-Wen Nienhuys <[email protected]>
TryBot-Result: Gobot Gobot <[email protected]>
Reviewed-by: Brad Fitzpatrick <[email protected]>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants