go.crypto/ssh: fix certificate parsing/marshaling.

The change to add the PublicKey interface accidentally caused certificate handling to expect an extra copy of the private key algorithm name in the binary representation. This change adapts a suitable parsing API and adds a test to ensure that cert handling isn't easily broken in the future.

R=agl, hanwen, jmpittman
CC=golang-dev
https://golang.org/cl/13272055
This commit is contained in:
JP Sugarbroad
2013-10-09 12:56:09 -04:00
committed by Adam Langley
parent 4147256c9c
commit 15d8abf5c4
6 changed files with 64 additions and 22 deletions
+1 -1
View File
@@ -100,7 +100,7 @@ func (ak *AgentKey) String() string {
// Key returns an agent's public key as one of the supported key or certificate types.
func (ak *AgentKey) Key() (PublicKey, error) {
if key, _, ok := parsePubKey(ak.blob); ok {
if key, _, ok := ParsePublicKey(ak.blob); ok {
return key, nil
}
return nil, errors.New("ssh: failed to parse key blob")