What version of Go are you using (go version)?
$ go version
go1.12.5
Does this issue reproduce with the latest release?
Not applicable
What did you do?
What did you expect to see?
Expected to see an error stating it requires a pointer, or for it to resolve instead
What did you see instead?
panic: x509: only RSA and ECDSA public keys supported
My suggestion, in https://golang.org/src/crypto/x509/x509.go?s=3023:3081#L68 , the function marshalPublicKey add 2 cases with simple recursion:
case rsa.PublicKey:
return marshalPublicKey(&pub)
case ecdsa.PublicKey
return marshalPublicKey(&pub)
Or same as above, but return error that states that it must be a pointer.
What version of Go are you using (
go version)?Does this issue reproduce with the latest release?
Not applicable
What did you do?
What did you expect to see?
Expected to see an error stating it requires a pointer, or for it to resolve instead
What did you see instead?
panic: x509: only RSA and ECDSA public keys supported
My suggestion, in https://golang.org/src/crypto/x509/x509.go?s=3023:3081#L68 , the function marshalPublicKey add 2 cases with simple recursion:
case rsa.PublicKey: return marshalPublicKey(&pub) case ecdsa.PublicKey return marshalPublicKey(&pub)Or same as above, but return error that states that it must be a pointer.