Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(324)

Delta Between Two Patch Sets: ssh/agent.go

Issue 13415046: code review 13415046: go.crypto/ssh: remove misleading marshalPrivRSA. (Closed)
Left Patch Set: Created 11 years, 6 months ago
Right Patch Set: diff -r 1d2f9a3b9863 https://code.google.com/p/go.crypto Created 11 years, 6 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
Right: Side by side diff | Download
« no previous file with change/comment | « no previous file | ssh/certs.go » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
(no file at all)
1 // Copyright 2012 The Go Authors. All rights reserved. 1 // Copyright 2012 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style 2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file. 3 // license that can be found in the LICENSE file.
4 4
5 package ssh 5 package ssh
6 6
7 import ( 7 import (
8 "encoding/base64" 8 "encoding/base64"
9 "errors" 9 "errors"
10 "io" 10 "io"
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 case *failureAgentMsg: 199 case *failureAgentMsg:
200 return nil, errors.New("ssh: failed to list keys") 200 return nil, errors.New("ssh: failed to list keys")
201 } 201 }
202 return nil, UnexpectedMessageError{agentIdentitiesAnswer, msgType} 202 return nil, UnexpectedMessageError{agentIdentitiesAnswer, msgType}
203 } 203 }
204 204
205 // SignRequest requests the signing of data by the agent using a protocol 2 key 205 // SignRequest requests the signing of data by the agent using a protocol 2 key
206 // as defined in [PROTOCOL.agent] section 2.6.2. 206 // as defined in [PROTOCOL.agent] section 2.6.2.
207 func (ac *AgentClient) SignRequest(key interface{}, data []byte) ([]byte, error) { 207 func (ac *AgentClient) SignRequest(key interface{}, data []byte) ([]byte, error) {
208 req := marshal(agentSignRequest, signRequestAgentMsg{ 208 req := marshal(agentSignRequest, signRequestAgentMsg{
209 » » KeyBlob: serializePublickey(key), 209 » » KeyBlob: serializePublicKey(key),
210 Data: data, 210 Data: data,
211 }) 211 })
212 212
213 msg, msgType, err := ac.sendAndReceive(req) 213 msg, msgType, err := ac.sendAndReceive(req)
214 if err != nil { 214 if err != nil {
215 return nil, err 215 return nil, err
216 } 216 }
217 217
218 switch msg := msg.(type) { 218 switch msg := msg.(type) {
219 case *signResponseAgentMsg: 219 case *signResponseAgentMsg:
(...skipping 21 matching lines...) Expand all
241 case agentSignResponse: 241 case agentSignResponse:
242 msg = new(signResponseAgentMsg) 242 msg = new(signResponseAgentMsg)
243 default: 243 default:
244 return nil, 0, UnexpectedMessageError{0, packet[0]} 244 return nil, 0, UnexpectedMessageError{0, packet[0]}
245 } 245 }
246 if err := unmarshal(msg, packet, packet[0]); err != nil { 246 if err := unmarshal(msg, packet, packet[0]); err != nil {
247 return nil, 0, err 247 return nil, 0, err
248 } 248 }
249 return msg, packet[0], nil 249 return msg, packet[0], nil
250 } 250 }
LEFTRIGHT
« no previous file | ssh/certs.go » ('j') | Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Toggle Comments ('s')

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b