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

Side by Side Diff: ssh/agent/agent_test.go

Issue 37880044: code review 37880044: gosshnew/ssh/agent: fix test for ssh.Conn reorganization. (Closed)
Patch Set: diff -r c8e1e80a995c https://hanwen%40google.com@code.google.com/p/gosshnew/ Created 10 years, 3 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:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 agent 5 package agent
6 6
7 import ( 7 import (
8 "bytes" 8 "bytes"
9 "crypto/rsa" 9 "crypto/rsa"
10 "crypto/x509" 10 "crypto/x509"
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 t.Errorf("Insert: %v", err) 160 t.Errorf("Insert: %v", err)
161 } 161 }
162 162
163 serverConf := ssh.ServerConfig{} 163 serverConf := ssh.ServerConfig{}
164 serverConf.AddHostKey(rsaKey) 164 serverConf.AddHostKey(rsaKey)
165 serverConf.PublicKeyCallback = func(c ssh.ConnMetadata, algo string, pub key []byte) bool { 165 serverConf.PublicKeyCallback = func(c ssh.ConnMetadata, algo string, pub key []byte) bool {
166 return bytes.Equal(pubkey, ssh.MarshalPublicKey(rsaKey.PublicKey ())) 166 return bytes.Equal(pubkey, ssh.MarshalPublicKey(rsaKey.PublicKey ()))
167 } 167 }
168 168
169 go func() { 169 go func() {
170 » » _, err := ssh.Server(a, &serverConf) 170 » » conn, _, _, err := ssh.NewServerConn(a, &serverConf)
171 if err != nil { 171 if err != nil {
172 t.Fatalf("Server: %v", err) 172 t.Fatalf("Server: %v", err)
173 } 173 }
174 conn.Close()
174 }() 175 }()
175 176
176 conf := ssh.ClientConfig{} 177 conf := ssh.ClientConfig{}
177 conf.Auth = append(conf.Auth, ssh.ClientAuthKeyring(agent)) 178 conf.Auth = append(conf.Auth, ssh.ClientAuthKeyring(agent))
178 » if _, err := ssh.Client(b, &conf); err != nil { 179 » conn, _, _, err := ssh.NewClientConn(b, "", &conf)
179 » » t.Fatalf("Client: %v", err) 180 » if err != nil {
181 » » t.Fatalf("NewClientConn: %v", err)
180 } 182 }
183 conn.Close()
181 } 184 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

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