File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change 15
15
package network
16
16
17
17
import (
18
+ "crypto/ecdsa"
19
+ "crypto/elliptic"
18
20
"crypto/rand"
19
- "crypto/rsa"
20
21
"fmt"
21
22
"io/ioutil"
22
23
"net"
@@ -30,7 +31,6 @@ import (
30
31
const (
31
32
defaultPort = 22
32
33
defaultUser = "core"
33
- rsaKeySize = 2048
34
34
)
35
35
36
36
// DefaultSSHDir is a process-global path that can be set, and
@@ -57,7 +57,7 @@ type SSHAgent struct {
57
57
// NewSSHAgent constructs a new SSHAgent using dialer to create ssh
58
58
// connections.
59
59
func NewSSHAgent (dialer Dialer ) (* SSHAgent , error ) {
60
- key , err := rsa .GenerateKey (rand . Reader , rsaKeySize )
60
+ key , err := ecdsa .GenerateKey (elliptic . P256 (), rand . Reader )
61
61
if err != nil {
62
62
return nil , err
63
63
}
Original file line number Diff line number Diff line change @@ -52,7 +52,7 @@ func TestConfCopyKey(t *testing.T) {
52
52
53
53
str := conf .String ()
54
54
55
- if ! strings .Contains (str , "ssh-rsa " ) || ! strings .Contains (str , " core@default" ) {
55
+ if ! strings .Contains (str , "ecdsa-sha2-nistp256 " ) || ! strings .Contains (str , " core@default" ) {
56
56
t .Errorf ("ssh public key not found in config %d: %s" , i , str )
57
57
continue
58
58
}
You can’t perform that action at this time.
0 commit comments